Puma stuck with message “Early termination of worker” on Rails 6 API only project at Elastic Beanstalk

后端 未结 6 521
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-17 11:41

I have a Rails 6 api-only application which I am failed to run at AWS Elastic Beanstalk. After deployment of that application, puma stucks with message \"Early termination o

6条回答
  •  感动是毒
    2021-01-17 12:39

    My puma config had an "on_worker_boot" block that was attempting a db connection. In my case I have a primary + replica setup in rails. Removing this connection statement from our puma config resolves the Early termination of worker error.

    ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[ENV.fetch('RAILS_ENV')])

    • Ruby version: 2.6.2
    • Puma version 4.3.5
    • Rails version: 6.0.3.2

提交回复
热议问题