无法升级 - 应用程序重建失败,无法引导

我收到了一条通知,说我需要升级我们的安装,所以我去了管理后台,看到了这个:

点击升级链接会触发一个检查,但两者都返回“已是最新”。所以我尝试了 ./launcher rebuild app,结果如下:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & sudo -H -E -u discourse bash -c '
  set -o errexit
  if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
      git remote set-branches --add origin main
      git remote set-branches origin tests-passed
      git fetch --depth 1 origin tests-passed
  else
      git fetch --tags --prune-tags --prune --force origin
  fi
' failed with return #<Process::Status: pid 130 exit 128>
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"=>"code", "cmd"=>["sudo -H -E -u discourse git reset --hard", "sudo -H -E -u discourse git clean -f", "sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [ $(git rev-parse --is-shallow-repository) == \"true\" ]; then\n      git remote set-branches --add origin main\n      git remote set-branches origin $version\n      git fetch --depth 1 origin $version\n  else\n      git fetch --tags --prune-tags --prune --force origin\n  fi\n'", "sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [[ $(git symbolic-ref --short HEAD) == $version ]] ; then\n      git pull\n  else\n      git -c advice.detachedHead=false checkout $version\n  fi\n'", "sudo -H -E -u discourse git config user.discourse-version $version", "mkdir -p tmp", "chown discourse:www-data tmp", "mkdir -p tmp/pids", "mkdir -p tmp/sockets", "touch tmp/.gitkeep", "mkdir -p                    /shared/log/rails", "bash -c \"touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log\"", "bash -c \"ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log\"", "bash -c \"mkdir -p           /shared/{uploads,backups}\"", "bash -c \"ln    -s           /shared/{uploads,backups} $home/public\"", "bash -c \"mkdir -p           /shared/tmp/{backups,restores}\"", "bash -c \"ln    -s           /shared/tmp/{backups,restores} $home/tmp\"", "chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp\"", "[ ! -d public/plugins ] || find public/plugins/ -maxdepth 1 -xtype l -delete"]}
bootstrap failed with exit code 128
** 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.
fd6a747d640a06c375439c5c134aa46ff11ceb8f677d6d16247cb57c9772f731

然后我运行了 ./discourse-doctor,它让网站恢复了(尽管奇怪的是测试邮件超时了,也许那是另一个问题)。所以我又尝试了 ./launcher rebuild app,它又因为同样的问题启动失败了。

有人有什么线索吗?我使用的是 Ubuntu 22.04 上的 Docker。

你能做到然后把信息加在这里吗?

1 个赞

这是 app rebuild 的完整日志:

discourse-log.log.txt (17.7 KB)

我看到当我尝试 app stopapp start 时,它又恢复正常了,但我想那是在旧版本上?

正确。我们不需要整个日志,只需要明显的错误(不是警告)。

(不确定为什么我的上传在该链接上不起作用,但是)查看日志时,我唯一能看到的明显错误是:

fatal: unable to access 'https://github.com/discourse/discourse.git/': Could not resolve host: github.com

这听起来不太好?

服务器上的 ~$ host github.com 可以正常解析。

如果错误很明显,他也不会发帖。 :slight_smile: (但说真的,对于不熟悉这些日志的人来说,很难弄清楚什么重要,什么不重要,而且你会发现有数百个主题是有人错误地猜测了错误是什么。

听起来像是 Docker 网络出了某种问题。Docker 是最新的吗?你的操作系统呢?

2 个赞

@gilgongo 说得对 :wink:

1 个赞

啊——网络?好的,在我尝试做一件“基本”的事情时,我运行了 systemctl restart docker.service 然后运行了 ./launcher rebuild app,(在感觉过了漫长岁月之后)它重新启动并正常工作了!现在显示我运行的是“3.3.0.beta3-dev”,这听起来是个好兆头,我想?至少它似乎在工作。

呼——感谢你的帮助!我爱 Discourse!

2 个赞

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