Page MenuHomePhabricator

Fatal TypeError: Return of ResourceLoaderImage::getLangFallbacks() must be array (on mrj.wikipedia.org)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.14

message
Fatal TypeError:
Return value of ResourceLoaderImage::getLangFallbacks() must be of the type array, null returned
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderImage.php(174): ResourceLoaderImage->getLangFallbacks(string)
#1 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderImageModule.php(452): ResourceLoaderImage->getPath(ResourceLoaderContext)
#2 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderImageModule.php(438): ResourceLoaderImageModule->getFileHashes(ResourceLoaderContext)
#3 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderModule.php(819): ResourceLoaderImageModule->getDefinitionSummary(ResourceLoaderContext)
#4 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderStartUpModule.php(300): ResourceLoaderModule->getVersionHash(ResourceLoaderContext)
#5 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderStartUpModule.php(484): ResourceLoaderStartUpModule->getModuleRegistrations(ResourceLoaderContext)
#6 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderModule.php(713): ResourceLoaderStartUpModule->getScript(ResourceLoaderContext)
#7 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderModule.php(681): ResourceLoaderModule->buildContent(ResourceLoaderContext)
#8 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderModule.php(816): ResourceLoaderModule->getModuleContent(ResourceLoaderContext)
#9 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoader.php(667): ResourceLoaderModule->getVersionHash(ResourceLoaderContext)
#10 [internal function]: ResourceLoader->{closure}(string)
#11 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoader.php(679): array_map(Closure, array)
#12 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoader.php(766): ResourceLoader->getCombinedVersion(ResourceLoaderContext, array)
#13 /srv/mediawiki/php-1.35.0-wmf.14/load.php(43): ResourceLoader->respond(ResourceLoaderContext)
#14 /srv/mediawiki/w/load.php(3): require(string)
#15 {main}

Impact

The RL startup module is unable to produce a response for mrj.wikipedia.org, and for uselang=mrj on other wikis.

This means all users on mrj.wikipedia.org and mrj-language users on other wikis are consistently receiving the Grade C (no-javascript) experience on desktop and on mobile. E.g. no search suggestions, VisualEditor or WikiEditor.

Notes

The LanguageFallback:getAll method in MediaWiki core is consistently returning null instead of array for the mrj language code. Requests that have been aborted by this fatal error, also logged the following warning slightly before the fatal:

PHP Warning: Invalid argument supplied for foreach()

 	#0 /srv/mediawiki/php-1.35.0-wmf.14/includes/language/LanguageFallback.php(102): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderImage.php(154): MediaWiki\Languages\LanguageFallback->getAll(string, integer)
#2 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderImage.php(174): ResourceLoaderImage->getLangFallbacks(string)
#3 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderImageModule.php(452): ResourceLoaderImage->getPath(ResourceLoaderContext)
#4 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderImageModule.php(438): ResourceLoaderImageModule->getFileHashes(ResourceLoaderContext)
#5 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderModule.php(819): ResourceLoaderImageModule->getDefinitionSummary(ResourceLoaderContext)
#6 /srv/mediawiki/php-1.35.0-wmf.14/includes/resourceloader/ResourceLoaderStartUpModule.php(300): ResourceLoaderModule->getVersionHash(ResourceLoaderContext)

Details

Request ID
Xh4fxwpAMFEAAEYTogIAAADP
Request URL
https://mrj.wikipedia.org/w/load.php?lang=mrj&modules=startup&only=scripts&raw=1&skin=minerva&target=mobile

Event Timeline

Krinkle triaged this task as Unbreak Now! priority.Jan 14 2020, 9:27 PM
Krinkle renamed this task from Fatal TypeError: Return of ResourceLoaderImage::getLangFallbacks() must array (on mrj.wikipedia.org) to Fatal TypeError: Return of ResourceLoaderImage::getLangFallbacks() must be array (on mrj.wikipedia.org).Jan 14 2020, 9:27 PM
Krinkle updated the task description. (Show Details)

External to ResourceLoader, cascading failure from LanguageFallback. Looks like maybe originalFallbackSequence is just not set, for mrj. I'm not sure if that is itself a bug that needs to be fixed, or whether it's actually intended to be optional and just needs an inline default?

I googled "mrj language fallback" and found https://www.mediawiki.org/wiki/User:TJones_(WMF)/Notes/Fallback_Languages which suggests that mrj should fall back to ru.

Change 565072 had a related patch set uploaded (by Jforrester; owner: Lucas Werkmeister (WMDE)):
[mediawiki/core@wmf/1.35.0-wmf.14] Fix fallbacks of mrj (Hill Mari)

https://gerrit.wikimedia.org/r/565072

@Nikerabbit Thanks. Do we have structure tests for these values? If so, perhaps we could add one that validates this key.

Change 565072 merged by jenkins-bot:
[mediawiki/core@wmf/1.35.0-wmf.14] Fix fallbacks of mrj (Hill Mari)

https://gerrit.wikimedia.org/r/565072

Mentioned in SAL (#wikimedia-operations) [2020-01-15T21:03:37Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.14/languages/messages/MessagesMrj.php: Fix fallbacks of mrj (Hill Mari) T242409 T242796 (duration: 01m 05s)

Hmm. Deploying this didn't work; it still results in 500s (some of which Varnish inteprets as backend-fetch-fails, some of which it doesn't). I deployed anyway, but…

It's cached in the localisation cache. Should go away when the train rolls.

Yeah, my bad. I forgot that this needed a full scap (or l10n rebuild at least) for wmf.14 to actually be fixed. Let's roll the train instead today.

CCicalese_WMF added a subscriber: CCicalese_WMF.

I don't believe there is anything for CPT to do here, but let us know if that is incorrect.

Jdforrester-WMF claimed this task.

Resolved by the train rolling to wmf.15.