Errno::ENOENT:没有此文件或目录 @ rb_sysopen - /etc/postgresql/15/main/postgresql.conf

我尝试通过管理员更新,不确定发生了什么,但管理员页面变为空白,而前端正常。决定通过命令行再次更新,并收到此错误

Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/postgresql/15/main/postgresql.conf

cd /var/discourse; ./launcher rebuild app
x86_64 arch detected.
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
2.0.20240708-0023: Pulling from discourse/base
Digest: sha256:025e9c1f68
Status: Image is up to date for discourse/base:2.0.20240708-0023
docker.io/discourse/base:2.0.20240708-0023
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2025-02-06T20:57:43.044950 #1]  INFO -- : Reading from stdin
I, [2025-02-06T20:57:43.066724 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown: 
I, [2025-02-06T20:57:43.072432 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown: 
I, [2025-02-06T20:57:43.077790 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown: 
I, [2025-02-06T20:57:43.083299 #1]  INFO -- : File > /root/install_postgres  chmod: +x  chown: 
I, [2025-02-06T20:57:43.087962 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown: 


FAILED
--------------------
Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/postgresql/15/main/postgresql.conf
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/replace_command.rb:11:in `read'
replace failed with the params {"filename"=>"/etc/postgresql/15/main/postgresql.conf", "from"=>"data_directory = '/var/lib/postgresql/15/main'", "to"=>"data_directory = '/shared/postgres_data'"}
bootstrap failed with exit code 1
** 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.

一些其他信息

cat containers/app.yml | grep postgres

- "templates/postgres.template.yml"

如何解决?

我有一个 DigitalOcean 的 Droplet,运行 Ubuntu,如果这有帮助的话。

我只有一个容器。

那些 * 真的是在那里吗?

[引用=“Sally,帖子:1,话题:350954,用户名:sallypf”]

- "templates/**postgres**.template.yml"

[/引用]

应该是

- "templates/postgres.template.yml"

抱歉,这是复制粘贴错误。我已经修复了。它们不在那里。

1 个赞

我刚刚尝试在另一台服务器上更新另一个实例,过程顺利。两台服务器都是配置相同的DigitalOcean Droplet。
不确定发生了什么。

我的论坛已经宕机两天了,无法正常工作。已将帖子移至支持版块。希望能得到一些帮助。

这是一个更旧的 Docker 镜像,它没有安装 PostgreSQL 15 软件包,因此出现错误:

您的 launcher 文件可能已被修改并锁定使用上面那个旧的 Docker 镜像。您可以将其更改为下面突出显示的最新镜像,然后重试重新构建。(请提前做好必要的备份。)

2 个赞

感谢您的回复。我刚检查过,在 launcher 文件中,基础镜像似乎是最新的。

root@host:/var/discourse# cat launcher | grep "base:2.0"
image="discourse/base:2.0.20250129-0720"

但是重建时仍然使用旧镜像,那么这个旧镜像是在哪里被获取的?我该如何检查?

它也可以在 app.yml 文件中定义为 base_image。如果找到它,您可以简单地注释掉(或删除)该行。

如果这没有帮助,您可以尝试递归搜索该字符串的一部分。

grep --exclude-dir shared -rI 20240708 /var/discourse
3 个赞

它起作用了。非常感谢您的帮助。

1 个赞

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