Sidekiq shows activation emails being sent to email address nil

Sorry for the delayed response. The job that triggered it was: Jobs::CriticalUserEmail

So I followed the guide exactly. When it came to registering the admin account, it did not send an email, and Jobs::CriticalUserEmail contained {“type”=>“signup”, “user_id”=>1, “email_token”=>“REDACTED”, “to_address”=>nil, “current_site_id”=>“default”}.

I did force the admin account just so I could see what issues there were. The result is the following:

  • Doctor works and email is received
  • Digest test works and email is received both HTML version and Plain
  • Any registration no email is sent, and the log for emails in the admin section do not even show a message that an email was sent.

Whenever a user tries to register it’s the same result:
Jobs::CriticalUserEmail contained {“type”=>“signup”, “user_id”=>2, “email_token”=>“REDACTED”, “to_address”=>nil, “current_site_id”=>“default”}.

The tail of /var/discourse/shared/standalone/log/rails/production.log shows (with redactions):

Processing by UsersController#check_username as JSON
  Parameters: {"username"=>"bobo", "email"=>"REDACTED"}
Completed 200 OK in 2ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 636)
Started GET "/session/csrf" for REDACTEDPUBLICIP at 2024-09-26 08:13:03 +0000
Processing by SessionController#csrf as JSON
Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 270)
Started POST "/u" for REDACTEDPUBLICIP at 2024-09-26 08:13:03 +0000
Processing by UsersController#create as */*
  Parameters: {"name"=>"JJ", "email"=>"REDACTED", "password"=>"[FILTERED]", "username"=>"bobo", "password_confirmation"=>"[FILTERED]", "challenge"=>"REDACTED", "timezone"=>"Europe/London"}
Completed 200 OK in 335ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 23323)
Started POST "/login" for REDACTEDPUBLICIP at 2024-09-26 08:13:04 +0000
Processing by StaticController#enter as HTML
  Parameters: {"username"=>"bobo", "password"=>"[FILTERED]", "redirect"=>"/u/account-created"}
Redirected to https://REDACTEDDOMAIN/u/account-created
Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 507)
Started GET "/u/account-created" for REDACTEDPUBLICIP at 2024-09-26 08:13:04 +0000
Processing by UsersController#account_created as HTML
  Rendered layout layouts/application.html.erb (Duration: 14.0ms | Allocations: 4624)
Completed 200 OK in 21ms (Views: 15.1ms | ActiveRecord: 0.0ms | Allocations: 6821)
Started GET "/sidekiq/queues/critical" for REDACTEDPUBLICIP at 2024-09-26 08:13:15 +0000

In the log there, it does show accurate email for the registartaion parameters, but sideqik still reports “to_address”=>nil