无法发送摘要邮件:Jobs::UserEmail 弃用通知 / Rails 后无法通过 Enqueue 发送邮件

无法发送摘要。摘要已排队但未实际发送。我看不到任何电子邮件日志。

  • 我在 Sidekiq 中看到已排队的摘要作业
  • 没有实际发送摘要电子邮件
  • 每个作业日志:
弃用通知:Jobs::UserEmail 使用的参数值无法干净地序列化为/从 JSON。这意味着作业将使用与提供给 `enqueue` 的值略有不同的值运行。参数值应为字符串、布尔值、数字或 nil(或这些值类型的数组/哈希)。(自 Discourse 2.9 起弃用) (将在 Discourse 3.0 中移除)
  • 没有出现 SMTP 或 Sidekiq 进程问题
  • 所有非摘要电子邮件(和测试电子邮件)均能正确发送和送达

这是完整的错误日志
信息:

[privateinvestigator] 弃用通知:Jobs::UserEmail 使用的参数值无法干净地序列化为/从 JSON。这意味着作业将使用与提供给 `enqueue` 的值略有不同的值运行。参数值应为字符串、布尔值、数字或 nil(或这些值类型的数组/哈希)。(自 Discourse 2.9 起弃用) (将在 Discourse 3.0 中移除)
在 (discourse):89:in `block (3 levels) in <main>'

回溯

activesupport-8.0.3/lib/active_support/broadcast_logger.rb:218:in `block in dispatch'
activesupport-8.0.3/lib/active_support/broadcast_logger.rb:217:in `map'
activesupport-8.0.3/lib/active_support/broadcast_logger.rb:217:in `dispatch'
activesupport-8.0.3/lib/active_support/broadcast_logger.rb:129:in `warn'
/var/www/discourse/lib/discourse.rb:1053:in `deprecate'
/var/www/discourse/app/jobs/base.rb:407:in `enqueue'
(discourse):89:in `block (3 levels) in <main>'
activerecord-8.0.3/lib/active_record/relation/batches.rb:88:in `each'
activerecord-8.0.3/lib/active_record/relation/batches.rb:88:in `block in find_each'
activerecord-8.0.3/lib/active_record/relation/batches.rb:172:in `block in find_in_batches'
activerecord-8.0.3/lib/active_record/relation/batches.rb:461:in `block in batch_on_unloaded_relation'

<internal:kernel>:187:in `loop'
activerecord-8.0.3/lib/active_record/relation/batches.rb:434:in `batch_on_unloaded_relation'
activerecord-8.0.3/lib/active_record/relation/batches.rb:289:in `in_batches'
activerecord-8.0.3/lib/active_record/relation/batches.rb:171:in `find_in_batches'
activerecord-8.0.3/lib/active_record/relation/batches.rb:87:in `find_each'
(discourse):86:in `with_index'
(discourse):86:in `block (2 levels) in <main>'
rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:203:in `with_connection'
rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in `with_connection'
(discourse):55:in `block in <main>'
(discourse):54:in `each'
(discourse):54:in `<main>'
irb-1.15.2/lib/irb/workspace.rb:101:in `eval'
irb-1.15.2/lib/irb/workspace.rb:101:in `evaluate'
irb-1.15.2/lib/irb/context.rb:591:in `evaluate_expression'
irb-1.15.2/lib/irb/context.rb:557:in `evaluate'
irb-1.15.2/lib/irb.rb:201:in `block (2 levels) in eval_input'
irb-1.15.2/lib/irb.rb:512:in `signal_status'
irb-1.15.2/lib/irb.rb:193:in `block in eval_input'
irb-1.15.2/lib/irb.rb:272:in `block in each_top_level_statement'

<internal:kernel>:187:in `loop'
irb-1.15.2/lib/irb.rb:269:in `each_top_level_statement'
irb-1.15.2/lib/irb.rb:192:in `eval_input'
irb-1.15.2/lib/irb.rb:173:in `block in run'
irb-1.15.2/lib/irb.rb:172:in `catch'
irb-1.15.2/lib/irb.rb:172:in `run'
railties-8.0.3/lib/rails/commands/console/irb_console.rb:113:in `start'
railties-8.0.3/lib/rails/commands/console/console_command.rb:59:in `start'
railties-8.0.3/lib/rails/commands/console/console_command.rb:8:in `start'
railties-8.0.3/lib/rails/commands/console/console_command.rb:87:in `perform'
thor-1.4.0/lib/thor/command.rb:28:in `run'
thor-1.4.0/lib/thor/invocation.rb:127:in `invoke_command'
railties-8.0.3/lib/rails/command/base.rb:178:in `invoke_command'
thor-1.4.0/lib/thor.rb:538:in `dispatch'
railties-8.0.3/lib/rails/command/base.rb:73:in `perform'
railties-8.0.3/lib/rails/command.rb:65:in `block in invoke'
railties-8.0.3/lib/rails/command.rb:143:in `with_argv'
railties-8.0.3/lib/rails/command.rb:63:in `invoke'
railties-8.0.3/lib/rails/commands.rb:18:in `<main>'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:69:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'
bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
script/rails:8:in `<top (required)>'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli/exec.rb:59:in `load'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli/exec.rb:59:in `kernel_load'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli.rb:452:in `exec'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli.rb:35:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli.rb:29:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'

其他人遇到过同样的问题吗?
我该如何解决这个问题?

1 个赞

@emonunix 看起来社区里没有人能帮到你回答问题。抱歉!你是否解决了你的问题?

如果没有,你能告诉我们关于你的设置的任何信息吗?你是否在使用官方安装说明设置的自托管站点?你的站点是最新的吗?

2 个赞

您好 @tobiaseigen 感谢您的跟进。
我们的设置仍然面临此问题。
我们正在运行一个 Discourse 多站点环境,有趣的是,有些站点能够正确发送摘要给符合条件的用户,而其他站点则会排队摘要作业但实际上从未发送

当我们在 Rails 中手动触发摘要发送时,行为相同:

  • 作业出现在 Sidekiq → Queued 中,
  • 没有实际的电子邮件被发送,
  • 并且邮件日志中没有条目显示。

所有常规(非摘要)电子邮件,如用户激活、密码重置和测试电子邮件都能完美发送。

我们已遵循 Discourse 的官方设置说明,并且我们的安装是完全最新的
主机运行 Ubuntu 20.04 LTS

您能否告知我们需要分享哪些具体细节或日志来帮助进一步诊断此问题?

1 个赞

您是否更改了与摘要相关的任何设置?例如“Suppress digest email after days

1 个赞

是的@moin,我尝试增加和减少“邮件摘要延迟天数”\n但没有改变任何东西。

1 个赞

这是否也与 Digest/Activity Summary emails not sending for users even though all conditions are met (Discourse 3.6) 有关?我将关闭此主题,看看您和 @Jacob_Peebles 是否能在那里获得所需的帮助来解决您发送摘要的问题。如果我错了,请给我发私信,我会重新打开这个主题。

1 个赞