更新失败,错误信息为:Postgres 已在运行,请停止容器

我尝试先从 Web 管理员更新 Discourse,但失败了,然后我尝试从命令行更新,但它卡在了“postgres already running…”

我有一个带有 Ubuntu 的 DigitalOcean 实例。

我阅读了其他帖子,他们说要重启再试。我重启了几次,但仍然收到此错误。

如何修复?

cd /var/discourse; ./launcher rebuild app
检测到 x86_64 架构。
警告:containers/app.yml 文件对所有人可读。您可以通过运行以下命令来保护此文件:chmod o-rwx containers/app.yml
确保启动器是最新的
正在获取 origin
remote: 枚举对象中:5,完成。
remote: 计数对象中:100% (5/5),完成。
remote: 总共 5 (增量 4),重用 5 (增量 4),打包重用 0 (来自 0)
解包对象中:100% (5/5),708 字节 | 354.00 KiB/s,完成。
来自 https://github.com/discourse/discourse_docker
 * [新分支]      use_ruby_base_iamge -> origin/use_ruby_base_iamge
启动器是最新的
2.0.20240825-0027:正在从 discourse/base 拉取
摘要:sha256:6de68cb49198b5281f79ed9401b3fe818c854d220dcf0238549fe2f2adb19146
状态:镜像已最新,为 discourse/base:2.0.20240825-0027
docker.io/discourse/base:2.0.20240825-0027
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2024-08-30T10:43:08.137867 #1]  INFO -- : 从 stdin 读取
I, [2024-08-30T10:43:08.153896 #1]  INFO -- : 文件 > /etc/service/postgres/run  chmod: +x  chown:
I, [2024-08-30T10:43:08.158658 #1]  INFO -- : 文件 > /etc/service/postgres/log/run  chmod: +x  chown:
I, [2024-08-30T10:43:08.163738 #1]  INFO -- : 文件 > /etc/runit/3.d/99-postgres  chmod: +x  chown:
I, [2024-08-30T10:43:08.168052 #1]  INFO -- : 文件 > /root/install_postgres  chmod: +x  chown:
I, [2024-08-30T10:43:08.172457 #1]  INFO -- : 文件 > /root/upgrade_postgres  chmod: +x  chown:
I, [2024-08-30T10:43:08.174093 #1]  INFO -- : 替换 data_directory = '/var/lib/postgresql/13/main' 为 data_directory = '/shared/postgres_data' 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.175183 #1]  INFO -- : 替换 (?-mix:#?listen_addresses *=.*) 为 listen_addresses = '*' 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.176038 #1]  INFO -- : 替换 (?-mix:#?synchronous_commit *=.*) 为 synchronous_commit = $db_synchronous_commit 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.176655 #1]  INFO -- : 替换 (?-mix:#?shared_buffers *=.*) 为 shared_buffers = $db_shared_buffers 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.177311 #1]  INFO -- : 替换 (?-mix:#?work_mem *=.*) 为 work_mem = $db_work_mem 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.177951 #1]  INFO -- : 替换 (?-mix:#?default_text_search_config *=.*) 为 default_text_search_config = '$db_default_text_search_config' 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.178500 #1]  INFO -- : 替换 (?-mix:#?checkpoint_segments *=.*) 为 checkpoint_segments = $db_checkpoint_segments 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.179353 #1]  INFO -- : 替换 (?-mix:#?logging_collector *=.*) 为 logging_collector = $db_logging_collector 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.179971 #1]  INFO -- : 替换 (?-mix:#?log_min_duration_statement *=.*) 为 log_min_duration_statement = $db_log_min_duration_statement 在 /etc/postgresql/13/main/postgresql.conf
I, [2024-08-30T10:43:08.180883 #1]  INFO -- : 替换 (?-mix:^#local +replication +postgres +peer$) 为 local replication postgres  peer 在 /etc/postgresql/13/main/pg_hba.conf
I, [2024-08-30T10:43:08.181605 #1]  INFO -- : 替换 (?-mix:^host.*all.*all.*127.*$) 为 host all all 0.0.0.0/0 md5 在 /etc/postgresql/13/main/pg_hba.conf
I, [2024-08-30T10:43:08.182323 #1]  INFO -- : 替换 (?-mix:^host.*all.*all.*::1\\/128.*$) 为 host all all ::/0 md5 在 /etc/postgresql/13/main/pg_hba.conf
I, [2024-08-30T10:43:08.182939 #1]  INFO -- : > if [ -f /root/install_postgres ]; then
  /root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
  socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi

2024/08/30 10:43:08 socat[28] E connect(, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): 连接被拒绝
I, [2024-08-30T10:43:08.270928 #1]  INFO -- : 正在生成 locale(这可能需要一些时间)。..
生成完成。

I, [2024-08-30T10:43:08.271543 #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, [2024-08-30T10:43:08.272933 #1]  INFO -- : 正在终止异步进程
2024-08-30 10:43:08.352 UTC [30] LOG:  正在启动 PostgreSQL 13.16 (Debian 13.16-1.pgdg120+1) 在 x86_64-pc-linux-gnu 上,由 gcc (Debian 12.2.0-14) 12.2.0 编译,64 位
2024-08-30 10:43:08.355 UTC [30] LOG:  正在监听 IPv4 地址 "0.0.0.0",端口 5432
2024-08-30 10:43:08.356 UTC [30] LOG:  正在监听 IPv6 地址 "::",端口 5432
2024-08-30 10:43:08.358 UTC [30] LOG:  正在监听 Unix 套接字 "/var/run/postgresql/.s.PGSQL.5432"
2024-08-30 10:43:08.368 UTC [31] LOG:  数据库系统在 2024-08-30 10:27:21 UTC 中被中断;最后已知正常时间
2024-08-30 10:43:08.515 UTC [31] LOG:  数据库系统未正确关闭;正在进行自动恢复
2024-08-30 10:43:08.519 UTC [31] LOG:  重做从 4/6422E078 开始
2024-08-30 10:43:08.519 UTC [31] LOG:  记录长度无效,在 4/6422E0B0:需要 24,得到 0
2024-08-30 10:43:08.520 UTC [31] LOG:  重做在 4/6422E078 完成
2024-08-30 10:43:08.536 UTC [30] LOG:  数据库系统已准备好接受连接

这是我的建议

3 个赞

我将关闭此主题,以便将讨论集中在一个话题上。 :+1:

2 个赞