Bad MF translation string in hebrew client locale causes fatal site error

AI-generated summary

A Discourse site using Hebrew as the primary locale encountered a fatal error after an upgrade, resulting in a white screen on login. The issue stemmed from a malformed translation string in the Hebrew locale (client.he.yml), specifically an invalid many plural rule, which is not supported in Hebrew according to Unicode standards. Users attempted various fixes, including disabling plugins, rebuilding, and clearing caches, but the problem persisted. The root cause was identified as a translation error in the posts_likes_MF string, where the many plural form was incorrectly included. A temporary workaround involved setting the default locale to English via the Rails console, which restored functionality. The community discussed the need for graceful fallbacks when translation errors occur and highlighted inconsistencies between Discourse’s plural rules and those used by Crowdin. A bug report was opened, and a pull request was submitted to address the issue, with further discussion continuing on Meta Discourse. seefood, Jagster, thoka, and Moin contributed key insights into the technical details and potential fixes.

This happend about 3 days ago after an upgrade via the WebUI. the site is about 2 months old, has about 500 users and so far ran well.

I tried restart, then rebuild, then flushing redis. Still getting that white screen.

What do I try next? Start without plugins? Scratch and restore from backup?

Relevant logs:

rails/production_errors: empty

rails/production:
Started GET "/" for 147.234.130.218 at 2024-07-21 08:38:13 +0000
Processing by ListController#unread as HTML
  Rendered layout layouts/application.html.erb (Duration: 114.3ms | Allocations: 34494)
Completed 500 Internal Server Error in 264ms (ActiveRecord: 0.0ms | Allocations: 88191)

You propably already tried this, but just to be on the safe side: will safe mode fail too?

Didn’t know about it till now, thanks, but the problem remains.
Like I said, all looks ok if I log out (technically wipe cookies), it fails when I login.

I admit I have no experience with rails and getting it to produce more verbose logs.

Well, for me rails is… well, more than just difficult.

But 500 is error of the server. There is big chance it comes from some plugin, but it can be mis-configuration too. Safe mode can give a hint what is broken, if the issue happends on user’s side. But if something that changes functionality is broken in serverside then safe mode is toothless.

Sure, you can disable every plugins and rebuild to see if the situation will be fixed. And after that start figuring out which one. Or at least disabling all plugins that aren’t by Discourse — and even that isn’t totally sure because every official ones aren’t here in use.

But that takes quite much time. Perhaps it’s wiser move to wait until someone who actual knows chimes in.

Having a look in /logs can often reveal some extra details, or checking the browser console when trying to load the page.

1 Like

Nothing odd in the browser console (Firefox) and the only log line I see created on request is posted in the original topic above.

what’s my next move? ./launcher bootstrap and restore from backup?

I think Jammy ment logs of Discourse. Can you login as an admin?

1 Like

I am the admin, and when I log in, the info is thin, so I inquired within…

Yeah, I was referring to the YourSite/logs page. Is there nothing recorded there for the error?

1 Like

oh dear… a lack of locale translation is a reason to throw a 500?!

EDIT: Since this became a bug report - I don’t think the problem is in the language files per se (since copying the *.en.yml files over he.yml didn’t help) I suggest that such problems should at leat fail gracefully and fall back to english.

From what I read, there is no way to roll back the git to a last working commit before this break? If this passed tests then I guess we have a new test to add. This commit won’t work if your site happens to be using the “wrong” locale. What’s my path to get the site up and running the fastest and how can I avoid this in the future?

I’m not totally sure it is just matter of missing locale somewhere. By that screenshot your MaxMind settings are wrong too.

My pure guess is there is something else broken and that’s rest are broken too. I would do /.launcher rebuild app and trying to find if there comes something funny.

Which language are you using as primary locale?

Hebrew

and I have rebuilt several times, no news.

I would try to enter rails console and set SiteSetting.default_locale='en'

Alternatively: User.find_by(username: 'my-username').update(locale: 'en')

1 Like

Anything I need to run to override my users’ default locale? Because this alone didn’t change much.

Oh good. That worked for me. The texts still show up correctly (aligned from right to left) and only the UI is in English. it’s awkward but usable.

so I’ll loop through all the users with this and then when the hebrew unbreaks I iterate them all back?

I would take some time to find the error in the locale and fix it before doing that.

I want to first get the site up and running. if the translation is broken from crowdin, I have no way to fix it.