Sidekiq: Jobs::UserEmail.delayed_perform failing for one user

Running on latest, and the job appears to only be failing for the one user.

From Sidekiq:

Job
Jobs::UserEmail.delayed_perform

Arguments
{:type=>:user_replied, :user_id=>84, :notification_id=>19276, :current_site_id=>"default"}

Error
Jobs::HandledExceptionWrapper: Wrapped ArgumentError: uncaught throw :exception

From /logs:

Info:
Job exception: uncaught throw :exception

Backtrace:
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n/backend/base.rb:37:in `throw' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n/backend/base.rb:37:in `translate' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n/backend/fallbacks.rb:38:in `translate' /var/www/discourse/lib/freedom_patches/translate_accelerator.rb:128:in `translate' /var/www/discourse/lib/email/message_builder.rb:100:in `body' /var/www/discourse/lib/email/message_builder.rb:113:in `build_args' /var/www/discourse/lib/email/message_builder.rb:9:in `build_email' /var/www/discourse/app/mailers/user_notifications.rb:323:in `send_notification_email' /var/www/discourse/app/mailers/user_notifications.rb:223:in `notification_email' /var/www/discourse/app/mailers/user_notifications.rb:99:in `user_replied' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.4/lib/abstract_controller/base.rb:198:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.4/lib/abstract_controller/callbacks.rb:20:in `block in process_action' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:88:in `__run_callbacks__' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:81:in `run_callbacks' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.4/lib/abstract_controller/callbacks.rb:19:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.4/lib/abstract_controller/base.rb:137:in `process' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.4/lib/action_view/rendering.rb:30:in `process' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.2.4/lib/action_mailer/base.rb:596:in `block in process' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.4/lib/active_support/notifications.rb:164:in `block in instrument' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.4/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.4/lib/active_support/notifications.rb:164:in `instrument' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.2.4/lib/action_mailer/base.rb:593:in `process' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.2.4/lib/action_mailer/base.rb:584:in `initialize' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.2.4/lib/action_mailer/message_delivery.rb:25:in `new' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.2.4/lib/action_mailer/message_delivery.rb:25:in `__getobj__' /usr/local/lib/ruby/2.0.0/delegate.rb:70:in `method_missing' /var/www/discourse/lib/email/sender.rb:26:in `send' /var/www/discourse/app/jobs/regular/user_email.rb:69:in `execute' /var/www/discourse/app/jobs/base.rb:154:in `block (2 levels) in perform'

I don’t have further info on hand, but I believe I’ve seen this issue with this user before. They have a valid email address and can receive emails from Discourse generally, but this job doesn’t want to go through.

Insofar as it’s just the one user and (maybe) the one notification I’m not hugely worried, but I wanted to log this in and see if there’s anything I should/can do to remedy the situation. Thanks again for the time on this. :slight_smile:

this throwing of :exception is super duper weird … not sure why we are doing that and not raising like you are supposed to

This is kind of tricky but I think this fixes it: cc @eviltrout

https://github.com/discourse/discourse/commit/b8a47a11290584254c9a1a370b98c3cc3cbf633e

5 Likes

The failing job passed after updating. Thanks! :sunny:

This topic was automatically closed after 2 days. New replies are no longer allowed.