Rails 5 на AWS Elastic Beanstalk получает ошибку пумы (getcwd) - PullRequest
0 голосов
/ 13 сентября 2018

Я развертывал Rails 5 API на AWS Elastic Beanstalk каждый раз, когда это работало, но Puma не начала работать.Puma запускается на мгновение и сама выключается

Журнал ошибок для EB

[27782] - Worker 0 (pid: 27795) booted, phase: 0
[27782] - Worker 1 (pid: 27801) booted, phase: 0
[27782] - Gracefully shutting down workers...
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot accessparent directories: No such file or directory
/opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in 'getwd': No such file or 
directory - getcwd (Errno::ENOENT) 
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in'pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in 'block in pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/2.5.0/monitor.rb:226:in'mon_synchronize'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:70:in 'pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:43:in 'block in report'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:42:in 'each'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:42:in 'report'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:96:in 'request_issue_report_for'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:46:in 'log_error'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:126:in 'rescue in with_friendly_errors'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:121:in 'with_friendly_errors'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/exe/bundle:22:in '<top (required)>'
from /opt/rubies/ruby-2.5.1/bin/bundle:23:in 'load'
from /opt/rubies/ruby-2.5.1/bin/bundle:23:in '<main>'
=== puma startup: 2018-09-13 13:26:58 +0700 ===
=== puma startup: 2018-09-13 13:26:58 +0700 ===
[28563] - Worker 1 (pid: 28585) booted, phase: 0
[28563] - Worker 0 (pid: 28581) booted, phase: 0

Я проверил VPC, группу безопасности, базу данных и redis, Все эти работают нормально

I 'установленное на старом сервере работает, но я пытаюсь создать новый сервер и использовать тот же конфиг

обновление puma.rb

threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count

port ENV.fetch("PORT") { 3003 }

environment ENV.fetch("RAILS_ENV") { "development" }

plugin :tmp_restart

обновление puma.config

files:
   "/opt/elasticbeanstalk/support/conf/pumaconf.rb":
    mode: "000644"
  content: |
  directory '/var/app/current'
  workers Integer(ENV['WEB_CONCURRENCY'] || 2)
  threads_count = Integer(ENV['MAX_THREADS'] || 16)
  threads threads_count, threads_count
  bind 'unix:///var/run/puma/my_app.sock'
  stdout_redirect '/var/log/puma/puma.log', '/var/log/puma/puma.log', true
  daemonize false
...