Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionCable not working #693

Closed
initseis opened this issue Feb 25, 2024 · 2 comments
Closed

ActionCable not working #693

initseis opened this issue Feb 25, 2024 · 2 comments

Comments

@initseis
Copy link

Hi guys, I’m so sorry, English is not my first language,

I deployed my app with Kamal but ActionCable (I am using Turbo Broadcast) is not working, any of you went through this?

  • This is the Firefox error
image
  • This is my deploy.yml file
service: atenas

image: k3vin/atenas

traefik:
  options:
    publish:
      - "443:443"
    volume:
      - "/letsencrypt/acme.json:/letsencrypt/acme.json"
    network: "private"
  args:
    entryPoints.web.address: ":80"
    entryPoints.websecure.address: ":443"
    entryPoints.web.http.redirections.entryPoint.to: websecure
    entryPoints.web.http.redirections.entryPoint.scheme: https
    entryPoints.web.http.redirections.entryPoint.permanent: true
    certificatesResolvers.letsencrypt.acme.email: "support@atenas.app"
    certificatesResolvers.letsencrypt.acme.storage: "/letsencrypt/acme.json"
    certificatesResolvers.letsencrypt.acme.httpchallenge: true
    certificatesResolvers.letsencrypt.acme.httpchallenge.entrypoint: web

servers:
  web:
    hosts:
      - 5.78.78.254
    labels:
      traefik.http.routers.atenas-web.entrypoints: websecure
      traefik.http.routers.atenas-web.rule: Host(`atenas.app`)
      traefik.http.routers.atenas-web.tls.certresolver: letsencrypt
    options:
      network: "private"
  job:
    hosts:
      - 5.78.78.254
    cmd: bundle exec sidekiq
    options:
      network: "private"

registry:
  username: k3vin

  password:
    - KAMAL_REGISTRY_PASSWORD

env:
  clear:
    HOSTNAME: atenas.app
    DB_HOST: 5.78.78.254
    RAILS_LOG_TO_STDOUT: true
    REDIS_URL: "redis://atenas-redis:6379/0"
  secret:
    - RAILS_MASTER_KEY
    - POSTGRES_PASSWORD
    - SIDEKIQ_USERNAME
    - SIDEKIQ_PASSWORD



accessories:
  db:
    image: postgres:15
    host: 5.78.78.254
    port: 5432
    env:
      clear:
        POSTGRES_USER: "atenas"
        POSTGRES_DB: "atenas_production"
      secret:
        - POSTGRES_PASSWORD
    files:
      - db/production.sql:/docker-entrypoint-initdb.d/setup.sql
    directories:
      - data:/var/lib/postgresql/data
  redis:
    image: redis:latest
    roles:
      - web
      - job
    cmd: "redis-server"
    volumes:
      - /var/lib/redis:/data
    options:
      network: "private"

Thanks in advance.

@initseis
Copy link
Author

I think ActionCable failed when I upgraded from 7.0.6 to 7.1 so I had to start a new project and copy all my files and now it is working.

@germanotm
Copy link

I encountered the same error and was able to resolve it by setting allowed_request_origins in production.rb as follows:

config.action_cable.allowed_request_origins = ['https://rubyonrails.com', %r{http://ruby.*}]

ActionClable permits connections from specified origins. For more information, see the Ruby on Rails Guides on Action Cable. https://guides.rubyonrails.org/action_cable_overview.html#allowed-request-origins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants