I'm attempting to deploy a standalone ActionCable server for our rails app. The app is working locally in development mode fine but when deployed to production the client is unable to establish a connection. The problem manifests as the following:

These are repeated 101 Switching Protocol requests with an upgrade response. The requests never go further than this and repeat at roughly six second intervals. On the server I'm running Puma and I can see the incoming requests:

I've ensured I'm sharing cookies between the main domain and the subdomain (and can see the cookies being passed) but I never see the connection get upgraded.
Some notes:
I'm out of ideas so would appreciate some thoughts on what I could try next to debug this!
So I eventually got to the bottom of this. For those following in my footsteps it was an issue around cookie name-spacing. Essentially the cookies were not being set the domain level so therefore were not being shared with the cable server (which was on a subdomain).
If you're suffering a similar issue try running the cable server in development mode while the app runs in production - the additional log output should make it easier to figure out what is going on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With