On startup: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [mozILocaleService.requestedLocales]
Categories
(GeckoView :: General, defect, P2)
Tracking
(firefox147 fixed)
| Tracking | Status | |
|---|---|---|
| firefox147 | --- | fixed |
People
(Reporter: robwu, Assigned: olivia)
References
Details
(Whiteboard: [fxdroid][geckoview])
Attachments
(1 file)
When I attach a debugger (via about:debugging on desktop) to Firefox on Android (I tested Firefox Beta and Firefox Focus, latest versions as of today), I see the following error message in the console:
NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [mozILocaleService.requestedLocales]
That error is emitted from the "GeckoView:SetLocale" handler in GeckoViewStartup.sys.mjs, thrown from the requestedLocales setter.
The locales are sent from GeckoRuntimeSettings.java, with locales sourced from Locale.toLanguageTag() in LocaleSettingUpdater.kt.
I suspect that this returns a language tag with a region (similar to bug 1847701), which will trip the requestedLocales setter.
The "GeckoView:SetLocale" handler is responsible for updating the data for Accept-Languages, so besides requestedLocales not being updated, I think that this bug also prevents the Accept-Languages header from updating.
Updated•7 months ago
|
| Assignee | ||
Comment 1•7 months ago
|
||
Thanks for reporting!
A couple of questions, would you mind to share:
- What device OS language(s) were set and the Fenix app language
- The OS version of the Android device you were testing with
I'm having a little trouble getting the same scenario. I tried a couple of language tags with regions.
My understanding is that log will show up in the Multiprocess Toolbox when Fenix is connected to about:debugging.
| Reporter | ||
Comment 2•7 months ago
|
||
(In reply to Olivia Hall [:olivia] from comment #1)
- What device OS language(s) were set and the Fenix app language
I have only one language set, English (United States)
Not sure if relevant, but I also have Regional preferences set to Celsius.
- The OS version of the Android device you were testing with
Android 15, Google Pixel 8.
My understanding is that log will show up in the
Multiprocess Toolboxwhen Fenix is connected toabout:debugging.
Yes.
If you know how to pause the execution of Gecko until the debugger is connected, then I can give that a try, to print the relevant values.
In xpcshell tests, for example, we have logic to spin the event loop until the JS debugger is connected; if something similar exists for Gecko, that would be nice.
| Assignee | ||
Comment 3•7 months ago
|
||
Thanks for the additional info! I was able to get the same error by setting Celsius as my preference on the OS level.
| Reporter | ||
Comment 4•7 months ago
•
|
||
The error also shows up if I add/remove languages at runtime, which enables me to observe the value in the debugger. This is the value that causes the error:
{
"acceptLanguages": "en-US-u-mu-celsius,en-US",
"requestedLocales": [ "en-US-u-mu-celsius" ]
}
Interestingly, when I temporarily added "English (Netherlands)" as a language, my (newly started) Firefox Nightly has en-US,en-NL in intl.accept_languages, but when I remove the language, it does not get reverted. I'm not sure if en-US,en-NL was already there from before (in the profile directory), or whether it was set because of the language change that I did as part of the test.
In any case, it looks like this bug prevents Accept-Language HTTP header, navigator.languages and navigator.language from matching the user's preference. My situation (English with Celsius instead of Freedom units) doesn't feel too unusual, so I would have expected bug reports before. But I cannot find anything in Bugzilla for these keywords. In fact, bug 1948445 shows that at least for one user, the pref was updated.
| Assignee | ||
Comment 5•7 months ago
|
||
would have expected bug reports before
Yeah, I would expect more too. Maybe where regional preferences are new to Android 14 it isn't common knowledge that it can be changed just yet. Definitely important to get ahead of it.
I also wonder if it could be happening some in the bug 1948445 -like reports. Accept-Languages is a part of how we decide when we offer translations/pre-populate dropdowns. I have been tracking that one and ones like it for a while trying to figure out exactly what is going haywire. Really glad you reported this because it is the first concrete actionable I've seen related to it so far.
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 6•7 months ago
|
||
Language tags on Android 14 and greater can have extended formatting cues.
This normalizes the tag the same way as Accept-Languages.
Updated•7 months ago
|
Comment 8•6 months ago
|
||
| bugherder | ||
Description
•