如何排查容器内 Discourse 上游故障导致 502 Bad Gateway

(是的,我先搜索了)

最近使用管理员升级界面后,我的 discourse 实例停止工作,响应 502 Bad Gateway。

我进入了容器,它似乎运行着一个 nginx,该 nginx 正在等待 localhost:3000 上的服务器,但该服务器未运行。

(54) Waiting for new unicorn workers under 3802725 to start up...
(54) Waiting for new unicorn workers under 3802725 to start up...
(54) Old pid is: 3800363 New pid is: 3802725
config/unicorn_launcher: line 71: kill: (3802725) - No such process
config/unicorn_launcher: line 15: kill: (3802725) - No such process
(54) exiting
ok: run: redis: (pid 62) 3418739s
ok: run: postgres: (pid 53) 3418739s
supervisor pid: 3803896 unicorn pid: 3803900
config/unicorn_launcher: line 71: kill: (3803900) - No such process
config/unicorn_launcher: line 15: kill: (3803900) - No such process
(3803896) exiting

这会反复重复出现:

ok: run: redis: (pid 64) 4905s
ok: run: postgres: (pid 65) 4905s
supervisor pid: 18571 unicorn pid: 18575
config/unicorn_launcher: line 71: kill: (18575) - No such process
config/unicorn_launcher: line 15: kill: (18575) - No such process
(18571) exiting

我想开启这个帖子来寻求调试帮助;下一步该怎么做——Discourse 试图运行哪个命令?(我知道可以通过阅读/逆向工程代码来找出答案,但在这个论坛上有一个关于此的帖子可能会很有用。)

如果您能提供任何线索,我将不胜感激。

1 个赞

从搜索开始 :wink:

看起来很相似?

你使用的是完全标准的默认安装吗?

鉴于时间点,这很可能与导致一些问题的 data-explorer 更改有关。我们已将其回滚,因此如果您再次尝试重建,应该会更好

3 个赞

是的,我正在使用数据浏览器。重启之前我没有执行 git pull
当我执行 git pull,然后执行 ./launcher restart app 时,问题并未解决。

除了我是在主机上的 nginx 后面运行它。
(而且我还有一些插件,比如数据浏览器。)

我现在正在尝试 ./launcher rebuild app - 我希望重建应用程序能保留我的论坛数据库……而且我不会最终导致我的论坛被重置。
执行 launcher rebuild app 并没有解决问题。

这篇帖子描述了特权容器与非特权容器的问题,但没有提供更多信息。它也来自 2 年前,可能与最近的更新无关。

当然,数据库位于挂载的共享文件夹上,因此会持久化。

在执行 git pull 后重启容器可能不足够。

明白了。我也执行了 ./launcher rebuild app - 这不会拉取插件的更新吗?

是的,这也会更新插件(只要它们克隆在 app.yml 中)

如果仍在调查此问题,我遇到了 502 网关错误,但并非直接在更新例程之后,该例程在 Ruby 版本错误中途失败。由于我大约六周没有更新服务器,我运行了 apt update/upgrade 并重新启动。那时出现了 502 错误,我无法访问论坛网站。重建应用程序解决了问题,并且还完全更新了 Discourse。

供记录,我安装并启用了以下插件:

discourse-bbcode
discourse-data-explorer
discourse-docs
docker_manager
styleguide

并安装但禁用了以下插件:

discourse-topic-list-previews
discoursepage

4 篇帖子被拆分为新主题:当 Discourse 网站出现 502 网关错误时,是否有分步诊断方法?