Jobs::HandledExceptionWrapper: Wrapped I18n::InvalidLocale for Jobs::UserEmail

(Michael Downey) #1

Continuing the discussion from Failling jobs in Sidekiq : Jobs::UserEmail:

(I’m not convinced this is linked to the above, but the symptom was similar.)

After testing a group message to a group, I suddely got 2 of these retries alerted in Sidekiq with the error message Jobs::HandledExceptionWrapper: Wrapped I18n::InvalidLocale: "" is not a valid locale for the Jobs::UserEmail job.

Fortunately it’s not breaking anything critical, but worried it might be a problem if someone needs to send a group message. Any ideas?

(Simon Cossar) #2

Assuming you are right up to date, it’s probably related to this:

This method should be changed to validate the locale against I18n.available_locales.

  def user_locale(user)
    user.respond_to?(:locale) ? user.locale : nil

(Michael Downey) #3

Yeah I’m definitely up to the hour on tests-passed.

(Simon Cossar) #4

Can you check what locale returns for those users?

(Sam Saffron) #5

Should probably be

user.locale.present?, it is always going to respond

(Michael Downey) #6

If you can send me exactly what to run, I can try to get this for you; but as a non-dev I’m not sure what you need. The username blurred out was my own, if that helps. :slight_smile:

(Simon Cossar) #7

Thanks, I think it’s sorted out.

(Jeff Atwood) #8

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