Page MenuHomePhabricator

MWTimestamp::getHumanTimestamp() throws exception for invalid language code
Closed, DeclinedPublicPRODUCTION ERROR

Description

Spamming exception logs:

{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/cldr/CldrNames.php","line":28,"function":"getFileName","class":"Language","type":"::","args":["string","string","string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/cldr/TimeUnits.body.php","line":66,"function":"getOverrideFileName","class":"CldrNames","type":"::","args":["string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/cldr/TimeUnits.body.php","line":26,"function":"loadLanguage","class":"TimeUnits","type":"::","args":["string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/cldr/TimeUnits.body.php","line":156,"function":"getUnits","class":"TimeUnits","type":"::","args":["string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/includes/Hooks.php","line":195,"function":"onGetHumanTimestamp","class":"TimeUnits","type":"::","args":["string","MWTimestamp","MWTimestamp","User","Language"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/languages/Language.php","line":2538,"function":"run","class":"Hooks","type":"::","args":["string","array"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/includes/MWTimestamp.php","line":219,"function":"getHumanTimestamp","class":"Language","type":"->","args":["MWTimestamp","MWTimestamp","User"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/Echo/includes/formatters/NotificationFormatter.php","line":124,"function":"getHumanTimestamp","class":"MWTimestamp","type":"->","args":[]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/Echo/includes/formatters/BasicFormatter.php","line":446,"function":"formatTimestamp","class":"EchoNotificationFormatter","type":"->","args":["string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/Echo/includes/formatters/BasicFormatter.php","line":212,"function":"formatFooter","class":"EchoBasicFormatter","type":"->","args":["EchoEvent","User"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/Echo/includes/controller/NotificationController.php","line":372,"function":"format","class":"EchoBasicFormatter","type":"->","args":["EchoEvent","User","string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/Echo/includes/DataOutputFormatter.php","line":154,"function":"formatNotification","class":"EchoNotificationController","type":"::","args":["EchoEvent","User","string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/Echo/includes/DataOutputFormatter.php","line":121,"function":"formatNotification","class":"EchoDataOutputFormatter","type":"::","args":["EchoEvent","User","string","Language"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/Echo/includes/api/ApiEchoNotifications.php","line":166,"function":"formatOutput","class":"EchoDataOutputFormatter","type":"::","args":["EchoNotification","string","User","Language"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/extensions/Echo/includes/api/ApiEchoNotifications.php","line":43,"function":"getPropList","class":"ApiEchoNotifications","type":"->","args":["User","array","integer","NULL","string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/includes/api/ApiQuery.php","line":287,"function":"execute","class":"ApiEchoNotifications","type":"->","args":[]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/includes/api/ApiMain.php","line":1306,"function":"execute","class":"ApiQuery","type":"->","args":[]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/includes/api/ApiMain.php","line":460,"function":"executeAction","class":"ApiMain","type":"->","args":[]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/includes/api/ApiMain.php","line":432,"function":"executeActionWithErrorHandling","class":"ApiMain","type":"->","args":[]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.9/api.php","line":83,"function":"execute","class":"ApiMain","type":"->","args":[]},
{"file":"/srv/mediawiki/w/api.php","line":3,"function":"include","args":["string"]}

Possibly related: T116890: wgUserLanguage in JS should be valid for API (Exception: Invalid language code "nl_nl").

Event Timeline

aaron raised the priority of this task from to Needs Triage.
aaron updated the task description. (Show Details)
aaron added a project: Notifications.
aaron subscribed.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript
Luke081515 set Security to None.
Luke081515 subscribed.

(High or UBN)

I thought we had fixed the nl_nl bug a few months ago...

Mattflaschen-WMF renamed this task from Invalid language code "hu_hu" to Invalid language code "hu_hu" (NotificationFormatter->getHumanTimestamp).Dec 26 2015, 11:41 PM
Mattflaschen-WMF updated the task description. (Show Details)

This is probably caused by T133822: Crosswatch shows "invalid language code zh_tw", and the actual bug is in MW core crashing when fed an invalid language code. Repurposing bug.

Catrope renamed this task from Invalid language code "hu_hu" (NotificationFormatter->getHumanTimestamp) to MWTimestamp::getHumanTimestamp() throws exception for invalid language code.May 2 2016, 9:48 PM
Krinkle subscribed.

Not seen in Logstash for at least 30 days.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM