升级到 2.5.0.beta4 时出现问题

点击了升级按钮来升级 Docker。完成后一切似乎都很顺利。点击返回后收到以下提示:

您正在运行旧版本的 Discourse 镜像。
在运行最新镜像之前,Web UI 中的升级功能将被禁用。
为此,请使用 SSH 登录您的服务器并运行:

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

我按照上述步骤操作,但出现了以下错误:

root@ubuntu-s-1vcpu-1gb-nyc1-01:~# cd /var/discourse
root@ubuntu-s-1vcpu-1gb-nyc1-01:/var/discourse# git pull
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 22 (delta 11), reused 12 (delta 6), pack-reused 0
Unpacking objects: 100% (22/22), done.
From https://github.com/discourse/discourse_docker
   70a3323..8c8dbd0  master     -> origin/master
 * [new branch]      pg12       -> origin/pg12
Updating 70a3323..8c8dbd0
Fast-forward
 launcher                    |  2 +-
 templates/sshd.template.yml | 49 ---------------------------------------------
 templates/web.template.yml  |  2 ++
 3 files changed, 3 insertions(+), 50 deletions(-)
 delete mode 100644 templates/sshd.template.yml
root@ubuntu-s-1vcpu-1gb-nyc1-01:/var/discourse# ./launcher rebuild app

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

Unable to find image 'discourse/base:2.0.20200429-2110' locally
2.0.20200429-2110: Pulling from discourse/base
54fec2fa59d0: Pulling fs layer
19bc9811812d: Pulling fs layer
54fec2fa59d0: Verifying Checksum
54fec2fa59d0: Download complete
54fec2fa59d0: Pull complete
19bc9811812d: Verifying Checksum
19bc9811812d: Download complete
19bc9811812d: Pull complete
Digest: sha256:3400307b0464d1fc70f554f990e22842f0abe82e3ed42fbee1eb5bad464ce008
Status: Downloaded newer image for discourse/base:2.0.20200429-2110
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 10 app
app
cd /pups && git pull && /pups/bin/pups --stdin
Already up to date.
I, [2020-05-04T19:34:20.671303 #1]  INFO -- : Loading --stdin
I, [2020-05-04T19:34:20.680407 #1]  INFO -- : > locale-gen $LANG && update-locale
I, [2020-05-04T19:34:20.754357 #1]  INFO -- : Generating locales (this might take a while)...
Generation complete.

I, [2020-05-04T19:34:20.755052 #1]  INFO -- : > mkdir -p /shared/postgres_run
I, [2020-05-04T19:34:20.763216 #1]  INFO -- : 
I, [2020-05-04T19:34:20.765101 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2020-05-04T19:34:20.769530 #1]  INFO -- : 
I, [2020-05-04T19:34:20.770264 #1]  INFO -- : > chmod 775 /shared/postgres_run
I, [2020-05-04T19:34:20.774593 #1]  INFO -- : 
I, [2020-05-04T19:34:20.775571 #1]  INFO -- : > rm -fr /var/run/postgresql
I, [2020-05-04T19:34:20.780287 #1]  INFO -- : 
I, [2020-05-04T19:34:20.781259 #1]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2020-05-04T19:34:20.785953 #1]  INFO -- : 
I, [2020-05-04T19:34:20.786915 #1]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
I, [2020-05-04T19:34:20.884925 #1]  INFO -- : postgres already running stop container



FAILED
--------------------
Pups::ExecError: socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1 failed with return #<Process::Status: pid 25 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1"
28acae3e3ece0cb518bcdb99f94ff1f21dc7b8663ab30720b7d7dad43dcc6d52
** 启动失败 ** 请向上滚动查找之前的错误消息,可能不止一条。
./discourse-doctor 可能有助于诊断问题。

discourse-doctor 也产生了类似的结果。有人能识别这个问题并指出正确的方向吗?提前感谢。

编辑:重启了操作系统,重新构建应用后一切正常。不知道问题出在哪里。

我也遇到了一个问题。我的错误信息如下:

确保启动器为最新版本
获取远程仓库
启动器已是最新版本
停止旧容器
+ /usr/bin/docker stop -t 10 app
app
cat: templates/sshd.template.yml: 没有那个文件或目录
cd /pups && git pull && /pups/bin/pups --stdin
/usr/bin/docker: 无效的引用格式:仓库名称必须为小写。
请参阅 '/usr/bin/docker run --help'。
cat: cids/app_bootstrap.cid: 没有那个文件或目录
"docker rm" 至少需要一个参数。
请参阅 'docker rm --help'。
用法:docker rm [选项] 容器 [容器...]
移除一个或多个容器
rm: 无法删除 'cids/app_bootstrap.cid': 没有那个文件或目录
** 启动失败 ** 请向上滚动查看之前的错误信息,可能不止一条。
./discourse-doctor 可能有助于诊断问题。

Discourse 到目前为止运行得非常好…

您需要删除 app.yml 顶部附近包含的 ssh 模板。无法重建,因为 ssh 模板已被移除

我不知道楼主的问题是什么。

5 个赞

我也遇到同样的问题。Docker 已是最新版本(19.03),我在手动升级前刚执行了 git pull。而且无法通过 Web 界面更新,卡在“正在升级”状态。

请确保从你的 app.yml 中删除该行,你不需要它。

3 个赞

docker ps 的输出是什么?您是否在运行单个容器?

如果没有容器在运行,请删除该套接字文件。确保您的主机上已安装 socat

2 个赞

谢谢 @sam。正如我对原帖的编辑所述,重启和重新构建应用解决了问题。我刚刚发现之前一直让导入容器在运行,现在已将其销毁。Socat 已安装。以下是 docker ps 的输出:

CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                                      NAMES
e3c0fe465fb3        local_discourse/app   "/sbin/boot"        2 days ago          Up 11 minutes       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   app

目前 beta4 版本已运行 3 天,一切正常。非常感谢。

1 个赞

我在手动升级时也遇到过类似的问题,只是当时没有任何关于 sshd 模板的线索,只显示 cat: cids/app_bootstrap.cid: 没有那个文件或目录。但在从 app.yml 中注释掉 sshd 模板后,重新构建就正常了。