Gem update後にRedmineが起動不可となったのでその対策


何度か遭遇するのですが、直すたびに忘れてしまうので備忘を兼ねてメモ。

症状

gem update後にOS標準のpassengerから起動しているRedmineが起動不可となった。エラーメッセージは以下の通り。

App 7382 stdout:
App 7382 stderr: /usr/lib/ruby/2.7.0/cgi/util.rb:30: warning: already initialized constant CGI::Util::TABLE_FOR_ESCAPE_HTML__
App 7382 stderr: /var/lib/gems/2.7.0/gems/cgi-0.2.0/lib/cgi/util.rb:30: warning: previous definition of TABLE_FOR_ESCAPE_HTML__ was here
App 7382 stderr: /usr/lib/ruby/2.7.0/cgi/util.rb:178: warning: already initialized constant CGI::Util::RFC822_DAYS
App 7382 stderr: /var/lib/gems/2.7.0/gems/cgi-0.2.0/lib/cgi/util.rb:178: warning: previous definition of RFC822_DAYS was here
App 7382 stderr: /usr/lib/ruby/2.7.0/cgi/util.rb:181: warning: already initialized constant CGI::Util::RFC822_MONTHS
App 7382 stderr: /var/lib/gems/2.7.0/gems/cgi-0.2.0/lib/cgi/util.rb:181: warning: previous definition of RFC822_MONTHS was here
App 7382 stderr: /usr/lib/x86_64-linux-gnu/ruby/2.7.0/psych.so: warning: already initialized constant Psych::Parser::ANY
App 7382 stderr: /usr/lib/x86_64-linux-gnu/ruby/2.7.0/psych.so: warning: already initialized constant Psych::Parser::UTF8
App 7382 stderr: /usr/lib/x86_64-linux-gnu/ruby/2.7.0/psych.so: warning: already initialized constant Psych::Parser::UTF16LE
App 7382 stderr: /usr/lib/x86_64-linux-gnu/ruby/2.7.0/psych.so: warning: already initialized constant Psych::Parser::UTF16BE
App 7382 stderr: /usr/lib/x86_64-linux-gnu/ruby/2.7.0/stringio.so: warning: already initialized constant StringIO::VERSION
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:7: warning: already initialized constant Psych::ClassLoader::BIG_DECIMAL
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:7: warning: previous definition of BIG_DECIMAL was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:8: warning: already initialized constant Psych::ClassLoader::COMPLEX
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:8: warning: previous definition of COMPLEX was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:9: warning: already initialized constant Psych::ClassLoader::DATE
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:9: warning: previous definition of DATE was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:10: warning: already initialized constant Psych::ClassLoader::DATE_TIME
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:10: warning: previous definition of DATE_TIME was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:11: warning: already initialized constant Psych::ClassLoader::EXCEPTION
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:11: warning: previous definition of EXCEPTION was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:12: warning: already initialized constant Psych::ClassLoader::OBJECT
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:12: warning: previous definition of OBJECT was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:13: warning: already initialized constant Psych::ClassLoader::PSYCH_OMAP
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:13: warning: previous definition of PSYCH_OMAP was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:14: warning: already initialized constant Psych::ClassLoader::PSYCH_SET
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:14: warning: previous definition of PSYCH_SET was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:15: warning: already initialized constant Psych::ClassLoader::RANGE
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:15: warning: previous definition of RANGE was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:16: warning: already initialized constant Psych::ClassLoader::RATIONAL
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:16: warning: previous definition of RATIONAL was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:17: warning: already initialized constant Psych::ClassLoader::REGEXP
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:17: warning: previous definition of REGEXP was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:18: warning: already initialized constant Psych::ClassLoader::STRUCT
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:18: warning: previous definition of STRUCT was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:19: warning: already initialized constant Psych::ClassLoader::SYMBOL
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:19: warning: previous definition of SYMBOL was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/class_loader.rb:65: warning: already initialized constant Psych::ClassLoader::CACHE
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/class_loader.rb:67: warning: previous definition of CACHE was here
App 7382 stderr: /usr/lib/x86_64-linux-gnu/ruby/2.7.0/strscan.so: warning: already initialized constant StringScanner::Version
App 7382 stderr: /usr/lib/x86_64-linux-gnu/ruby/2.7.0/strscan.so: warning: already initialized constant StringScanner::Id
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/scalar_scanner.rb:9: warning: already initialized constant Psych::ScalarScanner::TIME
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/scalar_scanner.rb:9: warning: previous definition of TIME was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/scalar_scanner.rb:12: warning: already initialized constant Psych::ScalarScanner::FLOAT
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/scalar_scanner.rb:12: warning: previous definition of FLOAT was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/scalar_scanner.rb:17: warning: already initialized constant Psych::ScalarScanner::INTEGER
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/scalar_scanner.rb:17: warning: previous definition of INTEGER was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/stream.rb:13: warning: already initialized constant Psych::Nodes::Stream::ANY
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/stream.rb:13: warning: previous definition of ANY was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/stream.rb:16: warning: already initialized constant Psych::Nodes::Stream::UTF8
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/stream.rb:16: warning: previous definition of UTF8 was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/stream.rb:19: warning: already initialized constant Psych::Nodes::Stream::UTF16LE
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/stream.rb:19: warning: previous definition of UTF16LE was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/stream.rb:22: warning: already initialized constant Psych::Nodes::Stream::UTF16BE
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/stream.rb:22: warning: previous definition of UTF16BE was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/sequence.rb:43: warning: already initialized constant Psych::Nodes::Sequence::ANY
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/sequence.rb:43: warning: previous definition of ANY was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/sequence.rb:46: warning: already initialized constant Psych::Nodes::Sequence::BLOCK
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/sequence.rb:46: warning: previous definition of BLOCK was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/sequence.rb:49: warning: already initialized constant Psych::Nodes::Sequence::FLOW
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/sequence.rb:49: warning: previous definition of FLOW was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/scalar.rb:10: warning: already initialized constant Psych::Nodes::Scalar::ANY
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/scalar.rb:10: warning: previous definition of ANY was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/scalar.rb:13: warning: already initialized constant Psych::Nodes::Scalar::PLAIN
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/scalar.rb:13: warning: previous definition of PLAIN was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/scalar.rb:16: warning: already initialized constant Psych::Nodes::Scalar::SINGLE_QUOTED
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/scalar.rb:16: warning: previous definition of SINGLE_QUOTED was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/scalar.rb:19: warning: already initialized constant Psych::Nodes::Scalar::DOUBLE_QUOTED
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/scalar.rb:19: warning: previous definition of DOUBLE_QUOTED was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/scalar.rb:22: warning: already initialized constant Psych::Nodes::Scalar::LITERAL
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/scalar.rb:22: warning: previous definition of LITERAL was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/scalar.rb:25: warning: already initialized constant Psych::Nodes::Scalar::FOLDED
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/scalar.rb:25: warning: previous definition of FOLDED was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/mapping.rb:17: warning: already initialized constant Psych::Nodes::Mapping::ANY
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/mapping.rb:17: warning: previous definition of ANY was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/mapping.rb:20: warning: already initialized constant Psych::Nodes::Mapping::BLOCK
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/mapping.rb:20: warning: previous definition of BLOCK was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/nodes/mapping.rb:23: warning: already initialized constant Psych::Nodes::Mapping::FLOW
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/nodes/mapping.rb:23: warning: previous definition of FLOW was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/visitors/visitor.rb:11: warning: already initialized constant Psych::Visitors::Visitor::DISPATCH
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/visitors/visitor.rb:23: warning: previous definition of DISPATCH was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/handler.rb:27: warning: already initialized constant Psych::Handler::OPTIONS
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/handler.rb:27: warning: previous definition of OPTIONS was here
App 7382 stderr: /usr/lib/ruby/2.7.0/psych/handler.rb:30: warning: already initialized constant Psych::Handler::EVENTS
App 7382 stderr: /var/lib/gems/2.7.0/gems/psych-3.3.0/lib/psych/handler.rb:30: warning: previous definition of EVENTS was here
App 7382 stdout:
[ 2021-01-03 11:03:51.5698 7247/7fe2541a4700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/html/redmine: An error occurred while starting up the preloader.
  Error ID: 512d87c1
  Error details saved to: /tmp/passenger-error-MZVfLb.html
  Message from application: superclass mismatch for class Mark (TypeError)
  /usr/lib/ruby/2.7.0/psych/parser.rb:34:in `<class:Parser>'
  /usr/lib/ruby/2.7.0/psych/parser.rb:33:in `<module:Psych>'
  /usr/lib/ruby/2.7.0/psych/parser.rb:2:in `<top (required)>'
  /usr/lib/ruby/2.7.0/psych.rb:20:in `require'
  /usr/lib/ruby/2.7.0/psych.rb:20:in `<top (required)>'
  /usr/lib/ruby/2.7.0/yaml.rb:4:in `require'
  /usr/lib/ruby/2.7.0/yaml.rb:4:in `<top (required)>'
  /var/lib/gems/2.7.0/gems/railties-5.2.3/lib/rails/application.rb:3:in `require'
  /var/lib/gems/2.7.0/gems/railties-5.2.3/lib/rails/application.rb:3:in `<top (required)>'
  /var/lib/gems/2.7.0/gems/railties-5.2.3/lib/rails.rb:14:in `require'
  /var/lib/gems/2.7.0/gems/railties-5.2.3/lib/rails.rb:14:in `<top (required)>'
  /var/lib/gems/2.7.0/gems/railties-5.2.3/lib/rails/all.rb:3:in `require'
  /var/lib/gems/2.7.0/gems/railties-5.2.3/lib/rails/all.rb:3:in `<top (required)>'
  /var/www/html/redmine/config/application.rb:5:in `require'
  /var/www/html/redmine/config/application.rb:5:in `<top (required)>'
  /var/www/html/redmine/config/environment.rb:4:in `require'
  /var/www/html/redmine/config/environment.rb:4:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>'
  /var/lib/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval'
  /var/lib/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `eval'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'


[ 2021-01-03 11:03:51.5781 7247/7fe23ffff700 age/Cor/Con/CheckoutSession.cpp:283 ]: [Client 2-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 512d87c1. Please see earlier logs for details about the error.

原因

予想も入りますが、特定のパッケージが複数インストールされていることによる障害。今回はpsychが3.2と3.3で二つ導入されている。

他のライブラリだった場合には、gem listを実行して、出力されたパッケージがエラーメッセージ中のパッケージに含まれていないか探してみる。ヒットしたものがあれば対策に記載した通り一度アンインストールしてインストールしなおし。

対策

今回はpsychが問題だったので、以下を実施。

gem uninstall psych
gem update --default

参考サイト

本件、エラー発生後にググって参考にした記事は以下。感謝。

ブックマーク パーマリンク.

コメントを残す

メールアドレスが公開されることはありません。

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください