升级失败 - 希望能通过 SSH 协助修复

Yesterday I had an admin message about upgrades. From the web UI, I did the Docker upgrade first and this seemed to go well. After it finished, the upgrade button for Discourse was enabled and I initiated that. At some point something broke and now our site is down. I was on my phone at the time and I didn’t manage to look at the log carefully to see where exactly things broke, before

I’m currently pocking around over SSH and about to try ./launcher rebuild app to hopefully get a better idea about what exactly is the problem in the upgrade. I’ve never done Discourse command-line repair and I want to make sure that I don’t blow away our data. Looking over app.yml, I see that the container is stateless - great - and that all the data is on the host, accessed as a shared volume.

I ran discourse-doctor and it looks like disk space is not the issue. Will the rebuild app command touch the local data store?

Yes, do the ./launcher rebuild app that should do it. It will not blow away your data.

If you’d rather not to it yourself, please see Automatic Rebuilds When You Need Them.

Thanks, the rebuild seems to have worked - the GitHub avatars and favicon don’t show for some reason, though.

你好!
我升级后,页面返回了 504 网关超时错误。
我执行了以下操作,但问题仍未解决:

cd /var/discourse
git pull; ./launcher rebuild app

您知道为什么仍然无法工作吗?

不,目前很难确定具体原因。我的最佳猜测是您可能没有等待服务器完全重启,但也可能是其他问题。重建过程是否顺利完成且无错误?磁盘空间是否已满?docker ps 是否显示容器正在运行?

Docker ps 显示如下:
Captura de pantalla 2020-11-04 a las 16.52.52

如果我输入 ./launcher enter app,它会提示我 容器未运行。我该如何让它运行?

在日志文件中我看到了以下内容:
无法在任何源中找到 rake-13.0.1
请运行 bundle install 以安装缺失的 gems。
这有关系吗?
谢谢

该容器名称表示重建仍在进行中,且仅持续了 4 分钟。

您可以使用以下命令实时查看日志:

docker logs -tf sweet_chatelet

日志有在更新吗?

重建已完成,但只显示以下内容:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

对于 ./launcher enter app,我收到以下错误:
来自守护进程的响应错误:容器 … 未运行

因此,重建在某一步骤失败了。

请尝试使用 ./launcher rebuild app 命令重新构建,并观察日志。当它因另一个错误停止时,向上滚动并搜索错误信息,这些信息将显示问题所在。请将它们复制到这里,我们可以提供帮助。

@Falco 如果我输入 ./launcher logs app,会出现以下内容:
在所有源中找不到 rake-13.0.1
请运行 bundle install 以安装缺失的 gems。

这是全部日志吗?你能分享更大一部分的日志吗?

这台服务器是否位于某些奇怪的防火墙或企业环境之后?还是说它只是互联网上的一台普通 VPS?

在完成 ./launcher rebuild app 后,显示如下信息:启动失败,请向上滚动并查找之前的错误消息,可能不止一条。
./discourse-doctor 可能有助于诊断问题。

但 ./discourse-doctor 无法解决任何问题。

你能向上滚动并查看之前的错误消息吗?

我不知道这个是否能帮你看看发生了什么!Captura de pantalla 2020-11-04 a las 17.49.54|690x388

前三个截图来自 ./launcher logs app,这些没什么用。

最后一个来自 ./launcher rebuild app,其中包含了关键信息!请检查其中的错误,如果可能的话,请将完整输出作为文本粘贴到这里。

谢谢!

/pups/lib/pups/config.rb:106:in `block (2 levels) in run_commands': 无效的 run 命令 cd (SyntaxError)
	从 /pups/lib/pups/config.rb:100:in `each'
	从 /pups/lib/pups/config.rb:100:in `block in run_commands'
	从 /pups/lib/pups/config.rb:99:in `each'
	从 /pups/lib/pups/config.rb:99:in `run_commands'
	从 /pups/lib/pups/config.rb:78:in `run'
	从 /pups/lib/pups/cli.rb:31:in `run'
	从 /pups/bin/pups:8:in `<main>'
44bf915bdff740d4441ad5239f79d5b14a6ed375300c52b85c10eefb7af677a2
** 启动失败 ** 请向上滚动并查找更早的错误信息,可能不止一条。
./discourse-doctor 可能有助于诊断问题。

看起来您的 app.yml 中包含一些无效的命令。

也许您尝试添加插件时输入了一些无效字符?

能否在移除任何密码后将其粘贴在这里?

好的,内容如下:
app.txt (3.4 KB)

看起来您尝试启用使用 Docker 支持子文件夹,但第一个代码块的缩排出错了。

您只需要在第 82、83、84 和 85 行的开头添加两个额外的空格。

之后保存文件并重新构建即可。