我的网站在安装插件后无法访问

我尝试安装一个插件,然后在执行./launcher rebuild app时开始出现以下错误:

我使用了./discourse-doctor但未能解决问题。

FAILED
--------------------
Pups::ExecError: if [ -z "$LETSENCRYPT_ACCOUNT_EMAIL" ]; then echo "LETSENCRYPT_ACCOUNT_EMAIL ENV variable is required and has not been set."; exit 1; fi failed with return #<Process::Status: pid 2296 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cmd"=>["if [ -z \"$LETSENCRYPT_ACCOUNT_EMAIL\" ]; then echo \"LETSENCRYPT_ACCOUNT_EMAIL ENV variable is required and has not been set.\"; exit 1; fi", "/bin/bash -c \"if [[ ! \\\"$LETSENCRYPT_ACCOUNT_EMAIL\\\" =~ ([^@]+)@([^\\\\.]+) ]]; then echo \\\\\\\"LETSENCRYPT_ACCOUNT_EMAIL is not a valid email address\\\\\\\"; exit 1; fi\""]}
bootstrap failed with exit code 1
** 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.
324b6cc40db917188cb3d87640ff1a1c23142c551b71bc55b0f33ccd88e88af7

现在显示这个

root@ForumPandex:/var/discourse# ./launcher rebuild app
检测到 x86_64 架构。
确保启动器是最新的
正在获取 origin
启动器是最新的
(<未知>):在第 67 行第 3 列扫描简单键时找不到预期的“:” -e LANG=en_US.UTF-8
YAML 语法错误。请检查您的 containers/*.yml 配置文件。

您的 app.yml 中可能存在拼写错误。

第一个错误消息指向您的 Let’s Encrypt 电子邮件,但第二个错误表明您缺少冒号。您是否注意到在编辑以添加插件时意外添加/删除了任何明显的内容?

3 个赞
ger.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/discourse/discourse-yearly-review.git
          - git clone https://github.com/mondiscourse/discourse-formatting-toolbar.git
          - git clone https://github.com/techapj/discourse-custom-topic-button.git
          - git clone https://github.com/discourse/discourse-chat.git
          - git clone https://github.com/discourse/discourse-adplugin.git
          - git clone https://github.com/communiteq/discourse-delete-unreplied-topics
          - git clone https://github.com/discourse/discourse-animated-avatars
          - git clone https://github.com/gnunicorn/discourse-plugin-replygif
          - git clone https://github.com/discourse/discourse-gamification
          - git clone https://github.com/discourse/discourse-reactions.git
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/discourse/discourse-yearly-review.git
          - git clone https://github.com/mondiscourse/discourse-formatting-toolbar.git
          - git clone https://github.com/techapj/discourse-custom-topic-button.git
          - git clone https://github.com/discourse/discourse-chat.git
          - git clone https://github.com/discourse/discourse-adplugin.git
          - git clone https://github.com/communiteq/discourse-delete-unrepl
          - git clone https://github.com/discourse/discourse-animated-avata
          - git clone https://github.com/gnunicorn/discourse-plugin-replygif
          - git clone https://github.com/discourse/discourse-gamification
          - git clone https://github.com/discourse/discourse-reactions.git
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.

## 任何自定义命令,将在构建后运行
run:
  - exec: echo "开始自定义命令"
  ## 如果您想设置第一次注册的“发件人”电子邮件地址,请取消注释并更改:
  ## 收到第一封注册电子邮件后,请重新注释该行。它只需要运行一次。
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec: echo "结束自定义命令"

@JammyDodger 关于拼写错误说得对。我至少发现了三个:

4 个赞

还有,你的所有插件都重复了两次。

4 个赞

实际上,我创建它的时候复制错了,有什么办法可以一次性从提示中复制所有内容吗?

各位,我不知道我到底做了什么,我只知道网站仍然无法访问,我该如何知道我做错了什么?

现在 Discourse Doctor 说它

======================================== 错误 ========================================
                                    意外错误

打开与 email-smtp.us-east-1.amazonaws.com:25 的 TCP 连接超时(超过 5 秒)

====================================== 解决方案 =======================================
这不是一个常见错误。没有推荐的解决方案!

请将上面的确切错误消息报告给 https://meta.discourse.org/
(如果您找到解决方案,也请一并报告!)
=======================================================================================
替换:SMTP_PASSWORD
替换:LETSENCRYPT_ACCOUNT_EMAIL
替换:DEVELOPER_EMAILS
替换:DISCOURSE_DB_PASSWORD
替换:发送邮件至

==================== 完成! ====================
您想提供此文件的公开版本吗? (Y/n)```

您应该能够使用以下命令重新启动旧容器:

./launcher start app

然后您需要整理好您的 yml 文件。

哦,discourse doctor 应该已经重新启动了旧容器。

仍然很糟糕
我快绝望了

最简单的做法可能是将您的 app.yml 重命名为 broken.yml,然后运行 ./discourse-setup。这将创建一个新的 app.yml,但不会删除您现有的数据。

8 个赞

我试过了,现在显示这个

正在检查您的域名 . . .
警告:无法通过主机名 www.dexforum.com.br] 访问计算机的 443 端口。
警告:与 http://www.dexforum.com.br](端口 80)的连接也失败。

这表明 www.dexforum.com.br] 解析到一个无法到达您正在安装 discourse 的机器的 IP 地址。

首先要做的是确认 www.dexforum.com.br] 解析到此服务器的 IP 地址。
您通常在购买域名的同一地点进行此操作。

如果您确定 IP 地址解析正确,则可能是防火墙问题。
搜索“打开端口 YOUR CLOUD SERVICE”可能会有所帮助。

此工具仅用于最标准的安装。如果您无法解决上述问题,则需要自己编辑 containers/app.yml,然后输入

./launcher rebuild app

嗯,现在我已经完成了 discourse 的设置,但在重建时出现了这个错误:

(未知):在此上下文中不允许映射值,位于第 98 行第 12 列 -e LANG=en_US.UTF-8
YAML 语法错误。请检查您的 containers/*.yml 配置文件。

您是手动编辑了 app.yml 文件,例如添加了插件吗?

是的,插件的 after_code 钩子就在那里。

@danielabc 如果你想让我们帮忙,你需要对我们提供的步骤进行反馈,最好不要脱离主题。安装插件将在我们帮助你重建一个可用的实例之后进行。

1 个赞

我设法解决了,但您知道我发现奇怪的是,Discourse 创建的所有 .yml 文件格式都错误吗?这可能吗?我什么都没做,甚至没有编辑它,但 .yml 文件总是以错误的格式创建。

我使用了 https://www.yamllint.com/,这是我在谷歌上找到的,它帮助我纠正了格式,最终我能够重建

但我从未想过 .yml 文件可能被系统错误格式化,这让我很困惑

1 个赞

Discourse-setup 大约六个月没有改变了。

我唯一能想到它会产生格式不正确的 yaml 的方式是通过对提示的响应。

您是复制粘贴了响应,还是手动输入的?

2 个赞

不应该有那个括号。

我刚刚生成了一个创建新 .yml 的命令,但我没有更改新 .yml 中的任何内容,只是进行了重建,结果由于格式错误而报错