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

Puma randomly failed to start a worker #1572

Closed
F4Ke opened this issue Apr 27, 2018 · 4 comments
Closed

Puma randomly failed to start a worker #1572

F4Ke opened this issue Apr 27, 2018 · 4 comments

Comments

@F4Ke
Copy link

F4Ke commented Apr 27, 2018

hi,

After upgrading from unicorn to puma, i've encounter a strange error;
Sometimes when worker are starting, they start on the bad ruby version, and so causes an error.
This error causes 503 on my application because the worker is not starting properly.

this is my error :

app[web.3]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma)
app[web.3]: SignalException: SIGTERM

But I a not on ruby 2.5.0

System configuration

Ruby version: 2.5.1
Rails version: 5.1.4
Puma version: 3.11.4
on heroku.

Somebody has an idea ?

After upgrading from unicorn to puma, i've encounter a strange error;

Sometimes when worker are starting, they start on the bad ruby version, and so causes an error. It seems to be random...

This error causes 503 on my application because the worker is not starting properly.

this is my error :

app[web.3]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma)
app[web.3]: SignalException: SIGTERM
But I a not on ruby 2.5.0

System configuration:

Ruby version: 2.5.1

Rails version: 5.1.4

Puma version: 3.11.4

( on heroku )

Somebody has an idea ?

EDIT :

Procfile :


web: bundle exec puma -C config/puma.rb
worker:  bundle exec rake jobs:work
shoryuken_worker:  bundle exec shoryuken -R -C config/shoryuken.yml

puma.rb :

workers Integer(ENV['WEB_CONCURRENCY'] || 4) # WEB_CONCURRENCY = 3
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 4) # RAILS_MAX_THREADS = 5
threads threads_count, threads_count

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RAILS_ENV'] || 'development'

on_worker_boot do
  # Worker specific setup for Rails 4.1+
  # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
end

Gemfile : gem 'puma'

@F4Ke F4Ke changed the title Puma starting on bad ruby version Puma randomly failed to start a worker Apr 27, 2018
@lucasgerard
Copy link

Hey, having the same issue here, with the same system configuration except for rails, which is 4.2.10

@kendrikat
Copy link

kendrikat commented Jul 24, 2018

Same here on heroku when dynos are restarted:

ruby 2.5.0p0
puma 3.11.2

EDIT: Related #1438 (comment) which seems fixed in bundler 1.16.x Heroku is still using 15.x and I didn't found any painless method to set bundle config disable_exec_load true on heroku.

@DennisWormald
Copy link

DennisWormald commented Aug 8, 2018

@kendrikat in your heroku cli run:
heroku config:set "BUNDLE_DISABLE_EXEC_LOAD"="true"

@nateberkopec
Copy link
Member

See also #1438

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

5 participants