Score:0

AWS ElasticBeanstalk: Early termination of worker [puma] Loading development - gems?

cn flag

I'm currently upgrading rails from 6 to 7 and so had to upgrade my eb platform-version as well (to run ruby-3.0).

Now puma isn't able to start and always looping through:

[13033] + Gemfile in context: /var/app/current/Gemfile
[13033] ! Unable to start worker
[13033] /opt/rubies/ruby-3.0.3/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:309:in `check_for_activated_spec!'
[13033] Early termination of worker
[13035] + Gemfile in context: /var/app/current/Gemfile
[13035] ! Unable to start worker
[13035] /opt/rubies/ruby-3.0.3/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:309:in `check_for_activated_spec!'
[13035] Early termination of worker
[13037] + Gemfile in context: /var/app/current/Gemfile

When I try to start manually, it is trying to load all the gems from the development-group (which of course aren't available) BUT WHY?!

$ bundle exec puma -p 3000 -e production
Could not find byebug-11.1.3, rspec-rails-3.9.1, graphiql-rails-1.8.0, spring-2.1.1, spring-watcher-listen-2.0.1, rack-cors-1.1.1, annotate-3.2.0, letter_opener-1.8.0, rspec-core-3.9.3, rspec-expectations-3.9.4, rspec-mocks-3.9.1, rspec-support-3.9.4, sprockets-rails-3.4.2, listen-3.7.1, launchy-2.5.0, diff-lcs-1.5.0, sprockets-4.0.3, rb-fsevent-0.11.1, rb-inotify-0.10.1, addressable-2.8.0, public_suffix-4.0.6 in any of the sources
Run `bundle install` to install missing gems.

RAILS_ENV/RACK_ENV are set to production for sure...

Any ideas? :)

UPDATE:

The environment variables (properly set via aws-eb console) aren't available in the shell-session (eb ssh). Is that normal behavior?

ru flag
Did you ever figure this out? Currently having the same problem.
cn flag
@ev0lution Unfortunately not. Switched to another infrastructure in the end. Luckily we're still in an early-stage atm. Would never use EB for a prod environment again. Currently running on render.com...
Score:0
cn flag

This stems from a mismatch of the version of puma running on your eb environment and the puma version running in your application or Gemfile.

To get the puma version running on your eb environment:

eb ssh <environment>
puma -V

Make sure this version matches what you have in your Gemfile.

As far as why environment variables are not running in your shell. You will need to add an ebextension to set this up. Below is a file you can create in .ebextensions to automatically load your env variables into your shell session.

    # .ebextensions/setenvvars.config
commands:
  setvars:
    command: /opt/elasticbeanstalk/bin/get-config environment | jq -r 'to_entries | .[] | "export \(.key)=\"\(.value)\""' > /etc/profile.d/eb_envvars.sh
packages:
  yum:
    jq: []
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.