# Sidekiq显示激活邮件被发送到邮箱地址为空(nil)

**URL:** <https://meta.discourse.org/t/sidekiq-shows-activation-emails-being-sent-to-email-address-nil/328140>\
**Category:** Self-hosting\
**Tags:** email\
**Created:** [2024年九月25日 22:34 UTC](https://meta.discourse.org/t/sidekiq-shows-activation-emails-being-sent-to-email-address-nil/328140 "2024-09-25T22:34:17Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![LSudo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lsudo/32/451845_2.png) [@LSudo](https://meta.discourse.org/u/LSudo)\
**Post date:** [2024年九月27日 21:21 UTC](https://meta.discourse.org/t/sidekiq-shows-activation-emails-being-sent-to-email-address-nil/328140/13 "2024-09-27T21:21:54Z")

</div>

我可以告诉你我使用的确切过程。也许我所做的过程中有什么是错误的。我愿意完全承认我在这里犯了错误！

1. 拥有域名。它是 discourse.domain.dev（域名已明显 redaction）
2. 设置了电子邮件帐户。我有一个 mailgun 帐户，所以我设置了一个全新的用户用于 SMTP。电子邮件是 discourse@discourse.domain.dev
3. 拥有服务器。它是最新的 Ubuntu（Jammy Jellyfish）
4. `apt install docker.io` - 无
5. Git 已安装
6. 用户是 root
7. 使用 `git clone https://github.com/discourse/discourse_docker.git /var/discourse` 克隆
8. 导航到 cd /var/discourse
9. chmod 700 containers
10. 仍然是 root 用户
11. 运行 ./discourse-setup
12. 按要求填写信息：discourse.domain.dev
13. Discourse 管理员电子邮件：my@personal.email
14. SMTP：[smtp.eu.mailgun.org](http://smtp.eu.mailgun.org)
15. SMTP 端口：587
16. 用户名：noreply@discourse.domain.dev
17. 用户密码：REDACTED
18. 通知电子邮件：noreply@discourse.domain.dev
19. Let’s Encrypt 电子邮件：my@personal.email
20. Maxmind ID：已填入
21. Max Mind 许可证：已填入
22. 验证了设置的输入数据。
23. 按 Enter。
24. 等待。
25. 又等了一会儿
26. 泡了杯茶
27. 引导过程的最后一行：  
`+ /usr/bin/docker run --shm-size=512m -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=8 -e UNICORN_SIDEKIQS=1 -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 DISCOURSE_DB_PORT= -e LETSENCRYPT_DIR=/shared/letsencrypt -e DISCOURSE_FORCE_HTTPS=true -e LC_ALL=en_US.UTF-8 -e LANGUAGE=en_US.UTF-8 -e DISCOURSE_HOSTNAME=discourse.domain.dev -e DISCOURSE_DEVELOPER_EMAILS=my@personal.email -e DISCOURSE_SMTP_ADDRESS=smtp.eu.mailgun.org -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=noreply@discourse.domain.dev -e DISCOURSE_SMTP_PASSWORD=b7fc73b0905b5ffb5f70300f1f796000-1b5736a5-0a60075a -e DISCOURSE_SMTP_DOMAIN=discourse.example.com -e DISCOURSE_NOTIFICATION_EMAIL=noreply@discourse.domain.dev -e LETSENCRYPT_ACCOUNT_EMAIL=my@personal.email -e DISCOURSE_MAXMIND_ACCOUNT_ID=REDACTED -e DISCOURSE_MAXMIND_LICENSE_KEY=REDACTED -h devsite -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 REDACTGED local_discourse/app /sbin/boot`  
REDACTEDLONGSTRING
28. 运行 `./discourse-doctor`。由于无法连接到 redis 而失败。
29. 运行 `./launcher rebuild app`，未更改配置中的任何内容
30. 它已构建。一切正常。唯一的区别是最后的 redaction 长字符串。
31. 运行 `./discourse-doctor`。我收到了来自它的测试电子邮件。
32. 网站已上线，因此我创建了管理员用户帐户。
33. 点击注册
34. 它说它正在发送通知电子邮件。
35. 未收到。
36. 通过 `./discourse-docter` 查看，看到这个：  
`Discourse version at discourse.domain.dev: NOT FOUND`  
`Discourse version at localhost: NOT FOUND`
37. 运行 `./launcher enter app`
38. 运行 `rake admin:create`
39. 输入电子邮件：my@personal.email
40. 重置密码，因为用户已存在
41. 显示“您的帐户现在拥有管理员权限！”
42. 登录到域上的站点
43. 转到 discourse.domain.dev/logs - 看到“Sidekiq heartbeat test failed, restarting`
44. 转到 discourse.domain.dev/sidekiq：看到：  
 ![This image is a digital screenshot of a user interface with a black background and a menu of options. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/8/2/a/82a7df9fb6a99b072e66c0b0845fb5c3f9e7851d.png)
45. 转到查看 Enqueued  
 ![The image shows a screenshot of a webpage displaying a table with data on queues. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/7/8/7/7872aab66b911c37e54b5a4b70615ee16774918b.png)
46. 点击“critical”并展开内容，再次看到“to\_address”=nil  
 ![The image displays a list of current job openings in Africa, organized into rows and columns. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/7/7/5/7758f7408e3cee7ab84483f09c1132f7fcfad8f3.png)

停止，并寻求帮助。

这是今天在全新机器上完全重做。这些是我之前使用的确切步骤。请，如果我搞砸了，请告诉我！🙏

* * *

**系统设置：**

- CPU：4 核
- RAM：16 GB
- 操作系统：Ubuntu LTS 64 位 24.04
- 存储：NVMe 500G
- Postgres 版本：13.16-1
- Redis：7.0.7
- Ruby：3.3.4

---

_[View the full topic](https://meta.discourse.org/t/sidekiq-shows-activation-emails-being-sent-to-email-address-nil/328140)._
