更改SMTP凭据时遇到问题

Discourse 版本:v3.2.0 stable
我们目前正在迁移到新的电子邮件服务提供商。为了完成此次迁移,我们需要在 app.yaml 文件中更新 SMTP 凭据。更新凭据后,我们需要重建容器以使更改生效。

cd /var/discourse/
./launcher rebuild app

问题是重建失败了。

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3' failed with return #<Process::Status: pid 530 exit 5>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'"]}
bootstrap failed with exit code 5
** 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.
b0b1f4d0ed01a9bf5b9037585a4b0416b4b4efa2b8e67557ced3d7507380ad0d
root:/#

根据日志,我确定了两个潜在原因:
1

2024-10-14 12:39:33.606 UTC [55] postgres@postgres ERROR:  database "discourse" already exists
2024-10-14 12:39:33.606 UTC [55] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR:  database "discourse" already exists
2024-10-14 12:39:33.728 UTC [58] postgres@discourse ERROR:  role "discourse" already exists
2024-10-14 12:39:33.728 UTC [58] postgres@discourse STATEMENT:  create user discourse;
ERROR:  role "discourse" already exists
  • 我在另一个帖子中看到这个错误可以忽略。它不是一个真正的问题。

2

I, [2024-10-14T12:41:56.391691 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
google-protobuf-3.25.2-x86_64-linux requires ruby version < 3.3.dev, >= 2.7,
which is incompatible with the current version, 3.3.4
  • 看起来我们没有使用所需的 Ruby 版本。

我已附上完整的日志,如果您想仔细查看。
AWS Emails Restart Discourse VM Log 1.txt (39.8 KB)

一个可能的解决方案是迁移到最新的稳定版本,但目前这不可行。

在无法升级版本的情况下,我们还有其他选择吗?是否可以在不更新设置脚本的情况下重建?我不确定这是否能解决问题。

是否可以将 SMTP 凭据设置为环境变量?

非常感谢任何帮助。

谢谢

1 个赞

与其重建,如果您没有对用户体验进行任何升级,您可以运行

./launcher destroy app;./launcher start app

来应用新的 SMTP 设置。

2 个赞

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