Ruby gemの互換性によりビルドが失敗しました

注:コンテナ名を containers/polyf.yml としました。
discourse-doctor はそれを全く処理できません…

$ ./launcher rebuild polyf
...
I, [2023-04-06T09:50:45.464717 #1]  INFO -- : cd /var/www/discourse & su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'
[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'test development'`, and stop using this flag
Bundler::PathError: The path `/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/sprockets-f4d3dae71ef2` does not exist.
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/source/path.rb:209:in `load_spec_files'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/source/git.rb:205:in `load_spec_files'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/source/path.rb:107:in `local_specs'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/source/git.rb:172:in `specs'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/lazy_specification.rb:82:in `materialize_for_installation'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:195:in `map!'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:195:in `specs_for_dependency'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:33:in `block in for'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:22:in `loop'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:22:in `for'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:79:in `materialize'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/definition.rb:209:in `missing_specs'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/definition.rb:213:in `missing_specs?'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:255:in `resolve_if_needed'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:82:in `block in run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:12:in `block in lock'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:9:in `open'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:9:in `lock'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:71:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:23:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli/install.rb:62:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:260:in `block in install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/settings.rb:131:in `temporary'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:259:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:34:in `dispatch'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:28:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/exe/bundle:45:in `block in <top (required)>'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/exe/bundle:33:in `<top (required)>'
  /usr/local/bin/bundle:25:in `load'
  /usr/local/bin/bundle:25:in `<main>'
Bundler::InstallError: sass-embedded-1.60.0-x86_64-linux requires rubygems version >= 3.3.22, which is incompatible with the current version, 3.3.20
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:237:in `block in ensure_specs_are_compatible!'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:155:in `each'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:155:in `each'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:231:in `ensure_specs_are_compatible!'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:83:in `block in run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:12:in `block in lock'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:9:in `open'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:9:in `lock'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:71:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:23:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli/install.rb:62:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:260:in `block in install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/settings.rb:131:in `temporary'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:259:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:34:in `dispatch'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:28:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/exe/bundle:45:in `block in <top (required)>'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/exe/bundle:33:in `<top (required)>'
  /usr/local/bin/bundle:25:in `load'
  /usr/local/bin/bundle:25:in `<main>'
I, [2023-04-06T09:50:56.916061 #1]  INFO -- : Running `bundle install --deployment --jobs 4 --retry 3 --verbose --without "test" "development"` with bundler 2.4.4
Frozen, using resolution from the lockfile
The definition is missing dependencies, failed to resolve & materialize locally (https://github.com/rails/sprockets (at 3.x@f4d3dae) is not yet checked out. Run `bundle install` first.)
Frozen, using resolution from the lockfile
...
2023-04-06 09:50:56.935 UTC [47] LOG:  shutting down
2023-04-06 09:50:56.970 UTC [43] LOG:  database system is shut down
104:M 06 Apr 2023 09:50:57.012 # User requested shutdown...
104:M 06 Apr 2023 09:50:57.012 * Saving the final RDB snapshot before exiting.
104:M 06 Apr 2023 09:50:57.036 * DB saved on disk
104:M 06 Apr 2023 09:50:57.036 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development' failed with return #<Process::Status: pid 367 exit 5>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'"]}
bootstrap failed with exit code 5
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
82f1cada0a0c138a0834f1682f3475590d0e28f179b243c4f0d54ae7043515bb

なぜか私のRubyは3.2.0なのに、あなたはRuby 2.7.0を持っています。おそらく、あなたの完全なログを見せてください。何かが更新に失敗したようです。通常のシーケンスは次のとおりです。

cd /var/discourse
git pull
./launcher rebuild app

(ただし、あなたの場合、appではなくpolyfですが)

近くのスレッドで:

「いいね!」 4

私はDebian [stable](現在はバージョン11、コードネームbullseye)を使用しており、標準のRubyパッケージはバージョン2.7.0です:Debian -- Details of package ruby in bullseye

./launcherがすでにリビルド時にgit pullを実行していることを考えると、git pullが必要であることに少し驚いています。

しかし、以前のgit pullでいくつかの変更を取得したので、なぜランチャーがそれらを取得したのかよくわかりません…まあ、様子を見て、またご連絡します。

「いいね!」 1

Dockerコンテナ内のRubyのバージョンが重要だと思います。イメージが更新されていれば、それは正しいはずです。tests-passedとは異なるものを実行している場合、イメージが古い可能性があり、その場合はプラグインとの非互換性が問題である可能性があります。その場合は、プラグインをコメントアウトすることで、意図的に古いDiscourseと互換性のないプラグインを特定できます。

「いいね!」 3

おそらく、git の状態が汚れているか、古い master ブランチにいるのではないでしょうか?

「いいね!」 2

git pull でリビルドはうまくいきました。

@Falco、古い master ブランチにいました。今は新しい main ブランチにいます… それがどのように起こったのかはよくわかりませんが、launcher を再実行したことで、その裏で(master にいる場合に切り替えるコードがいくつか見られます)そうなった可能性は十分にあります。

まあ、このアップグレードは「魔法」と呼んで、それ以上気にしないことにします。なぜなら、私の discourse インスタンスは元気に稼働しているからです。

(たとえそれだけだとしても)サポートしてくれた皆さん、ありがとう!

「いいね!」 2

ちなみに、バージョン2.9.0.beta9からアップグレードしました。それが影響するかもしれません…

「いいね!」 1

これが git pull の内容を示していると思います。実行する前に、ランチャー自体を更新します。知りませんでした。

「いいね!」 1

@JammyDodger、ありがとうございます。「解決策」ボタンはまだ見つけていませんでした。

[メモを取る]

「いいね!」 1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.