Page MenuHomePhabricator

PHP Warning: Array key should be either a string or an integer
Closed, ResolvedPublic

Description

Error

Request URL: https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page
Exception file: /srv/mediawiki/php-master/includes/site/SiteList.php:141
Request ID: XKEX6qwQBHcAAF-NRCcAAABB

message
[XKEX6qwQBHcAAF-NRCcAAABB] /wiki/Main_Page?debug=true   ErrorException from line 141 of /srv/mediawiki/php-master/includes/site/SiteList.php: PHP Warning: Array key should be either a string or an integer
trace
#0 /srv/mediawiki/php-master/includes/site/SiteList.php(141): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-master/includes/site/CachingSiteStore.php(132): SiteList->hasSite(boolean)
#2 /srv/mediawiki/php-master/includes/WikiMap.php(88): CachingSiteStore->getSite(boolean)
#3 /srv/mediawiki/php-master/includes/WikiMap.php(44): WikiMap::getWikiWikiReferenceFromSites(boolean)
#4 /srv/mediawiki/php-master/extensions/EventBus/includes/EventFactory.php(46): WikiMap::getWiki(boolean)
#5 /srv/mediawiki/php-master/extensions/EventBus/includes/EventFactory.php(144): EventFactory::getDomain(string)
#6 /srv/mediawiki/php-master/extensions/EventBus/includes/EventFactory.php(998): EventFactory::createEvent(string, string, array, string)
#7 /srv/mediawiki/php-master/extensions/EventBus/includes/JobQueueEventBus.php(71): EventFactory->createJobEvent(string, JobSpecification)
#8 /srv/mediawiki/php-master/includes/jobqueue/JobQueue.php(340): JobQueueEventBus->doBatchPush(array, integer)
#9 /srv/mediawiki/php-master/includes/jobqueue/JobQueue.php(310): JobQueue->batchPush(array, integer)
#10 /srv/mediawiki/php-master/includes/jobqueue/JobQueueGroup.php(158): JobQueue->push(array)
#11 /srv/mediawiki/php-master/includes/deferred/JobQueueEnqueueUpdate.php(57): JobQueueGroup->push(array)
#12 /srv/mediawiki/php-master/includes/deferred/DeferredUpdates.php(274): JobQueueEnqueueUpdate->doUpdate()
#13 /srv/mediawiki/php-master/includes/deferred/DeferredUpdates.php(219): DeferredUpdates::runUpdate(JobQueueEnqueueUpdate, Wikimedia\Rdbms\LBFactoryMulti, string, integer)
#14 /srv/mediawiki/php-master/includes/deferred/DeferredUpdates.php(143): DeferredUpdates::execute(array, string, integer)
#15 /srv/mediawiki/php-master/includes/MediaWiki.php(909): DeferredUpdates::doUpdates(string)
#16 /srv/mediawiki/php-master/includes/MediaWiki.php(733): MediaWiki->restInPeace(string, boolean)
#17 [internal function]: Closure$MediaWiki::doPostOutputShutdown()
#18 {main}

Impact

Notes

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 31 2019, 7:49 PM

While the example I took was from enwiki beta, by far the wiki with most error messages logged is wikidatawiki beta (XKEb6qwQBGoAAETM02kAAAAS for example) Event-Platform and MediaWiki-JobQueue are mentioned. Not sure if tag them here. I'd appreciate someone more knowledgeable to take a look at the traces and tag as appropriate. Thank you.

I think there might be more than one thing going wrong here, but primarily:

4f72d439

added some code $wikiRef = WikiMap::getWiki( false );

However, this method is not documented as having false as a permissible value. Its supposed to have the wiki id of the target wiki. So this code looks wrong.

"EventFactory.php" line 144 also seems kind of wrong. Its passing the wiki name to self::getDomain, but the docs for self::getDomain indicate that that parameter is a boolean for whether or not the wiki display name is used, not as a value to pass the wikiid

Restricted Application added a project: Analytics. · View Herald TranscriptMar 31 2019, 8:53 PM

4f72d439 is Event-Platform and is causing T219737 as well - ping @Pchelolo too.

Change 500363 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/EventBus@master] Fix event domain fetching code.

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

Milimetric moved this task from Incoming to Radar on the Analytics board.Apr 1 2019, 3:52 PM

Is this a wmf.24 blocker as T219737 was?

dduvall triaged this task as Unbreak Now! priority.Apr 2 2019, 5:46 PM
dduvall added a subscriber: dduvall.

Marking this UBN as is policy for all deployment blockers.

Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptApr 2 2019, 5:46 PM

The https://gerrit.wikimedia.org/r/500363 fixes it. Don't want to self-merge my own patch though.

dduvall assigned this task to Pchelolo.Apr 2 2019, 6:10 PM

The https://gerrit.wikimedia.org/r/500363 fixes it. Don't want to self-merge my own patch though.

Thanks! Looked pretty straightforward so I went ahead and +2'd it. Assuming it passes gate-and-submit, I'll start cutting the branch. If you could verify on Beta prior to deployment, however, that would be helpful.

Change 500363 merged by jenkins-bot:
[mediawiki/extensions/EventBus@master] Fix event domain fetching code.

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

If you could verify on Beta prior to deployment, however, that would be helpful.

The error log has disappeared from beta since the patch has been deployed. Verified.

Jdforrester-WMF closed this task as Resolved.Apr 2 2019, 7:08 PM
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Yay. Thank you!

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