尝试更新时 Discourse 启动失败,有人能建议我该采取哪些步骤让网站重新上线吗?我运行了 discourse-doctor,但它也无法重建。以下是我(第三次?)尝试的日志:
I, [2020-04-11T13:05:40.743940 #1] INFO -- : Loading --stdin
I, [2020-04-11T13:05:40.750131 #1] INFO -- : > locale-gen $LANG && update-locale
I, [2020-04-11T13:05:40.800464 #1] INFO -- : 正在生成区域设置(这可能需要一些时间)...
生成完成。
I, [2020-04-11T13:05:40.800750 #1] INFO -- : > mkdir -p /shared/postgres_run
I, [2020-04-11T13:05:40.804473 #1] INFO -- :
I, [2020-04-11T13:05:40.804720 #1] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2020-04-11T13:05:40.809297 #1] INFO -- :
I, [2020-04-11T13:05:40.809573 #1] INFO -- : > chmod 775 /shared/postgres_run
I, [2020-04-11T13:05:40.813859 #1] INFO -- :
I, [2020-04-11T13:05:40.814113 #1] INFO -- : > rm -fr /var/run/postgresql
I, [2020-04-11T13:05:40.818749 #1] INFO -- :
I, [2020-04-11T13:05:40.819005 #1] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2020-04-11T13:05:40.823149 #1] INFO -- :
I, [2020-04-11T13:05:40.823401 #1] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2020/04/11 13:05:40 socat[26] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): Connection refused
I, [2020-04-11T13:05:40.831215 #1] INFO -- :
I, [2020-04-11T13:05:40.831436 #1] INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2020-04-11T13:05:40.837350 #1] INFO -- :
I, [2020-04-11T13:05:40.837549 #1] INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2020-04-11T13:05:40.843241 #1] INFO -- :
I, [2020-04-11T13:05:40.843486 #1] INFO -- : > mkdir -p /shared/postgres_run/10-main.pg_stat_tmp
I, [2020-04-11T13:05:40.848311 #1] INFO -- :
I, [2020-04-11T13:05:40.848643 #1] INFO -- : > chown postgres:postgres /shared/postgres_run/10-main.pg_stat_tmp
I, [2020-04-11T13:05:40.853421 #1] INFO -- :
I, [2020-04-11T13:05:40.863897 #1] INFO -- : 文件 > /etc/service/postgres/run chmod: +x chown:
I, [2020-04-11T13:05:40.873965 #1] INFO -- : 文件 > /etc/service/postgres/log/run chmod: +x chown:
I, [2020-04-11T13:05:40.884485 #1] INFO -- : 文件 > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2020-04-11T13:05:40.895036 #1] INFO -- : 文件 > /root/upgrade_postgres chmod: +x chown:
I, [2020-04-11T13:05:40.895478 #1] INFO -- : > chown -R root /var/lib/postgresql/10/main
I, [2020-04-11T13:06:09.192272 #1] INFO -- :
I, [2020-04-11T13:06:09.192593 #1] INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/10/bin/initdb -D /shared/postgres_data || exit 0
I, [2020-04-11T13:06:09.197837 #1] INFO -- :
I, [2020-04-11T13:06:09.197992 #1] INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2020-04-11T13:06:09.228153 #1] INFO -- :
I, [2020-04-11T13:06:09.228375 #1] INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2020-04-11T13:06:09.233425 #1] INFO -- :
I, [2020-04-11T13:06:09.233760 #1] INFO -- : > /root/upgrade_postgres
I, [2020-04-11T13:06:09.243357 #1] INFO -- :
I, [2020-04-11T13:06:09.243596 #1] INFO -- : > rm /root/upgrade_postgres
I, [2020-04-11T13:06:09.249007 #1] INFO -- :
I, [2020-04-11T13:06:09.249495 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 data_directory = '/var/lib/postgresql/10/main' 替换为 data_directory = '/shared/postgres_data'
I, [2020-04-11T13:06:09.272106 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?listen_addresses *=.*) 替换为 listen_addresses = '*'
I, [2020-04-11T13:06:09.272853 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?synchronous_commit *=.*) 替换为 synchronous_commit = $db_synchronous_commit
I, [2020-04-11T13:06:09.273496 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?shared_buffers *=.*) 替换为 shared_buffers = $db_shared_buffers
I, [2020-04-11T13:06:09.274139 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?work_mem *=.*) 替换为 work_mem = $db_work_mem
I, [2020-04-11T13:06:09.274757 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?default_text_search_config *=.*) 替换为 default_text_search_config = '$db_default_text_search_config'
I, [2020-04-11T13:06:09.275288 #1] INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2020-04-11T13:06:09.282029 #1] INFO -- :
I, [2020-04-11T13:06:09.282556 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?max_wal_senders *=.*) 替换为 max_wal_senders = $db_max_wal_senders
I, [2020-04-11T13:06:09.330309 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?wal_level *=.*) 替换为 wal_level = $db_wal_level
I, [2020-04-11T13:06:09.331016 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?checkpoint_segments *=.*) 替换为 checkpoint_segments = $db_checkpoint_segments
I, [2020-04-11T13:06:09.331655 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?logging_collector *=.*) 替换为 logging_collector = $db_logging_collector
I, [2020-04-11T13:06:09.332347 #1] INFO -- : 在 /etc/postgresql/10/main/postgresql.conf 中将 (?-mix:#?log_min_duration_statement *=.*) 替换为 log_min_duration_statement = $db_log_min_duration_statement
I, [2020-04-11T13:06:09.333020 #1] INFO -- : 在 /etc/postgresql/10/main/pg_hba.conf 中将 (?-mix:^#local +replication +postgres +peer$) 替换为 local replication postgres peer
I, [2020-04-11T13:06:09.333660 #1] INFO -- : 在 /etc/postgresql/10/main/pg_hba.conf 中将 (?-mix:^host.*all.*all.*127.*$) 替换为 host all all 0.0.0.0/0 md5
I, [2020-04-11T13:06:09.334205 #1] INFO -- : > 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
I, [2020-04-11T13:06:09.338659 #1] INFO -- : > sleep 5
2020-04-11 13:06:09.481 UTC [49] LOG: 正在监听 IPv4 地址 "0.0.0.0",端口 5432
2020-04-11 13:06:09.482 UTC [49] LOG: 正在监听 IPv6 地址 "::",端口 5432
2020-04-11 13:06:09.544 UTC [49] LOG: 正在监听 Unix 套接字 "/var/run/postgresql/.s.PGSQL.5432"
2020-04-11 13:06:10.813 UTC [52] LOG: 数据库系统关闭被中断;上次已知运行时间为 2020-04-11 12:42:48 UTC
2020-04-11 13:06:12.356 UTC [52] LOG: 数据库系统未正常关闭;正在进行自动恢复
2020-04-11 13:06:12.416 UTC [52] LOG: 重做从 84/BD1A85B0 开始
2020-04-11 13:06:12.446 UTC [52] LOG: 记录长度无效,位置 84/BD7B3570:期望 24,实际 0
2020-04-11 13:06:12.446 UTC [52] LOG: 重做在 84/BD7B3530 完成
2020-04-11 13:06:12.446 UTC [52] LOG: 最后完成的事务时间为 2020-04-11 11:53:53.069757+00
I, [2020-04-11T13:06:14.343128 #1] INFO -- :
I, [2020-04-11T13:06:14.343449 #1] INFO -- : > su postgres -c 'createdb discourse' || true
2020-04-11 13:06:14.409 UTC [56] postgres@postgres FATAL: 数据库系统正在启动
2020-04-11 13:06:14.411 UTC [57] postgres@template1 FATAL: 数据库系统正在启动
createdb: 无法连接到数据库 template1:FATAL: 数据库系统正在启动
I, [2020-04-11T13:06:14.413548 #1] INFO -- :
I, [2020-04-11T13:06:14.413822 #1] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2020-04-11 13:06:14.493 UTC [68] postgres@discourse FATAL: 数据库系统正在启动
psql: FATAL: 数据库系统正在启动
I, [2020-04-11T13:06:14.495917 #1] INFO -- :
I, [2020-04-11T13:06:14.496250 #1] INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
2020-04-11 13:06:14.574 UTC [79] postgres@discourse FATAL: 数据库系统正在启动
psql: FATAL: 数据库系统正在启动
I, [2020-04-11T13:06:14.576284 #1] INFO -- :
I, [2020-04-11T13:06:14.576674 #1] INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
2020-04-11 13:06:14.655 UTC [90] postgres@discourse FATAL: 数据库系统正在启动
psql: FATAL: 数据库系统正在启动
I, [2020-04-11T13:06:14.658074 #1] INFO -- :
I, [2020-04-11T13:06:14.658635 #1] INFO -- : 终止异步进程
I, [2020-04-11T13:06:14.658722 #1] INFO -- : 向 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 发送 INT 信号,进程 ID:49
2020-04-11 13:06:14.658 UTC [49] LOG: 收到快速关闭请求
I, [2020-04-11T13:06:24.659800 #1] INFO -- : 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 进程 ID:49 未正常终止,强制终止!
失败
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' 执行失败,返回码为 #<Process::Status: pid 80 exit 2>
失败位置:/pups/lib/pups/exec_command.rb:112:in `spawn'
使用以下参数执行失败:"su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
3956a617d80571dd1ef87fcf7d23a319190bd909477e703ccb22cb25d0e137c8
** 启动失败 ** 请向上滚动查看更早的错误消息,可能不止一条。
运行 ./discourse-doctor 可能有助于诊断问题。