#ruby-on-rails #nginx #passenger #passenger-nginx
#ruby-on-rails #nginx #пассажир #пассажир-nginx
Вопрос:
У меня есть приложение Rails 6, обслуживаемое Passenger / Nginx.
Я только что перезагрузил (рабочий) сервер и теперь получаю сообщение об ошибке:
Missing encryption key to decrypt file with. Ask your team for your master key and write it to /home/deployer/releases/20201114191912/config/master.key or put it in the ENV['RAILS_MASTER_KEY'].
Тем не менее, я предоставляю главный ключ ENV['RAILS_MASTER_KEY']
через конфигурационный файл Nginx vhost /etc/nginx/sites-available/my_site
(который всегда работал в прошлом):
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name www.my_site.com;
passenger_env_var RAILS_MASTER_KEY 4f9b18f1...f7cf2e0545;
[...]
}
У кого-нибудь есть идея, как заставить его снова работать?
Ответственная команда:
/usr/bin/passenger_free_ruby /usr/share/passenger/helper-scripts/rack-preloader.rb
Оставшаяся трассировка стека ошибок:
App 2214 output: Error: The application encountered the following error: exit (SystemExit)
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/railtie.rb:60:in `exit'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/railtie.rb:60:in `rescue in block in <class:Railtie>'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/railtie.rb:56:in `block in <class:Railtie>'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `instance_exec'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `run'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:61:in `block in run_initializers'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:347:in `each'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:347:in `call'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
App 2214 output: /home/deployer/.rbenv/versions/2.7.2/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:60:in `run_initializers'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/application.rb:363:in `initialize!'
App 2214 output: /home/deployer/releases/20201115171757/config/environment.rb:5:in `<top (required)>'
App 2214 output: config.ru:3:in `require_relative'
App 2214 output: config.ru:3:in `block in <main>'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval'
App 2214 output: /home/deployer/shared/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'
App 2214 output: config.ru:1:in `new'
App 2214 output: config.ru:1:in `<main>'
App 2214 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `eval'
App 2214 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `preload_app'
App 2214 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
App 2214 output: /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:378:in `run_block_and_record_step_progress'
App 2214 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
App 2214 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
App 2214 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
[ E 2020-11-15 17:18:26.6435 658/Tt age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /home/deployer/current
Комментарии:
1. может быть, в объявлении env есть 2 пробела?
RAILS_MASTER_KEY(here) 4f9b18f1...f7cf2e0545;
2. @nuaky — Спасибо! В объявлении было 2 пробела. Когда я установил его на 1 пробел, все снова заработало. Как ни странно, когда я снова установил его на 2 или более пробела, все по-прежнему работало (снова). Странно… но спасибо!