TechGeek
(TechGeek)
1
マルチサイト構成でデータコンテナを再構築すると、background worker "logical replication launcher" (PID 51) exited with exit code 1 というエラーが発生します。以下に詳細なログを示します。
218:C 11 Sep 2022 13:22:51.288 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
218:C 11 Sep 2022 13:22:51.289 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=218, just started
218:C 11 Sep 2022 13:22:51.289 # Configuration loaded
218:M 11 Sep 2022 13:22:51.292 * monotonic clock: POSIX clock_gettime
218:M 11 Sep 2022 13:22:51.293 * Running mode=standalone, port=6379.
218:M 11 Sep 2022 13:22:51.293 # Server initialized
218:M 11 Sep 2022 13:22:51.294 * Loading RDB produced by version 6.2.6
218:M 11 Sep 2022 13:22:51.294 * RDB age 53 seconds
218:M 11 Sep 2022 13:22:51.294 * RDB memory usage when created 32.70 Mb
218:M 11 Sep 2022 13:22:51.429 # Done loading RDB, keys loaded: 7811, keys expired: 0.
218:M 11 Sep 2022 13:22:51.429 * DB loaded from disk: 0.135 seconds
218:M 11 Sep 2022 13:22:51.429 * Ready to accept connections
I, [2022-09-11T13:23:01.284321 #1] INFO -- :
I, [2022-09-11T13:23:01.284632 #1] INFO -- : Terminating async processes
I, [2022-09-11T13:23:01.284702 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 42
I, [2022-09-11T13:23:01.284791 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 218
218:signal-handler (1662902581) Received SIGTERM scheduling shutdown...
2022-09-11 13:23:01.287 UTC [42] LOG: received fast shutdown request
2022-09-11 13:23:01.306 UTC [42] LOG: aborting any active transactions
2022-09-11 13:23:01.318 UTC [42] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1
218:M 11 Sep 2022 13:23:01.345 # User requested shutdown...
218:M 11 Sep 2022 13:23:01.345 * Saving the final RDB snapshot before exiting.
2022-09-11 13:23:01.356 UTC [46] LOG: shutting down
218:M 11 Sep 2022 13:23:02.113 * DB saved on disk
218:M 11 Sep 2022 13:23:02.114 # Redis is now ready to exit, bye bye...
2022-09-11 13:23:02.169 UTC [42] LOG: database system is shut down
sha256:30b91243b63ec58aa8555df5d1dfac509abe121e5c8d7081dbab2f2278d7d837
11e8bce45c8d0d7020de971c08d49d26287cc513967230530c8ba925a3c058bb
Removing old container
しかし、ビルドはエラーなしで完了したようです。データコンテナの起動中にエラーが発生していますか?
TechGeek
(TechGeek)
3
データコンテナではなく、再構築中のWebコンテナでエラーが発生しました。
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => multisite:migrate => db:load_config => environment
(See full trace by running task with --trace)
I, [2022-09-11T13:30:49.381804 #1] INFO -- : gem install iso8601 -v 0.13.0 -i /var/www/discourse/plugins/discourse-automation/gems/2.7.6 --no-document --ignore-dependencies --no-user-install
Successfully installed iso8601-0.13.0
1 gem installed
gem install rrule -v 0.4.4 -i /var/www/discourse/plugins/discourse-automation/gems/2.7.6 --no-document --ignore-dependencies --no-user-install
Successfully installed rrule-0.4.4
1 gem installed
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate failed with return #<Process::Status: pid 1095 exit 1>
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 /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate"
bootstrap failed with exit code 1
TechGeek
(TechGeek)
5
かなりの数の公式ディスコースプラグインを使用していますが、Docker Manager 以外すべてのプラグインを無効にしてもエラーはまだ存在します。
エラーとして指摘されているものは、(データコンテナにとって)私には通常のメッセージのように見えます。

サンドボックスでデータとWebの両方を再構築しましたが、正常に完了しました。編集済みの web_only.yml を共有していただけますか?
これをコメントアウトして、再構築を試していただけますか?もう必要ないと思います。
TechGeek
(TechGeek)
9
EMBER_CLI_PROD_ASSETS: 1 をコメントアウトしても、状況は変わりません。Web コンテナの再構築で、以下のエラーが引き続き発生しています。
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate failed with return #<Process::Status: pid 983 exit 1>
pfaffman
(Jay Pfaffman)
10
問題が発生したマイグレーションについて記載されている箇所まで上にスクロールする必要があります。
TechGeek
(TechGeek)
11
さらに下に、ブロックマッピングの解析中に期待されるキーが見つからなかったというエラーがあります。行2、列1に関するものです。何のことかよくわかりません。
Using cose 1.2.1
0: cose (1.2.1) from /var/www/discourse/vendor/bundle/ruby/2.7.0/specifications/cose-1.2.1.gemspec
Bundle complete! 126 Gemfile dependencies, 183 gems now installed.
Gems in the groups 'test' and 'development' were not installed.
Bundled gems are installed into `./vendor/bundle`
I, [2022-09-11T14:12:48.956298 #1] INFO -- : > cd /var/www/discourse & sudo -E -u discourse bundle exec rake multisite:migrate
rake aborted!
Psych::SyntaxError: (<unknown>): did not find expected key while parsing a block mapping at line 2 column 1
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:181:in `load_config!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:177:in `initialize'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:38:in `new'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:38:in `config_filename='
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.1/lib/rails_multisite/railtie.rb:19:in `block in <class:Railtie>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/application.rb:372:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/application.rb:348:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/application.rb:511:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => multisite:migrate => db:load_config => environment
(See full trace by running task with --trace)
I, [2022-09-11T14:12:53.236265 #1] INFO -- :
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & sudo -E -u discourse bundle exec rake multisite:migrate failed with return #<Process::Status: pid 983 exit 1>
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 /var/www/discourse & sudo -E -u discourse bundle exec rake multisite:migrate"
bootstrap failed with exit code 1
Falco
(Falco)
13
これは、app.yml にフォーマットエラーがあることを意味します。マルチサイトの部分に問題があるようです。
「いいね!」 1
pfaffman
(Jay Pfaffman)
14
sych::SyntaxError が発生していると見られる唯一のプラグインは discourse-calendar です。このプラグインを削除してみてください。問題が解決した場合、そのプラグインにバグがあるということになります。
TechGeek
(TechGeek)
16
YML バリデーターで確認しましたが、エラーはありませんでした。
更新されたエラー出力を以下に示します。
INFO -- : マルチサイトマイグレーターは1スレッドを使用して実行中です
デフォルトを移行中
site2 を移行中
デフォルトをシード中
site2 をシード中
失敗しました
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate がリターンコード #<Process::Status: pid 983 exit 1> で失敗しました
失敗場所: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec はパラメータ "cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate" で失敗しました
ブートストラップは終了コード 1 で失敗しました
** ブートストラップに失敗しました ** 上にスクロールして、以前のエラーメッセージを探してください。複数ある可能性があります。
./discourse-doctor が問題を診断するのに役立つかもしれません。
./discourse-doctor を使用して完全なログをエクスポートできますか?
ビルド中に「1件のマイグレーションが失敗しました」という行が表示され、その下に失敗しているサイトの情報が表示されます。ビルドが実際に完了するには、そのサイトで何が問題になっているのかを特定する必要があります。
TechGeek
(TechGeek)
31