Rails / ActionCable connection no longer working

We had action cable / rails working on another platform, but in our move to Render, we noticed that we could not connect to websockets via actioncable anymore. There haven’t been any changes to the application code, so I’m wondering if this is related to some setting that needs to be enabled/toggled on Render?

Ruby 2.7.5
Rails 5.2.8

The attempt to connect to ActionCable/Websockets now returns the following error:

“Invalid Sec-WebSocket-Accept response”

When trying to connect via a mobile app.

Redis is config’d properly, and I’ve verified that the REDIS_URL env variable is correct in the config/cable.yml

redis: &redis
  adapter: redis
  url: redis://localhost:6379/1

development: *redis

  adapter: async

  adapter: redis
  url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>

The render build script is very simple, in case it’s relevant at all:

set -o errexit

bundle install
bundle exec rake assets:precompile
bundle exec rake assets:clean
bundle exec rake db:migrate

I have taken a look at this thread, but it was not the solution for us.

We’ve reached out to the user through another support channel for more information on their service so we can investigate further.

To update the wider audience here - we’ve been working with the OP here to figure out what’s going on here. We’ve confirmed that Websockets work fully as expected for Rails7 and the the specific version in use here 5.2.8.

The OPs client is a React Native app deployed to an iOS simulator locally but again using our own test cases we’ve created a similar app and it’s able to interact with the websockets exposed by the app running on us.

What remains curious is why this same code works fine on other providers but not on us and we continue to work with the OP to get to the bottom of this.

John B

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.