数据库关闭错误在 discourse docker 设置的末尾

大家好,我正在尝试按照 How to configure Discourse on Amazon Web services (AWS) - Axel Fernandes's blog 中的步骤,在 AWS EC2 上运行 Docker Discourse 设置。

除了最后一步,其他步骤都顺利完成了。请问能否帮我看看错误出在哪里?

I, [2020-09-17T19:56:38.330642 #1]  INFO -- : File > /etc/nginx/letsencrypt.conf  chmod:   chown: 
I, [2020-09-17T19:56:38.334734 #1]  INFO -- : File > /etc/runit/1.d/letsencrypt  chmod: +x  chown: 
I, [2020-09-17T19:56:38.334916 #1]  INFO -- : Replacing (?-mix:ssl_certificate.+) with ssl_certificate /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.cer;
ssl_certificate /shared/ssl/$$ENV_DISCOURSE_HOSTNAME_ecc.cer;
 in /etc/nginx/conf.d/discourse.conf
I, [2020-09-17T19:56:38.335173 #1]  INFO -- : Replacing (?-mix:#?ACCOUNT_EMAIL=.+) with ACCOUNT_EMAIL=$$ENV_LETSENCRYPT_ACCOUNT_EMAIL
 in /shared/letsencrypt/account.conf
I, [2020-09-17T19:56:38.335395 #1]  INFO -- : Replacing (?-mix:ssl_certificate_key.+) with ssl_certificate_key /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.key;
ssl_certificate_key /shared/ssl/$$ENV_DISCOURSE_HOSTNAME_ecc.key;
 in /etc/nginx/conf.d/discourse.conf
I, [2020-09-17T19:56:38.335982 #1]  INFO -- : Replacing (?-mix:add_header.+) with add_header Strict-Transport-Security 'max-age=63072000'; in /etc/nginx/conf.d/discourse.conf
I, [2020-09-17T19:56:38.336602 #1]  INFO -- : Replacing location @discourse { with location @discourse {
add_header Strict-Transport-Security 'max-age=31536000'; # remember the certificate for a year and automatically connect to HTTPS for this domain in /etc/nginx/conf.d/discourse.conf
I, [2020-09-17T19:56:38.337288 #1]  INFO -- : > echo "Beginning of custom commands"
I, [2020-09-17T19:56:38.339060 #1]  INFO -- : Beginning of custom commands

I, [2020-09-17T19:56:38.339171 #1]  INFO -- : > echo "End of custom commands"
I, [2020-09-17T19:56:38.340989 #1]  INFO -- : End of custom commands

I, [2020-09-17T19:56:38.341091 #1]  INFO -- : Terminating async processes
I, [2020-09-17T19:56:38.341176 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgre
sql/12/bin/postmaster -D /etc/postgresql/12/main pid: 49
2020-09-17 19:56:38.341 UTC [49] LOG:  received fast shutdown request
I, [2020-09-17T19:56:38.341692 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 166
166:signal-handler (1600372598) Received SIGTERM scheduling shutdown...
2020-09-17 19:56:38.344 UTC [49] LOG:  aborting any active transactions
2020-09-17 19:56:38.347 UTC [49] LOG:  background worker "logical replication launcher" (PID 58) exited with exit code 1
2020-09-17 19:56:38.349 UTC [53] LOG:  shutting down
2020-09-17 19:56:38.416 UTC [49] LOG:  database system is shut down
166:M 17 Sep 2020 19:56:38.419 # User requested shutdown...
166:M 17 Sep 2020 19:56:38.419 * Saving the final RDB snapshot before exiting.
166:M 17 Sep 2020 19:56:38.423 * DB saved on disk
166:M 17 Sep 2020 19:56:38.424 # Redis is now ready to exit, bye bye...
sha256:80ffaa9115dbe8b1cfdc8d77dd25054e4fbd6be896fa19f6330448110e2e7251
68b73bf7854c91ff7e9cc5c7748e2826a85e6a6cdb62508d4b26cc9fc4cfd12d
Removing old container
+ /usr/bin/docker rm app
app

+ /usr/bin/docker run --shm-size=512m -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=4 -e UNICORN_SIDEKIQS=1 -e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 -e
 RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 -e RUBY_GC_HEAP_INIT_SLOTS=400000 -e RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCO
URSE_DB_PORT= -e LETSENCRYPT_DIR=/shared/letsencrypt -e DISCOURSE_HOSTNAME=testdiscourse.com -e DISCOURSE_DEVELOPER_EMAILS=sho_xxxxxx_92@gmail.com -e DISCOURSE_SMTP_ADDRESS=smtp.sendgr
id.net -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=SG.xxxxxx -e DISCOURSE_SMTP_PASSWORD=SG.xxxxxx -e LETSENCRYPT_ACCOUNT_EMAIL=me@example.com -h ip-172-31-4-9-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t -p 80:80 -p 443:443 -v /var/discourse
/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:3a:b7:1a:8e:ae local_discourse/app /sbin/boot

我在该日志中未看到任何实际错误。它可能在更上方或更下方。

我已从您的帖子中移除了密码,但您应前往 SendGrid 轮换应用密钥。

您应使用您控制的域名。

@riking 你说得对。严格来说并没有真正的错误。但 SendGrid 方面确实存在问题。以下是配置内容。可能是什么问题呢?能否请你解释一下你提到的“轮换应用密钥”是什么意思?是指重新创建吗?

DISCOURSE_SMTP_ADDRESS: smtp.sendgrid.net
DISCOURSE_SMTP_PORT: 2525
DISCOURSE_SMTP_USER_NAME: apiKey
DISCOURSE_SMTP_PASSWORD: “SG.N6X4OZGjS_xxxxxx”

等等,所以最初的问题是邮件发送?

是的,你需要进入 SendGrid 控制台,撤销之前使用的密码,然后创建一个新的。

@riking 实际上最初并没有这个问题。日志让我有些担心,但后来我意识到邮件没有被送达。

@riking 即使使用了新密钥,电子邮件似乎仍然无法正常工作。还有其他需要处理的事项吗?

请查看这篇#操作指南,看看其中的步骤是否能解决该问题。