Discourse 又无法访问了:"bootstrap failed with exit code 5"

您好,社区!很抱歉在这种情况下与大家见面。Discourse 在一次失败的升级后离线。

情况和这个一样。

Discourse offline after failed upgrade "bootstrap failed with exit code 5"

尝试升级到 v3.2.0.beta3

我仍然在使用 Ubuntu 16.04。

幸运的是(我希望如此),我还有之前的 Docker 镜像,但我不知道该如何恢复服务。我也在使用 DigitalOcean。

错误

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle install --retry 3 --jobs 4' failed with return #<Process::Status: pid 448 exit 5>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle config --local deployment true'", "su discourse -c 'bundle config --local without \\\"development test\\\"'", "su discourse -c 'bundle install --retry 3 --jobs 4'"]}
bootstrap failed with exit code 5
** 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.
e9fead51a802981ae53f85f54dc8bf7bf9fae5c1dab3e06e0d77ea0930ffb261

有人能帮忙吗?

虽然我有旧的镜像,但我确实删除了最新的镜像……

docker rmi 51421f454322 -f

我还有旧的容器,但当我尝试运行 ./launcher start app 时,它似乎更倾向于使用已删除的镜像。

root@hostname:/var/discourse# ./launcher start app
WARNING: Docker version 17.05.0-ce deprecated, recommend upgrade to 17.06.2 or newer.
x86_64 arch detected.
WARNING: containers/app.yml file is world-readable. You can secure this file by running: chmod o-rwx containers/app.yml

starting up existing container
+ /usr/bin/docker start app
app

root@hostname:/var/discourse# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                      NAMES
afeec2777503        51421f454322        “/sbin/boot”        3 hours ago         Up 5 seconds        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   app
root@hostname:/var/discourse# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
discourse/base      2.0.20231218-0429   984f729957df        12 days ago         3.14GB

有没有办法使用镜像 ID 984f729957df 继续操作?

更简单的做法是直接启动一个新的 droplet,并将 /var/discourse 复制到新 droplet 上进行重建。这样可以从根本上解决问题,而不是缓解问题。

有一个启动器命令可以提供 docker 命令,这可能会有帮助。你可以查看启动器脚本来找到它的名称(但我现在在手机上)。

1 个赞

看起来您建议的是:./launcher start-cmd app

它会输出很多内容,以 + true run --shm-size=512m -d --restart=always... 开头。

我大胆尝试了:
docker + true run 984f729957df --shm-size=512m -d --restart=always ... 但没有成功。

container_linux.go:247: starting container process caused "exec: \"--shm-size=512m\": executable file not found in $PATH"
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"--shm-size=512m\": executable file not found in $PATH".

如果您能提供任何帮助,我将不胜感激。谢谢。

是的。差不多是那样。我不知道该怎么做。你可能删掉了唯一可用的图片。

我的建议仍然是启动一个新的液滴并将东西复制过来。如果你是我的客户之一,我就会这么做。

感谢您的建议。我不喜欢计划外的迁移,但似乎这就是计划。我将假设您指的是这个?Move a Discourse site to another VPS with rsync

如果我们启用了 DO Spaces(S3 存储),是否会有任何额外的说明?

考虑到一年中的这个时候,协调其他人及时进行必要的更改将是_非常_困难的(阅读:可能不可能)。

我宁愿先恢复到它上次正常工作的状态,这样我就可以计划迁移了。

有人能帮忙吗?

如果您遵循了 为上传配置 S3 兼容对象存储提供商,则不会。如果您在数据库中有设置,那么在尝试恢复而不是 rsync 时可能会更复杂。

迁移到新的液滴风险很低,因为您只需将 DNS 切换回已禁用的站点即可,但如果您无法访问 DNS 和 DigitalOcean,您将陷入困境。

听起来您可能在启动命令中遗漏了某些内容的引用。听起来您可能想这样做。

祝你好运

为上传配置 S3 兼容对象存储提供商

我在 2016 年配置了此服务,所以很遗憾,似乎我们在数据库中存储了设置?app.yml 中没有 S3 参数。

还有其他我应该注意的陷阱吗?

如果使用 rsync 传输,应该就没有问题了。然后就可以切换到推荐的设置。如果尝试数据库恢复,可能会遇到麻烦。

1 个赞

再次感谢您的协助。至于 rsync,我有点担心说明中明确提到的步骤:

  1. 设置新服务器并同步
  2. 停止旧服务器上的服务
  3. 使用 --delete 再次同步

这听起来很不稳定,而且在我的场景中也不可能。这会是个问题吗?我觉得这只是关于确保自上次论坛 rsync 以来发生的任何事情都能同步,但我也许是错的。

更新:
我们已恢复在线,并拥有全新的 Droplet。

很高兴我现在知道迁移相对简单。如果更新没有破坏旧的 Droplet 会更好。

我知道现在是假期,但如果开发团队中的某个人能花些时间研究一下这个问题,那就太好了。我认为这不是一次性的。我在另一个帖子中被标记了,其中有一个正在增长的集合。

2 个赞