我们正在 DO 上运行 Discourse 的标准安装。一切都很好。然后我们决定按照此链接添加一个插件:
通过添加以下行:
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git && sudo -E -u discourse git clone https://github.com/discourse/discourse-templates.git
容器重建失败。
--------------------
Pups::ExecError: echo "End of custom commands failed with return #<Process::Status: pid 5121 exit 2>
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 "echo \"End of custom commands"
bootstrap failed with exit code 2
所有命令都以 root 身份运行。我认为问题出在这里:
I, [2024-04-18T04:28:49.985355 #1] INFO -- : > cd /var/www/discourse/plugins && sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git && sudo -E -u discourse git clone https://github.com/discourse/discourse-templates.git
Cloning into 'docker_manager'...
warning: unable to access '/root/.config/git/attributes': Permission denied
Cloning into 'discourse-templates'...
warning: unable to access '/root/.config/git/attributes': Permission denied
请在此处提供建议。
pfaffman
(Jay Pfaffman)
3
它显示访问被拒绝。您确定您是以 root 用户身份运行的吗?
1 个赞
我正在遵循此处发布的作为官方 Discourse 插件安装指南的安装指南。所有插件都链接到此指南。在我的案例中,它破坏了我们的安装,我们甚至无法恢复它,即使在初始 yml 设置下也进行了重建。
我非常确定我们是在root权限下运行的。按照说明操作后,我们的安装被终止了,即使在初始的yml设置下也无法重新构建。
构建失败不应该摧毁任何东西,它只会让你离线一段时间。
数据库仍然会完好无损。
2 个赞
pfaffman
(Jay Pfaffman)
7
运行 ./launcher start app 能让论坛运行起来吗?
我最好的猜测是,您插入了一个制表符或其他导致 yml 无效的内容。
错误是关于 yml 文件末尾的“echo”,这表明之前某个地方存在格式问题。
您在编辑文件之前保存了副本吗?或者您是否尝试编辑它以恢复到您认为编辑之前的状态?
您可以尝试重命名您的 app.yml,记下其中的值(尤其是 SMTP 相关内容),然后再次运行 ./discourse-setup。这将为您提供一个可用的 app.yml。
2 个赞
这会启动论坛。
运行 ./discourse-setup 会保留现有的论坛数据,还是我应该先备份然后恢复?非常感谢您的支持。
pfaffman
(Jay Pfaffman)
9
是的。现有的数据库等将保留。这只是创建新 app.yml 的一种方式。
尊敬的 @pfaffman 和 @merefield,感谢您的支持。
存在 2 个问题:
- 关键问题 - YML 语法错误,已由 YML 验证器修复
- 次要问题 - 将 sudo -E -u discourse 替换为仅 git clone(以 root 用户身份)
这有助于我们重建和安装插件。
非常感谢您!
2 个赞
system
(system)
关闭
11
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.