问题
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 of worker". I don't have any custom configurations nor settings for that project. Simply created an environment and uploaded archived zip file.
After I kill puma processes with command pkill -9 -f puma
my puma.log file looks like below:
=== puma startup: 2020-01-22 13:17:45 +0000 ===
=== puma startup: 2020-01-22 13:17:45 +0000 ===
[28858] Early termination of worker
[28856] Early termination of worker
[28862] Early termination of worker
[28865] Early termination of worker
[28869] Early termination of worker
I searched that error and found nothing for solve.
- Ruby version: 2.6.5
- Puma version 4.3.1
- Rails version: 6.0.2.1
I am using Puma with Ruby 2.6 running on 64bit Amazon Linux/2.11.2 on AWS.
回答1:
Met the same error. Turns out it is a different PATCH of puma.
I was using this stack from elastic beanstalk
Ruby 2.6 AL2 version 3.0.1
64bit Amazon Linux 2 v3.0.1 running Ruby 2.6
Ruby 2.6.6-p146
RubyGems 3.1.2
Puma 4.3.3
...
My project's Gemfile
included puma
this way.
gem 'puma', '~> 4.3.3'
My project was a boilerplate for new projects that were coming my way, so things were working fine for "old" projects until the newer patch version, puma 4.3.5 as of now, came out.
Solution is to fix the version of the gem in the Gemfile as such:
gem 'puma', '= 4.3.3'
Lesson learnt is to always match your environment with that of your deployment tool. Keep track of the latest solution stack versions here.
回答2:
I forgot to tell about my project structure. I have a directory called overrides in under app/ folder.
Finally, I found at that app/overrides folder causes puma crash maybe related with this issue: How to ignore a folder in Zeitwerk for Rails 6?
After I changed my environment.rb file with ignoring app/overrides folder, my project started to run smoothly.
来源:https://stackoverflow.com/questions/59861277/puma-stuck-with-message-early-termination-of-worker-on-rails-6-api-only-projec