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

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?

2 Likes

Assuming you are right up to date, it’s probably related to this:
https://github.com/discourse/discourse/pull/4004

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

  def user_locale(user)
    user.respond_to?(:locale) ? user.locale : nil
  end
1 Like

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

Can you check what locale returns for those users?

Should probably be

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

2 Likes

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:

Thanks, I think it’s sorted out.

2 Likes

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