Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 639
yigit Avatar asked Jan 22 '20 13:01

yigit


1 Answers

For the recent update from version 3.1.1 to 3.1.2 of the Ruby 2.6 running on 64bit Amazon Linux 2 platform, after checking the puma log in /var/log/puma/puma.log in my EC2 instance, it shows what you mention:

[XXXXX] Early termination of worker
[XXXXX] + Gemfile in context: /var/app/current/Gemfile

so, for checking what the actual error is, I entered my app's code folder /var/app/current and ran

pumactl start

this shows the actual error:

[XXXXX] Unable to load application: Gem::LoadError: You have already activated nio4r 2.5.3, but your Gemfile requires nio4r 2.5.2. Prepending `bundle exec` to your command may solve this.

So, since it says that there is a conflict of nio4r versions, I fixed it by forcing nio4r version to 2.5.3 adding this to my Gemfile:

gem 'nio4r', '2.5.3'

and then running bundle update, commiting and pushing changes and deploying.

like image 183
Fito Avatar answered Sep 20 '22 08:09

Fito