Page MenuHomePhabricator

PHP Warning: Illegal string offset 'page_len'
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Warning: Illegal string offset 'page_len'
exception.trace
from /srv/mediawiki/php-1.42.0-wmf.22/includes/ResourceLoader/WikiModule.php(484)
#0 /srv/mediawiki/php-1.42.0-wmf.22/includes/ResourceLoader/WikiModule.php(484): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.42.0-wmf.22/includes/Output/OutputPage.php(3485): MediaWiki\ResourceLoader\WikiModule->isKnownEmpty(MediaWiki\ResourceLoader\Context)
#2 [internal function]: MediaWiki\Output\OutputPage::MediaWiki\Output\{closure}(string)
#3 /srv/mediawiki/php-1.42.0-wmf.22/includes/Output/OutputPage.php(3493): array_filter(array, Closure)
#4 /srv/mediawiki/php-1.42.0-wmf.22/includes/Output/OutputPage.php(3544): MediaWiki\Output\OutputPage->getRlClient()
#5 /srv/mediawiki/php-1.42.0-wmf.22/includes/skins/SkinMustache.php(98): MediaWiki\Output\OutputPage->headElement(MediaWiki\Skins\Vector\SkinVector22)
#6 /srv/mediawiki/php-1.42.0-wmf.22/includes/skins/SkinTemplate.php(176): SkinMustache->generateHTML()
#7 /srv/mediawiki/php-1.42.0-wmf.22/includes/Output/OutputPage.php(3004): SkinTemplate->outputPage()
#8 /srv/mediawiki/php-1.42.0-wmf.22/includes/actions/ActionEntryPoint.php(162): MediaWiki\Output\OutputPage->output(boolean)
#9 /srv/mediawiki/php-1.42.0-wmf.22/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
#10 /srv/mediawiki/php-1.42.0-wmf.22/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}
Impact

Currently at the top of logspam-watch, with 93 hits in the past hour.

Notes

First seen Mar 12, 2024 @ 04:01:30.096. So far only observed on three wikis: www.mediawiki.org, test.wikipedia.org, and office.wikimedia.org. (All three are in group0, but they’re hardly the only group0 wikis, so this still seems a bit unexpected.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
hashar triaged this task as Unbreak Now! priority.Mar 12 2024, 2:13 PM
hashar subscribed.

Marking as Unbreak Now! since I don't quite know the impact that might have. The code path refers to SkinVector22, then includes/ResourceLoader/WikiModule.php had some patches introduced in 1.42.0-wmf.22 for T359522:

rMW3903c8cfecce: ResourceLoader: Migrate wfGetDB call to ICP and move to WikiModule
rMW6194cf19ce73: ResourceLoader: Add preload for foreign WikiModule title info

Then looking a bit more at WikiModule.php, the page_len is not necessarily always set but I don't know that code base at all :-(

Looking at other messages, the stacktrace refers to other skins as well such as SkinVectorLegacy, SkinMustache or SkinTimeless. That thus does not seem to be specific to Vector 2022.

matmarex subscribed.

I spent a few minutes re-reading the code, and I think page_len is always set, but the titleInfo array we're building in that code is multi-dimensional, and we got confused about which level we're on.

Change 1010532 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] WikiModule: Fix data structure when preloading title info

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

(I won't have the time today to backport this, I hope someone else can do it.)

Great thank you for digging into it and figuring out the cause. I'd let Timo review/approve the fix then I guess he can backport/deploy it. Else I will do it later tonight.

Change 1010532 merged by jenkins-bot:

[mediawiki/core@master] WikiModule: Fix data structure when preloading title info

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

Change 1010568 had a related patch set uploaded (by Jforrester; author: Bartosz Dziewoński):

[mediawiki/core@wmf/1.42.0-wmf.22] WikiModule: Fix data structure when preloading title info

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

Change 1010568 merged by jenkins-bot:

[mediawiki/core@wmf/1.42.0-wmf.22] WikiModule: Fix data structure when preloading title info

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

Mentioned in SAL (#wikimedia-operations) [2024-03-12T19:45:31Z] <hashar@deploy2002> Started scap: Backport for [[gerrit:1010568|WikiModule: Fix data structure when preloading title info (T359939)]]

Mentioned in SAL (#wikimedia-operations) [2024-03-12T19:47:57Z] <hashar@deploy2002> hashar and jforrester: Backport for [[gerrit:1010568|WikiModule: Fix data structure when preloading title info (T359939)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-03-12T19:58:46Z] <hashar@deploy2002> Finished scap: Backport for [[gerrit:1010568|WikiModule: Fix data structure when preloading title info (T359939)]] (duration: 13m 14s)

The error has vanished! Thank you @matmarex.