ランチャーの再構築で何も表示されない

アプリコンテナに MySQL gem のサポートを追加するためのガイドに従おうとしています。チュートリアルは Use an import script that requires MySQL - #4 by pfaffman です。

しかし、以下のコマンドを実行すると、プロセスが停止してしまいます。

> ./launcher stop app
> ./launcher rebuild import

image

プロセスを CTRL+C で終了するまで動きません。

注: 反応があるか数時間待機しましたが、何も起こりませんでした。

Docker コンテナを確認すると、新しい(破損した)停止したコンテナが表示されます。

image

何が間違っているのか、なぜこのような挙動になるのかわかりません。

私の containers/import.yml ファイルの内容(変更していない部分は省略):

サーバーは DO(DigitalOcean)上でホストされており、Docker サービスを再起動すると、元の動作中のアプリコンテナに戻ります。

image

追記: ./launcher rebuild app は正常に動作します。

ビルドする前に ./launcher stop app; を実行するのはどうでしょうか?

編集:

しまった。

はい、もちろん stop サブコマンドの後に rebuild を実行しています。質問を編集させてください。

わかりました。コンテナを停止した後

> ./launcher stop app

コンテナも削除 (docker rm app) し、その後再構築を試みたところ、さらに進みました。

しかし、mysql-dep テンプレートを使用する段階で、以下のエラーが発生しました。

...
Setting up libgmp-dev:amd64 (2:6.1.2+dfsg-4) ...
Setting up nettle-dev:amd64 (3.4.1-1) ...
Setting up libgnutls28-dev:amd64 (3.6.7-4+deb10u2) ...
Setting up libmariadb-dev (1:10.3.22-0+deb10u1) ...
Processing triggers for libc-bin (2.28-10) ...

I, [2020-02-27T16:51:33.937186 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without "test development"'
[DEPRECATED] The `--path` 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 path 'vendor/bundle'`, 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 without 'test development'`, and stop using this flag
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the /var/www/discourse/Gemfile freeze 
by running `bundle config unset deployment`.

The dependencies in your gemfile changed

You have added to the Gemfile:
* mysql2
I, [2020-02-27T16:51:34.670930 #1]  INFO -- : 
I, [2020-02-27T16:51:34.672542 #1]  INFO -- : Terminating async processes
I, [2020-02-27T16:51:34.673101 #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/10/bin/postmaster -D /etc/postgresql/10/main pid: 49
I, [2020-02-27T16:51:34.673593 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 166
2020-02-27 16:51:34.674 UTC [49] LOG:  received fast shutdown request
166:signal-handler (1582822294) Received SIGTERM scheduling shutdown...
2020-02-27 16:51:34.682 UTC [49] LOG:  aborting any active transactions
166:M 27 Feb 2020 16:51:34.693 # User requested shutdown...
166:M 27 Feb 2020 16:51:34.695 * Saving the final RDB snapshot before exiting.
2020-02-27 16:51:34.698 UTC [49] LOG:  worker process: logical replication launcher (PID 58) exited with exit code 1
2020-02-27 16:51:34.701 UTC [53] LOG:  shutting down
166:M 27 Feb 2020 16:51:34.741 * DB saved on disk
166:M 27 Feb 2020 16:51:34.742 # Redis is now ready to exit, bye bye...
2020-02-27 16:51:34.786 UTC [49] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without test development' failed with return #<Process::Status: pid 970 exit 16>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["echo \"gem 'mysql2'\" >> Gemfile", "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmariadb-dev", "su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without test development'"]}
75b27d60e1dc3a4b5d76bc75f2874ebf405fe29edfebec3cb809233f7b01ec48
** 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.

このエラーについてご存知の方がいらっしゃいましたら、ご教示ください。

私も同様の問題に直面しています。これは Failed to bootstrap using import template と同じようです。

本来は、この問題を目にしたのでそのコンテナのアップグレードを試すつもりはなかったのですが、別の奇妙なエラーがあったため、試してしまいました。

編集:テンプレート内の

su discourse -c 'bundle config unset deployment'

の行を、

 su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without "test development"'

の行の前に追加したところ、動作するようになりました。(ただし、残念ながら私の無関係な問題は解決しませんでした)。

先週まさにこのテンプレートを使いましたが、問題はありませんでした。少し奇妙ですが、来週見てみる価値はあると思います。リストに追加しておきます。

私もです!でも、アップグレード版なら何かあるのかもしれませんね?

コメントに加えて、ランチャーの前提条件をスキップする必要もありました

> ./launcher rebuild import --skip-prereqs

そして、@pfaffman の提案に従って

イメージのビルドに成功しました。:white_check_mark:

これはここで解決したようですが、@pfaffman @rahilqf の皆様、確認いただけますか?

そのようです。どうもありがとうございます!

もし php-serialize を追加してくれるテンプレートがあればいいのですが……