ブートストラップに失敗しました。新規インストールでも発生します

こんにちは。

Discourse を長年使用してきましたが、別のサーバーに移行したいと考えています。
すでにバックアップは完了しており、復元のために新しいサーバーに新しいコピーをインストールしようとしています。

しかし、新しいインストールを実行しようとすると、エラーが繰り返し発生します。
数回試しましたが、結果は同じです。サーバーを何度も再構築しましたが、同じです。

Debian 11
RAM 1GB
SWAP 4GB
2 Core

インストールログ:

x86_64 アーキテクチャを検出しました。
ランチャーを最新の状態に保ちます
オリジンを取得しています
ランチャーは最新の状態です
古いコンテナを停止しています
+ /usr/bin/docker stop -t 60 app
app
2.0.20230222-0048: discourse/base からプルしています
ダイジェスト: sha256:6a7dd0755c6832e1ecfc8cc980f27836b69b4162d6ff1b6a3e4e382a3b854803
ステータス: イメージは discourse/base:2.0.20230222-0048 まで最新です
docker.io/discourse/base:2.0.20230222-0048
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2023-03-13T11:25:13.229925 #1]  INFO -- : 標準入力から読み取っています
I, [2023-03-13T11:25:13.237120 #1]  INFO -- : > locale-gen $LANG && update-locale
I, [2023-03-13T11:25:15.133566 #1]  INFO -- : ロケールを生成しています (これには時間がかかる場合があります)...
生成完了。

I, [2023-03-13T11:25:15.134390 #1]  INFO -- : > mkdir -p /shared/postgres_run
I, [2023-03-13T11:25:15.164309 #1]  INFO -- :
I, [2023-03-13T11:25:15.165444 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2023-03-13T11:25:15.182370 #1]  INFO -- :
I, [2023-03-13T11:25:15.183423 #1]  INFO -- : > chmod 775 /shared/postgres_run
I, [2023-03-13T11:25:15.248940 #1]  INFO -- :
I, [2023-03-13T11:25:15.249966 #1]  INFO -- : > rm -fr /var/run/postgresql
I, [2023-03-13T11:25:15.269133 #1]  INFO -- :
I, [2023-03-13T11:25:15.270288 #1]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2023-03-13T11:25:15.314538 #1]  INFO -- :
I, [2023-03-13T11:25:15.315922 #1]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2023/03/13 11:25:16 socat[18] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2023-03-13T11:25:16.264579 #1]  INFO -- :
I, [2023-03-13T11:25:16.265205 #1]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2023-03-13T11:25:16.330415 #1]  INFO -- :
I, [2023-03-13T11:25:16.331258 #1]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2023-03-13T11:25:16.334530 #1]  INFO -- :
I, [2023-03-13T11:25:16.335427 #1]  INFO -- : > mkdir -p /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-03-13T11:25:16.339258 #1]  INFO -- :
I, [2023-03-13T11:25:16.340137 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-03-13T11:25:16.342468 #1]  INFO -- :
I, [2023-03-13T11:25:16.410983 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown:
I, [2023-03-13T11:25:16.416328 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown:
I, [2023-03-13T11:25:16.421556 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown:
I, [2023-03-13T11:25:16.428238 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown:
I, [2023-03-13T11:25:16.429045 #1]  INFO -- : > chown -R root /var/lib/postgresql/13/main
I, [2023-03-13T11:26:07.923757 #1]  INFO -- :
I, [2023-03-13T11:26:08.425452 #1]  INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/13/bin/initdb -D /shared/postgres_data || exit 0
I, [2023-03-13T11:26:08.612014 #1]  INFO -- :
I, [2023-03-13T11:26:08.612768 #1]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2023-03-13T11:26:09.223581 #1]  INFO -- :
I, [2023-03-13T11:26:09.224698 #1]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2023-03-13T11:26:09.227553 #1]  INFO -- :
I, [2023-03-13T11:26:09.228389 #1]  INFO -- : > /root/upgrade_postgres
I, [2023-03-13T11:26:09.285168 #1]  INFO -- :
I, [2023-03-13T11:26:09.285919 #1]  INFO -- : > rm /root/upgrade_postgres
I, [2023-03-13T11:26:09.288235 #1]  INFO -- :
I, [2023-03-13T11:26:09.464138 #1]  INFO -- : Replacing data_directory = '/var/lib/postgresql/13/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.465421 #1]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.466207 #1]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.466702 #1]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.467257 #1]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.467687 #1]  INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.468143 #1]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2023-03-13T11:26:09.761975 #1]  INFO -- :
I, [2023-03-13T11:26:09.763351 #1]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.764536 #1]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.765473 #1]  INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/13/main/postgresql.conf
I, [2023-03-13T11:26:09.791036 #1]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/13/main/pg_hba.conf
I, [2023-03-13T11:26:09.792174 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-03-13T11:26:09.792950 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-03-13T11:26:09.793444 #1]  INFO -- : > 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
I, [2023-03-13T11:26:09.795665 #1]  INFO -- : > sleep 5
I, [2023-03-13T11:26:14.820284 #1]  INFO -- :
I, [2023-03-13T11:26:14.821311 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
createdb: error: could not connect to database template1: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?
I, [2023-03-13T11:26:21.603565 #1]  INFO -- :
I, [2023-03-13T11:26:21.604284 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2023-03-13 11:26:22.014 UTC [41] LOG:  Debian 13.10 (Debian 13.10-1.pgdg110+1) on x86_64-pc-linux-gnu で PostgreSQL 13.10 を起動しています。gcc (Debian 10.2.1-6) 10.2.1 20210110 でコンパイル済み、64-bit
2023-03-13 11:26:22.020 UTC [41] LOG:  IPv4 アドレス "0.0.0.0"、ポート 5432 でリッスンしています
2023-03-13 11:26:22.021 UTC [41] LOG:  IPv6 アドレス "::"、ポート 5432 でリッスンしています
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?
I, [2023-03-13T11:26:22.036057 #1]  INFO -- :
I, [2023-03-13T11:26:22.039351 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
2023-03-13 11:26:22.047 UTC [41] LOG:  Unix ソケット "/var/run/postgresql/.s.PGSQL.5432" でリッスンしています
2023-03-13 11:26:22.723 UTC [53] LOG:  データベースシステムは 2023-03-13 10:30:34 UTC にシャットダウンされました
2023-03-13 11:26:22.754 UTC [54] postgres@discourse FATAL:  データベースシステムは起動中です
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  データベースシステムは起動中です
I, [2023-03-13T11:26:22.757656 #1]  INFO -- :
I, [2023-03-13T11:26:22.758335 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
2023-03-13 11:26:22.811 UTC [58] postgres@discourse FATAL:  データベースシステムは起動中です
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  データベースシステムは起動中です
I, [2023-03-13T11:26:22.814281 #1]  INFO -- :
I, [2023-03-13T11:26:22.815016 #1]  INFO -- : 非同期プロセスを終了しています
I, [2023-03-13T11:26:22.815325 #1]  INFO -- : 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 に INT を送信しています pid: 41
2023-03-13 11:26:22.815 UTC [41] LOG:  高速シャットダウン要求を受信しました
2023-03-13 11:26:22.928 UTC [61] LOG:  シャットダウン中です
2023-03-13 11:26:22.971 UTC [41] LOG:  データベースシステムはシャットダウンされました


FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 55 exit 2>
失敗の場所: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
bootstrap failed with exit code 2
** BOOTSTRAP に失敗しました ** 上にスクロールして、以前のエラーメッセージを探してください。複数ある可能性があります。
./discourse-doctor が問題を診断するのに役立つかもしれません。
0eed82a57ac12afa9bd1f7fe56c9d876fd06661813daa26f568dfc4bf3bd13e7

これは標準的なインストールですか?

Postgres はまだ起動中のようです。CPU は非常に遅いですか?

Postgres が標準以外のポートを使用するように設定されている可能性があります。

以下を試してください。

ls -al /var/discourse/shared/standalone/postgres_run

私のインストールでは、以下が表示されます。

total 28
drwxrwxr-x  5 systemd-resolve input   4096 Jan 26 15:43 .
drwxr-xr-x 13 root            root    4096 Jan 27  2021 ..
drwxr-x---  2 lxd             mlocate 4096 Jun  8  2020 10-main.pg_stat_tmp
drwxr-x---  2 lxd             mlocate 4096 Jan 27  2021 12-main.pg_stat_tmp
drwxr-x---  2 systemd-resolve input   4096 Mar 14 15:06 13-main.pg_stat_tmp
-rw-r--r--  1 systemd-resolve input      4 Jan 26 15:43 13-main.pid
srwxrwxrwx  1 systemd-resolve input      0 Mar 14 15:06 .s.PGSQL.5432
-rw-------  1 systemd-resolve input     62 Mar 14 15:06 .s.PGSQL.5432.lock

@Ed_S
標準のインストールで、設定は変更していません。

@pfaffman
はい、discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub に従った標準のインストールです。

すでに原因がわかりました。Let’s Encrypt に関係していました。

おそらくレート制限がかかっており、SSL証明書が発行されていなかったようです。

app.yaml で letsencrypt を無効にし、独自の SSL 証明書/キーの組み合わせを使用して再構築する必要がありました。

これで完璧に動作し、データを復元してサーバーの移行を完了しました。

「いいね!」 1

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