Problem
Double redirects on items are not resolved by our lookups (as seen in the exception log below).
We currently have this bot https://www.wikidata.org/wiki/User:Dexbot to resolve those double-redirects statically (changing them into single direct redirects instead).
Between creating a double-redirect and the bot resolving them, we see some exceptions appearing in our logs due to accessing those entities at the front end of the double redirect (the first in the chain).
Suggested investigation
It seems that most those errors happen in requests to wbgetsuggestions module as seen in https://logstash.wikimedia.org/goto/7ccd10e39a14d3b608f2122d9c1c1a01.
- Investigate whether there's a way to handle those exception in that module gracefully, by maybe excluding those items or defaulting back to something meaningful.
For inspiration, we had to handle that exception in Lexeme gracefully for same reason here: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseLexeme/+/525855
timebox investigation to 4 hours
(previous description)
Error
Request URL: api.php
Request ID: uApAICoAAJLcp3kAAAAX
Wikibase\Lib\Store\RevisionedUnresolvedRedirectException: Unresolved redirect from Q… to Q…
#0 /srv/mediawiki/php-1.34.0-wmf.13/extensions/Wikibase/lib/includes/Store/DispatchingEntityRevisionLookup.php(59): Wikibase\Lib\Store\Sql\WikiPageEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string) #1 /srv/mediawiki/php-1.34.0-wmf.13/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityRevisionLookup.php(55): Wikibase\Lib\Store\DispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string) #2 /srv/mediawiki/php-1.34.0-wmf.13/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(192): Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string) #3 /srv/mediawiki/php-1.34.0-wmf.13/extensions/Wikibase/repo/includes/Api/SetLabel.php(62): Wikibase\Repo\Api\ModifyEntity->applyChangeOp(Wikibase\Repo\ChangeOp\ChangeOpLabel, Wikibase\DataModel\Entity\Item, Wikibase\Summary) #4 /srv/mediawiki/php-1.34.0-wmf.13/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(298): Wikibase\Repo\Api\SetLabel->modifyEntity(Wikibase\DataModel\Entity\Item, Wikibase\Repo\ChangeOp\ChangeOpLabel, array) #5 /srv/mediawiki/php-1.34.0-wmf.13/includes/api/ApiMain.php(1583): Wikibase\Repo\Api\ModifyEntity->execute() #6 /srv/mediawiki/php-1.34.0-wmf.13/includes/api/ApiMain.php(531): ApiMain->executeAction() #7 /srv/mediawiki/php-1.34.0-wmf.13/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling() #8 /srv/mediawiki/php-1.34.0-wmf.13/api.php(86): ApiMain->execute() #9 /srv/mediawiki/w/api.php(3): include(string) #10 {main}
And another trace, from an instance found on jobrunners:
#0 /srv/mediawiki/php-1.34.0-wmf.14/extensions/Wikibase/lib/includes/Store/DispatchingEntityRevisionLookup.php(59): Wikibase\Lib\Store\Sql\WikiPageEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string) #1 /srv/mediawiki/php-1.34.0-wmf.14/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityRevisionLookup.php(55): Wikibase\Lib\Store\DispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string) #2 /srv/mediawiki/php-1.34.0-wmf.14/extensions/Wikibase/repo/includes/UpdateRepo/UpdateRepoJob.php(102): Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string) #3 /srv/mediawiki/php-1.34.0-wmf.14/extensions/Wikibase/repo/includes/UpdateRepo/UpdateRepoJob.php(195): Wikibase\Repo\UpdateRepo\UpdateRepoJob->getItem() #4 /srv/mediawiki/php-1.34.0-wmf.14/extensions/EventBus/includes/JobExecutor.php(64): Wikibase\Repo\UpdateRepo\UpdateRepoJob->run() #5 /srv/mediawiki/rpc/RunSingleJob.php(76): JobExecutor->execute(array) #6 {main}
Impact
Some API user requests and JobQueue jobs are fatally aborted. Whether they are intermittent or deterministic is not yet known.
Notes
From Logstash:
- Since since at least 1.34-wmf.8 (30+ days ago).
- Affects wikidata.org only.
- Both PHP7 and HHVM.