Page MenuHomePhabricator

MediumSpecificBagOStuff.php Undefined offset errors
Closed, ResolvedPublic

Description

A bunch of these showed up after deploying 1.36.0-wmf.28 to group0:

Sample url: www.mediawiki.org/w/load.php?lang=fr&modules=ext.echo.styles.badge%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Coojs-ui.styles.icons-alerts%7Cskins.vector.styles.legacy&only=styles&skin=vector

ErrorException: PHP Notice: Undefined offset: 1

The offset varies. Values between 1 and 6 were seen.

Stack Trace
from /srv/mediawiki/php-1.36.0-wmf.28/includes/libs/objectcache/MediumSpecificBagOStuff.php(1094)
#0 /srv/mediawiki/php-1.36.0-wmf.28/includes/libs/objectcache/MediumSpecificBagOStuff.php(1094): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.28/includes/libs/objectcache/RedisBagOStuff.php(282): MediumSpecificBagOStuff->updateOpStats(string, array, array)
#2 /srv/mediawiki/php-1.36.0-wmf.28/includes/libs/objectcache/MediumSpecificBagOStuff.php(617): RedisBagOStuff->doSetMulti(array, integer, integer)
#3 /srv/mediawiki/php-1.36.0-wmf.28/includes/resourceloader/dependencystore/KeyValueDependencyStore.php(84): MediumSpecificBagOStuff->setMulti(array, integer, integer)
#4 /srv/mediawiki/php-1.36.0-wmf.28/includes/resourceloader/ResourceLoader.php(613): Wikimedia\DependencyStore\KeyValueDependencyStore->storeMulti(string, array, integer)
#5 /srv/mediawiki/php-1.36.0-wmf.28/includes/deferred/MWCallableUpdate.php(38): ResourceLoader->{closure}()
#6 /srv/mediawiki/php-1.36.0-wmf.28/includes/deferred/DeferredUpdates.php(513): MWCallableUpdate->doUpdate()
#7 /srv/mediawiki/php-1.36.0-wmf.28/includes/deferred/DeferredUpdates.php(390): DeferredUpdates::attemptUpdate(MWCallableUpdate, Wikimedia\Rdbms\LBFactoryMulti)
#8 /srv/mediawiki/php-1.36.0-wmf.28/includes/deferred/DeferredUpdates.php(221): DeferredUpdates::run(MWCallableUpdate, Wikimedia\Rdbms\LBFactoryMulti, Monolog\Logger, BufferingStatsdDataFactory, string)
#9 /srv/mediawiki/php-1.36.0-wmf.28/includes/deferred/DeferredUpdatesScope.php(267): DeferredUpdates::{closure}(MWCallableUpdate, integer)
#10 /srv/mediawiki/php-1.36.0-wmf.28/includes/deferred/DeferredUpdatesScope.php(196): DeferredUpdatesScope->processStageQueue(integer, integer, Closure)
#11 /srv/mediawiki/php-1.36.0-wmf.28/includes/deferred/DeferredUpdates.php(242): DeferredUpdatesScope->processUpdates(integer, Closure)
#12 /srv/mediawiki/php-1.36.0-wmf.28/includes/MediaWiki.php(1117): DeferredUpdates::doUpdates(string)
#13 /srv/mediawiki/php-1.36.0-wmf.28/includes/MediaWiki.php(853): MediaWiki->restInPeace()
#14 /srv/mediawiki/php-1.36.0-wmf.28/includes/MediaWiki.php(865): MediaWiki->{closure}()
#15 /srv/mediawiki/php-1.36.0-wmf.28/load.php(56): MediaWiki->doPostOutputShutdown()
#16 /srv/mediawiki/php-1.36.0-wmf.28/load.php(38): wfLoadMain()
#17 /srv/mediawiki/w/load.php(3): require(string)
#18 {main}

Event Timeline

dancy triaged this task as Unbreak Now! priority.Jan 26 2021, 9:05 PM

The code in question was touched yesterday, see https://gerrit.wikimedia.org/r/c/mediawiki/core/+/652572. @aaron, can you have a look?

I can repro with

./srv_paratest --filter BagOStuff --use-bagostuff=redis

should be an easy fix.

Change 658780 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] objectcache: fix broken for loop in RedisBagOStuff::doSetMulti()

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

Change 658939 had a related patch set uploaded (by Krinkle; owner: Aaron Schulz):
[mediawiki/core@wmf/1.36.0-wmf.28] objectcache: fix broken for loop in RedisBagOStuff::doSetMulti()

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

Change 658780 merged by jenkins-bot:
[mediawiki/core@master] objectcache: fix broken for loop in RedisBagOStuff::doSetMulti()

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

Change 658939 merged by jenkins-bot:
[mediawiki/core@wmf/1.36.0-wmf.28] objectcache: fix broken for loop in RedisBagOStuff::doSetMulti()

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

Mentioned in SAL (#wikimedia-operations) [2021-01-27T20:58:49Z] <brennen@deploy1001> Synchronized php-1.36.0-wmf.28/includes/libs/objectcache/RedisBagOStuff.php: Backport: [[gerrit:658780|objectcache: fix broken for loop in RedisBagOStuff::doSetMulti() (T273006)]] (duration: 01m 07s)

Just the first patch.

This is currently on testwikis. Per conversation with @dancy at train handoff, waiting for validation on that before rolling train forward.

Logstash no longer shows the errors after the deploy.