Rails 7, кабель действия: произошла ошибка WebSocket: неправильное количество аргументов (задано 2, ожидается 1)

У меня есть приложение Rails 7, на котором работает кабель действия, и кабель готов к работе на linode. Локально работает нормально.

Однако на постановочном действии кабель не работает.

      Started GET "/cable" for 109.155.210.18 at 2023-06-22 15:24:01 +0100
Started GET "/cable" [WebSocket] for 109.155.210.18 at 2023-06-22 15:24:01 +0100
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: upgrade, HTTP_UPGRADE: websocket)
WebSocket error occurred: wrong number of arguments (given 2, expected 1)
WebSocket error occurred: wrong number of arguments (given 2, expected 1)
WebSocket error occurred: wrong number of arguments (given 2, expected 1)
      nginx version: nginx/1.14.0 (Ubuntu)
Phusion Passenger 6.0.1
rails (7.0.4.3)
ruby 3.2.0
actioncable (= 7.0.4.3)
cable_ready (= 5.0.0)
websocket-driver (0.7.5)

кабель.yml

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

канал.рб

      module ApplicationCable
  class Channel < ActionCable::Channel::Base
    include CableReady::Broadcaster
  end
end

Connection.rb

      module ApplicationCable
  class Connection < ActionCable::Connection::Base
  end
end

среды/staging.rb

        config.cache_store = :redis_cache_store, {
    driver: :hiredis,
    url: ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" }
  }

  config.session_store(
    :redis_session_store,
    key: "_session_staging",
    serializer: :json,
    redis: {
      driver: :hiredis,
      expire_after: 1.year,
      ttl: 1.year,
      url: ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" }
    }
  )

конфигурация nginx

      listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/:app_name/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/:app_name/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
location /cable {
  passenger_app_group_name wdpa_action_cable;
  passenger_force_max_concurrent_requests_per_process 0;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
}

Пробовал: экспериментировал с конфигом, не получилось

ActionCable в ElasticBeanstalk завершается сбоем из-за неотслеживаемой ошибки

0 ответов

Другие вопросы по тегам