Early termination of worker puma log是什么意思,为什么会发生这种情况?

问题描述 投票:1回答:1

在我的Elastic Beanstalk实例中,我收到了一个 "早期终止 "的日志。504 状态码响应,每当我访问它。当我跟踪日志时,我在puma应用服务器上看到以下日志。

==> /var/log/puma/puma.log <==
[27240] Early termination of worker
[27245] Early termination of worker
[27249] Early termination of worker
[27253] Early termination of worker
[27257] Early termination of worker
[27261] Early termination of worker
[27265] Early termination of worker
[27269] Early termination of worker
[27273] Early termination of worker
[27277] Early termination of worker

What does Early termination of worker 是什么意思,为什么会发生这种情况?此外,这个日志是否表明了我在远程环境中所面临的超时错误的原因?rails应用和puma在我的本地机器(Mac OS Catalina 10.15)上运行完美。然而,在我的远程Elastic beanstalk环境中,如上所述,我得到了一个超时504的错误,而我在日志中看到的唯一东西是上面的puma日志。

这是我的 gemfile。

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.1'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use haml view syntax
gem 'haml-rails'

# the main komponent gem is broken for Rails 6, see:
# https://github.com/komposable/komponent/issues/133
gem 'komponent', github: '0x2C6/komponent'
gem 'elasticsearch', '~> 6.2'
gem 'redis'

# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'pry-rails'
  gem 'rspec-rails', '~> 3.9'
  gem 'dotenv-rails'
  gem 'awesome_print'
end

group :beta, :production do
  gem 'puma_worker_killer'
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'spring-commands-rspec'
   # Avoid polling for changes (Windows)
  gem 'wdm', '>= 0.1.0', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
end

group :test do
  gem 'webmock'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
ruby-on-rails amazon-elastic-beanstalk puma
1个回答
2
投票

我的情况的问题是使用的puma的补丁版本不同。

要点是AWS Elastic Beanstalk使用的是 puma 4.3.3 在我使用 puma 4.3.5.

不得不修复版本的 puma 在我的Gemfile中使用的正是 4.3.3 匹配AWS Elastic Beanstalk使用的堆栈,以防止这个错误。

更多细节请见 我的这个回答 的类似问题。


1
投票

好吧,这花了很多调试,走了很多不同的兔子洞。问题非常痛苦地简单。我创建了一个我拼写错误的类,并将其称为, GetLitsingsResponse. 在把班级改为 GetListingsResponse Puma在我的远程AWS Elastic beanstalk环境中工作得很好。很奇怪的是在我的Mac OS上本地的Puma没有问题。但是在64位Amazon Linux 2018.03 v2.11.4运行Ruby 2.6 (Puma)平台上Puma就不能正常工作了。

© www.soinside.com 2019 - 2024. All rights reserved.