突然之间,Discourse 不再运行,甚至无法使用 ./launcher rebuild app 进行重建。我也注释掉了所有插件。
这是我尝试启动它时显示的日志:https://codefile.io/f/8XUuOqyEDd
这是我使用 ./launcher rebuild app 时的日志。我看到一些关于“未能监听端口 6379 (TCP) 并中止”的信息,但该端口上没有任何东西在运行!
突然之间,Discourse 不再运行,甚至无法使用 ./launcher rebuild app 进行重建。我也注释掉了所有插件。
这是我尝试启动它时显示的日志:https://codefile.io/f/8XUuOqyEDd
这是我使用 ./launcher rebuild app 时的日志。我看到一些关于“未能监听端口 6379 (TCP) 并中止”的信息,但该端口上没有任何东西在运行!
我不认为这与您的问题有关。此警告通常(总是?)在重建过程中出现。
error: connection to server on socket \"/var/run/postgresql/.s.PGSQL.5432\" failed: Connection refused
我认为您的问题更可能源于此。
这可能会提供一些线索:
这是不是导致它在我运行时不工作(没有执行任何 ./launcher rebuild app)时的原因?
我停止了服务器上的所有其他服务,并升级到了最新的Ubuntu LTS,但仍然显示这个:
PG::ConnectionBad: 连接到套接字 "/var/run/postgresql/.s.PGSQL.5432" 的服务器失败:连接被拒绝 (PG::ConnectionBad)
服务器是否在本地运行并接受该套接字上的连接?
这就是我认为错误的原因。
将模板替换为 13 甚至 15 并没有解决问题,这正是引用帖子中所显示的。
原因:
PG::ConnectionBad: 连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败:没有该文件或目录 (PG::ConnectionBad)
服务器是否在本地运行并接受该套接字上的连接?
timeout: down: postgres: 1s, normally up, want up
看起来数据库没有正确启动。日志显示它偶尔会正常启动,但只持续很短时间,所以这可能是一个误导。
ok: run: postgres: (pid 315501) 0s
Postgres 日志可能包含一些问题的线索,尤其是在尝试启动应用程序容器时。
tail -f shared/standalone/log/var-log/postgres/current
您是否进行了 PostgreSQL 15 更新?
我也认为这是由于非正常关机造成的。如果您有备份,我会这样做:启动一个新的虚拟机并恢复它。您可以按照 将 Discourse 站点迁移到另一台 VPS (使用 rsync) 并排除 postgres_*。
另一种选择(如果您没有备份,这是您唯一的选择)将是弄清楚很多关于 postgres 的您不想了解的东西。
如果我的论坛挂掉了(比如我无法进入管理设置和下载备份),我怎么访问我的备份?
我也没有尝试迁移任何东西,一直是正常使用并通过网页界面进行更新的。为什么数据库会出现未正常关闭的情况?
【引用=“mwaniki,第8点,话题358231”】
tail -f shared/standalone/log/var-log/postgres/current
【/引用】
我会提供Postgres日志,稍等一下
2025-03-22 00:30:44.110 UTC [4922] FATAL: lock file "postmaster.pid" is empty
2025-03-22 00:30:44.110 UTC [4922] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
2025-03-22 00:30:45.127 UTC [4964] FATAL: lock file "postmaster.pid" is empty
2025-03-22 00:30:45.127 UTC [4964] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
2025-03-22 00:30:46.151 UTC [4966] FATAL: lock file "postmaster.pid" is empty
2025-03-22 00:30:46.151 UTC [4966] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
2025-03-22 00:30:47.168 UTC [4970] FATAL: lock file "postmaster.pid" is empty
2025-03-22 00:30:47.168 UTC [4970] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
2025-03-22 00:30:48.192 UTC [4977] FATAL: lock file "postmaster.pid" is empty
2025-03-22 00:30:48.192 UTC [4977] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
-rw------- 1 syslog kvm 0 Mar 18 19:48 /var/discourse/shared/standalone/postgres_data/postmaster.pid
这是我的锁文件所在的位置
它们位于 /var/discourse/shared/standalone/backups/default
如果您按照我之前链接的 rsync 说明操作,您就能获取到它们。
它崩溃了,或者服务器重启了,或者发生了其他事情。
在大多数升级过程中,数据库会从一组表(会添加和更改表)“迁移”到另一组表。
您可以尝试停止容器并删除该锁定文件
并查看 PG_VERSION 以了解您拥有的版本,因为我认为您尝试更改了模板。
是的,我看到了错误后尝试进行了更改。
那么,我应该执行 rm /var/discourse/shared/standalone/postgres_data/postmaster.pid 来删除锁文件,然后尝试重建吗?
另外,非常感谢你的帮助。
我会用这个命令来删除锁文件吗?
删除 /var/discourse/shared/standalone/postgres_data/postmaster.pid 是解决方案,谢谢!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.