安装失败

我正在尝试安装 Discourse,但遇到了这个错误:

2023-08-01 12:27:18.881 UTC [42] LOG:  数据库系统已关闭


失败
--------------------
Pups::ExecError: cd /var/www/discourse && 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 tests-passed\n      git fetch --depth 1 origin tests-passed\n  else\n      git fetch --tags --prune-tags --prune --force origin\n  fi\n' 失败,返回 #<Process::Status: pid 147 exit 128>
失败位置:/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec 失败,参数为 {"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"]}.
引导失败,退出代码 128
** 引导失败 ** 请向上滚动查找更早的错误消息,可能不止一个。
./discourse-doctor 可能会帮助诊断问题。
2b0150a1aac20c041b7de6173429a0a0b0133f8a63b5172a0e63f4d2ca5f22b0
==================== 结束重建日志 ====================
重建应用程序失败。

请发布整个日志好吗?

4 个赞

好的!EUR1Okdcax | SourceBin

错误是

fatal: 无法访问 'https://github.com/discourse/discourse.git/':无法解析主机:github.com

您的主机或容器存在 Internet 连接问题。

1 个赞

不过我还是成功地 git clone 了……

git clone 操作是在主机上执行的,这表明主机是正常的,但后续操作发生在容器中。如果它们失败,则表明容器 (docker) 内部存在问题,在这种情况下是 DNS (名称解析) 问题。

以前曾出现过有人报告 docker 内部存在此类连接问题的情况。也许 参见

提供您的提供商和位置的详细信息可能会有所帮助。在容器内使用类似以下的命令进行测试可能会有所帮助:

./launcher enter app
ping -c2 github.com
exit
1 个赞