Getting type errors in sidekiq queue

Getting lots of these (curiously all for 1 user/thread, one I never got notified for, I’m user 1). What’s the best way to get more info for this to resolve it?

Wachtrij default
Taak Jobs::UserEmail
Argumenten `
        {"type"=>"user_private_message",

“user_id”=>1, “notification_id”=>159511,
“notification_data_hash”=>{“topic_title”=>“Reference Issue 3:”,
“original_post_id”=>71940, “original_post_type”=>1,
“original_username”=>“UN”,
“display_username”=>“UN”},
“notification_type”=>“private_message”, “post_id”=>71940,
“current_site_id”=>“default”}
| |JID|72bfbc432a6c0a96dadfb8c4`|
|CreatedAt|4 uren geleden|
|In de wachtrij|52 seconden geleden|
|Aantal opnieuw geprobeerd|9|
|Laatste poging|51 seconden geleden|
|Volgende opnieuw proberen|binnen 1 uur|

Fout

Fout Klasse Jobs::HandledExceptionWrapper
Foutmelding Wrapped TypeError: no implicit conversion of nil into String

Do you happen to have the backtrace in /logs?

/var/www/discourse/lib/email/message_builder.rb:65:in `gsub!' 
/var/www/discourse/lib/email/message_builder.rb:65:in `subject' 
/var/www/discourse/lib/email/message_builder.rb:126:in `build_args' 
/var/www/discourse/lib/email/message_builder.rb:9:in `build_email' 
/var/www/discourse/app/mailers/user_notifications.rb:571:in `send_notification_email' 
/var/www/discourse/app/mailers/user_notifications.rb:395:in `notification_email' 
/var/www/discourse/app/mailers/user_notifications.rb:275:in `user_private_message' 
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:186:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:20:in `block in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:97:in `run_callbacks' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:19:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:124:in `process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/rescuable.rb:23:in `block in process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/rescuable.rb:15:in `handle_exceptions' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/rescuable.rb:22:in `process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/rendering.rb:30:in `process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/base.rb:609:in `block in process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `block in instrument' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `instrument' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/base.rb:608:in `process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/message_delivery.rb:105:in `block in processed_mailer' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/message_delivery.rb:104:in `tap' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/message_delivery.rb:104:in `processed_mailer' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionmailer-5.1.4/lib/action_mailer/message_delivery.rb:27:in `__getobj__' 
/usr/local/lib/ruby/2.4.0/delegate.rb:80:in `method_missing' 
/var/www/discourse/lib/email/sender.rb:30:in `send' 
/var/www/discourse/app/jobs/regular/user_email.rb:41:in `execute' 
/var/www/discourse/app/jobs/base.rb:134:in `block (2 levels) in perform' 
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection' 
/var/www/discourse/app/jobs/base.rb:129:in `block in perform' 
/var/www/discourse/app/jobs/base.rb:125:in `each' 
/var/www/discourse/app/jobs/base.rb:125:in `perform' 
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:188:in `execute_job'
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:170:in `block (2 levels) in process'
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/middleware/chain.rb:128:in `block in invoke' 
 /var/www/discourse/lib/sidekiq/pausable.rb:80:in `call' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/middleware/chain.rb:130:in `block in invoke' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/middleware/chain.rb:133:in `invoke' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:169:in `block in process' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:141:in `block (6 levels) in dispatch' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/job_retry.rb:97:in `local' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:140:in `block (5 levels) in dispatch' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq.rb:36:in `block in <module:Sidekiq>' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:136:in `block (4 levels) in dispatch' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:204:in `stats' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:131:in `block (3 levels) in dispatch' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/job_logger.rb:7:in `call' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:130:in `block (2 levels) in dispatch' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/job_retry.rb:72:in `global' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:129:in `block in dispatch' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/logging.rb:44:in `with_context' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/logging.rb:38:in `with_job_hash_context' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:128:in `dispatch' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:168:in `process' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:85:in `process_one' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:73:in `run' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/util.rb:16:in `watchdog' 
 /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/util.rb:25:in `block in safe_thread'

If it’s relevant, my subject string is:
%{optional_re} [%{site_name}] %{optional_pm}%{optional_cat}%{topic_title}

1 Like

Slight update: It seems this is always with 1 specific user being involved, created from sso.

1 Like

Looks like it is introduced in this commit where there is a chance for @opts[:subject_pm] to be nil

https://github.com/discourse/discourse/blob/185507d0726fd4220c36c88c6da25333c738142b/app/mailers/user_notifications.rb#L439

@LeoMcA I’m not sure what was the intended value if the topic doesn’t have any allowed groups. Probably just should be I18n.t('subject_pm')?

6 Likes

I ran across this bug as well.

Unsetting this setting:

Capto_Capture%202018-03-10_17-40-51_

Allowed me to send all the failed retries.

Edit: I’d linked to my system here, which indicates how frazzled I was at the time :smiley:

2 Likes

This needs a fix @LeoMcA

1 Like

Apologies, been rammed with work lately. This should fix it, and adds the test I missed first time:

https://github.com/discourse/discourse/pull/5666

7 Likes

Wanted to confirm that this fixes it for me. Thanks @LeoMcA

6 Likes