Page MenuHomePhabricator

Wikibase\Lib\Store\RevisionedUnresolvedRedirectException: Unresolved redirect from Q107001580 to Q41215189
Closed, ResolvedPublic3 Estimated Story PointsPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   Wikibase\Lib\Store\RevisionedUnresolvedRedirectException: Unresolved redirect from Q107001580 to Q41215189
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.7/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php(118)
#0 /srv/mediawiki/php-1.37.0-wmf.7/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityRevisionLookup.php(54): Wikibase\Lib\Store\Sql\WikiPageEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string)
#1 /srv/mediawiki/php-1.37.0-wmf.7/extensions/Wikibase/data-access/src/ByTypeDispatchingEntityRevisionLookup.php(55): Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string)
#2 /srv/mediawiki/php-1.37.0-wmf.7/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityRevisionLookup.php(54): Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string)
#3 /srv/mediawiki/php-1.37.0-wmf.7/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(199): Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, integer, string)
#4 /srv/mediawiki/php-1.37.0-wmf.7/extensions/Wikibase/repo/includes/Api/SetLabel.php(76): Wikibase\Repo\Api\ModifyEntity->applyChangeOp(Wikibase\Repo\ChangeOp\ChangeOpFingerprint, Wikibase\DataModel\Entity\Item, Wikibase\Lib\Summary)
#5 /srv/mediawiki/php-1.37.0-wmf.7/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(319): Wikibase\Repo\Api\SetLabel->modifyEntity(Wikibase\DataModel\Entity\Item, Wikibase\Repo\ChangeOp\ChangeOpFingerprint, array)
#6 /srv/mediawiki/php-1.37.0-wmf.7/includes/api/ApiMain.php(1669): Wikibase\Repo\Api\ModifyEntity->execute()
#7 /srv/mediawiki/php-1.37.0-wmf.7/includes/api/ApiMain.php(639): ApiMain->executeAction()
#8 /srv/mediawiki/php-1.37.0-wmf.7/includes/api/ApiMain.php(610): ApiMain->executeActionWithErrorHandling()
#9 /srv/mediawiki/php-1.37.0-wmf.7/api.php(90): ApiMain->execute()
#10 /srv/mediawiki/php-1.37.0-wmf.7/api.php(45): wfApiMain()
#11 /srv/mediawiki/w/api.php(3): require(string)
#12 {main}
Impact

logspam

Notes

This error currently occurs in SetLabel.

Data integrity errors should really not be showing up in production error logs for mediawiki. Can we put errors like this in a different logstash channel? If it's not a problem with the code or production service level then I think it shouldn't be in the exception channel.

Acceptance Criteria 🏕️🌟
  • We should give the user some nice error when they try to edit something that is now a redirect via the api
  • We should audit and fix ALL other APIs that use entity IDs to ensure that this issue does not occur anywhere else

Details

Event Timeline

We should give the user some nice error when they try to edit something that is now a redirect

Addshore triaged this task as Medium priority.Jun 30 2021, 8:42 AM
Addshore set the point value for this task to 3.Jun 30 2021, 10:19 AM
Ladsgroup subscribed.

This happens basically on every type of edit entity API endpoint not setlabel. It also doesn't happen on redirects per se, it's when you edit on a redirect but with baserevid of pre-becoming-redirect revision. Fun stuff.

Change 702744 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):

[mediawiki/extensions/Wikibase@master] Return exception when current version of the item is now redirect

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

Change 702744 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Return exception when current version of the item is now redirect

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