Page MenuHomePhabricator

UnresolvedEntityRedirectException for "Vincent Crawford" article on English wikipedia: "Unresolved redirect from Q102585843 to Q41805462"
Closed, ResolvedPublicPRODUCTION ERROR

Description

Going here: https://en.wikipedia.org/wiki/Vincent_Crawford returns

[X-mcXQpAICIAAC0FKbMAAAAK] 2021-01-09 12:06:53: Fatal exception of type "Wikibase\DataModel\Services\Lookup\UnresolvedEntityRedirectException"

This has been the case for the last couple of days.

Goal of the Investigation:

  • what's wrong? is it possible to fix? if so, how? are there other examples that we can use?

Time boxed to 8 hours.

Details

Request ID
X-mcXQpAICIAAC0FKbMAAAAK
Request URL
https://en.wikipedia.org/wiki/Vincent_Crawford
Stack Trace
#0 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Wikibase/lib/includes/Store/LatestRevisionIdResult.php(157): Wikibase\Lib\Store\RevisionBasedEntityLookup->Wikibase\Lib\Store\{closure}(integer, Wikibase\DataModel\Entity\ItemId)
#1 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Wikibase/lib/includes/Store/RevisionBasedEntityLookup.php(83): Wikibase\Lib\Store\LatestRevisionIdResult->map()
#2 /srv/mediawiki/php-1.36.0-wmf.25/vendor/wikibase/data-model-services/src/Lookup/RedirectResolvingEntityLookup.php(72): Wikibase\Lib\Store\RevisionBasedEntityLookup->hasEntity(Wikibase\DataModel\Entity\ItemId)
#3 /srv/mediawiki/php-1.36.0-wmf.25/vendor/wikibase/data-model-services/src/Lookup/DisabledEntityTypesEntityLookup.php(69): Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup->hasEntity(Wikibase\DataModel\Entity\ItemId)
#4 /srv/mediawiki/php-1.36.0-wmf.25/vendor/wikibase/data-model-services/src/Lookup/RestrictedEntityLookup.php(93): Wikibase\DataModel\Services\Lookup\DisabledEntityTypesEntityLookup->hasEntity(Wikibase\DataModel\Entity\ItemId)
#5 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Wikibase/client/includes/DataAccess/Scribunto/EntityAccessor.php(193): Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup->hasEntity(Wikibase\DataModel\Entity\ItemId)
#6 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Wikibase/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php(508): Wikibase\Client\DataAccess\Scribunto\EntityAccessor->entityExists(string)
#7 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxCallback.php(26): Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary->entityExists(string)
#8 [internal function]: Scribunto_LuaSandboxCallback->__call(string, array)
#9 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxInterpreter.php(113): LuaSandboxFunction->call(LuaSandboxFunction)
#10 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(296): Scribunto_LuaSandboxInterpreter->callFunction(LuaSandboxFunction, LuaSandboxFunction)
#11 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaCommon/LuaModule.php(68): Scribunto_LuaEngine->executeFunctionChunk(LuaSandboxFunction, PPTemplateFrame_Hash)
#12 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/common/Hooks.php(128): Scribunto_LuaModule->invoke(string, PPTemplateFrame_Hash)
#13 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3351): ScribuntoHooks::invokeHook(Parser, PPTemplateFrame_Hash, array)
#14 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3036): Parser->callParserFunction(PPTemplateFrame_Hash, string, array)
#15 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#16 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(2950): PPFrame_Hash->expand(PPNode_Hash_Tree)
#17 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#18 /srv/mediawiki/php-1.36.0-wmf.25/extensions/ParserFunctions/includes/ParserFunctions.php(144): PPFrame_Hash->expand(PPNode_Hash_Tree)
#19 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3351): MediaWiki\Extensions\ParserFunctions\ParserFunctions::ifeq(Parser, PPTemplateFrame_Hash, array)
#20 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3036): Parser->callParserFunction(PPTemplateFrame_Hash, string, array)
#21 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#22 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3225): PPFrame_Hash->expand(PPNode_Hash_Tree)
#23 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPFrame_Hash)
#24 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(171): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#25 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(183): PPTemplateFrame_Hash->getNamedArgument(string)
#26 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3845): PPTemplateFrame_Hash->getArgument(string)
#27 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(272): Parser->argSubstitution(array, PPTemplateFrame_Hash)
#28 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(171): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#29 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(183): PPTemplateFrame_Hash->getNamedArgument(string)
#30 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3845): PPTemplateFrame_Hash->getArgument(string)
#31 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(272): Parser->argSubstitution(array, PPTemplateFrame_Hash)
#32 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(171): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#33 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(183): PPTemplateFrame_Hash->getNamedArgument(integer)
#34 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(114): PPTemplateFrame_Hash->getArgument(integer)
#35 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(696): PPTemplateFrame_Hash->getArguments()
#36 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxCallback.php(26): Scribunto_LuaEngine->getAllExpandedArguments(string)
#37 [internal function]: Scribunto_LuaSandboxCallback->__call(string, array)
#38 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxInterpreter.php(113): LuaSandboxFunction->call(LuaSandboxFunction)
#39 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(296): Scribunto_LuaSandboxInterpreter->callFunction(LuaSandboxFunction, LuaSandboxFunction)
#40 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaCommon/LuaModule.php(68): Scribunto_LuaEngine->executeFunctionChunk(LuaSandboxFunction, PPTemplateFrame_Hash)
#41 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/common/Hooks.php(128): Scribunto_LuaModule->invoke(string, PPTemplateFrame_Hash)
#42 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3351): ScribuntoHooks::invokeHook(Parser, PPTemplateFrame_Hash, array)
#43 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3036): Parser->callParserFunction(PPTemplateFrame_Hash, string, array)
#44 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#45 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3225): PPFrame_Hash->expand(PPNode_Hash_Tree)
#46 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#47 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(171): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#48 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPTemplateFrame_Hash.php(183): PPTemplateFrame_Hash->getNamedArgument(string)
#49 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(679): PPTemplateFrame_Hash->getArgument(string)
#50 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxCallback.php(26): Scribunto_LuaEngine->getExpandedArgument(string, string)
#51 [internal function]: Scribunto_LuaSandboxCallback->__call(string, array)
#52 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxInterpreter.php(113): LuaSandboxFunction->call(LuaSandboxFunction)
#53 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(296): Scribunto_LuaSandboxInterpreter->callFunction(LuaSandboxFunction, LuaSandboxFunction)
#54 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/engines/LuaCommon/LuaModule.php(68): Scribunto_LuaEngine->executeFunctionChunk(LuaSandboxFunction, PPTemplateFrame_Hash)
#55 /srv/mediawiki/php-1.36.0-wmf.25/extensions/Scribunto/includes/common/Hooks.php(128): Scribunto_LuaModule->invoke(string, PPTemplateFrame_Hash)
#56 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3351): ScribuntoHooks::invokeHook(Parser, PPTemplateFrame_Hash, array)
#57 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3036): Parser->callParserFunction(PPTemplateFrame_Hash, string, array)
#58 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#59 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3225): PPFrame_Hash->expand(PPNode_Hash_Tree)
#60 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#61 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3225): PPFrame_Hash->expand(PPNode_Hash_Tree)
#62 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#63 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(3225): PPFrame_Hash->expand(PPNode_Hash_Tree)
#64 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/PPFrame_Hash.php(255): Parser->braceSubstitution(array, PPFrame_Hash)
#65 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(2874): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#66 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(1545): Parser->replaceVariables(string)
#67 /srv/mediawiki/php-1.36.0-wmf.25/includes/parser/Parser.php(646): Parser->internalParse(string)
#68 /srv/mediawiki/php-1.36.0-wmf.25/includes/content/WikitextContent.php(375): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#69 /srv/mediawiki/php-1.36.0-wmf.25/includes/content/AbstractContent.php(591): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#70 /srv/mediawiki/php-1.36.0-wmf.25/includes/Revision/RenderedRevision.php(266): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#71 /srv/mediawiki/php-1.36.0-wmf.25/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#72 /srv/mediawiki/php-1.36.0-wmf.25/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#73 /srv/mediawiki/php-1.36.0-wmf.25/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#74 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#75 /srv/mediawiki/php-1.36.0-wmf.25/includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#76 /srv/mediawiki/php-1.36.0-wmf.25/includes/poolcounter/PoolWorkArticleView.php(137): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#77 /srv/mediawiki/php-1.36.0-wmf.25/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()
#78 /srv/mediawiki/php-1.36.0-wmf.25/includes/page/ParserOutputAccess.php(260): PoolCounterWork->execute()
#79 /srv/mediawiki/php-1.36.0-wmf.25/includes/page/Article.php(760): MediaWiki\Page\ParserOutputAccess->getParserOutput(WikiPage, ParserOptions, MediaWiki\Revision\RevisionStoreCacheRecord, integer)
#80 /srv/mediawiki/php-1.36.0-wmf.25/includes/page/Article.php(573): Article->generateContentOutput(User, ParserOptions, integer, OutputPage, array)
#81 /srv/mediawiki/php-1.36.0-wmf.25/includes/actions/ViewAction.php(74): Article->view()
#82 /srv/mediawiki/php-1.36.0-wmf.25/includes/MediaWiki.php(532): ViewAction->show()
#83 /srv/mediawiki/php-1.36.0-wmf.25/includes/MediaWiki.php(316): MediaWiki->performAction(Article, Title)
#84 /srv/mediawiki/php-1.36.0-wmf.25/includes/MediaWiki.php(945): MediaWiki->performRequest()
#85 /srv/mediawiki/php-1.36.0-wmf.25/includes/MediaWiki.php(548): MediaWiki->main()
#86 /srv/mediawiki/php-1.36.0-wmf.25/index.php(53): MediaWiki->run()
#87 /srv/mediawiki/php-1.36.0-wmf.25/index.php(46): wfIndexMain()
#88 /srv/mediawiki/w/index.php(3): require(string)
#89 {main}

Event Timeline

Majavah changed the subtype of this task from "Task" to "Production Error".
Majavah set Request URL to https://en.wikipedia.org/wiki/Vincent_Crawford.
Majavah set Request ID to X-mcXQpAICIAAC0FKbMAAAAK.

That page seems to be linked to https://www.wikidata.org/wiki/Q41805462 which is not a redirect

Aklapper renamed this task from Viewing Vincent Crawford article on English wikipedia returns internal error to UnresolvedEntityRedirectException for "Vincent Crawford" article on English wikipedia: "Unresolved redirect from Q102585843 to Q41805462".Jan 9 2021, 12:37 PM
Aklapper added a project: Wikibase-DataModel.
Aklapper edited Stack Trace. (Show Details)
Aklapper set Phatality ID to a2a8ff6d1efddb4c85ee16233cc976c3195f32c256351c2c6bf68cb400dcfeb3.
Lydia_Pintscher added a subscriber: Lydia_Pintscher.

I did some investigation. The issue seems to be in the birth_date parameter of the infobox. Removing that gives me a clean preview.

There is something weird going on: usage tracking says the article is using data from Q104706485, which is a redirect. It should be using data from the redirect target Q41805462 instead. The redirect was made on the 7th.

Strangely, this was fixed by removing the call to Template:Birth date and age, and then immediately self-reverting my edit.

That might have fixed the weird usage tracking issue I mentioned.

I wonder if any jobs were missed when Q102585843 was merged into Q41805462 – maybe we can look that up in logstash. (Compare T270522: [16hrs] Investigate Infrequent JobQueueErrors on Wikidata.)

This might also be a double redirect issue – it seems that, for a while, Q104706485 redirected to Q102585843 which redirected to Q41805462. (Revibot later cleaned up the double redirect.)

This might also be a double redirect issue – it seems that, for a while, Q104706485 redirected to Q102585843 which redirected to Q41805462. (Revibot later cleaned up the double redirect.)

Yeah, I can reproduce a similar error locally by setting up a double redirect:

Lua debug console with mw.wikibase.entityExists('Q1333') = true, mw.wikibase.entityExists('Q13330') = false and mw.wikibase.entityExists('Q1334') is Exception caught: Unresolved redirect from Q1333 to Q50

That said, Revibot only cleaned up the double redirect on the evening of January 10th, so that alone doesn’t explain why the issue on the article was already resolved on January 9th. Maybe there’s some usage tracking issue as well.

I wonder if any jobs were missed when Q102585843 was merged into Q41805462 – maybe we can look that up in logstash. (Compare T270522: [16hrs] Investigate Infrequent JobQueueErrors on Wikidata.)

No errors about failed job queue inserts per se, but there are several occurrences of the UnresolvedEntityRedirectException on enwiki around that time, including in jobs. In chronological order:

  • POST to /w/api.php, with stack trace rooted in ApiParse, so presumably an action=parse request
  • two more ApiParse POSTs, each ca. half a second after the previous one
  • three RunSingleJob requests, with stack trace rooted in RefreshLinksJob
  • another ApiParse, but this time as GET (/w/api.php?action=parse&format=json&page=Vincent_Crawford, so nothing overly suspicious in the params)

In each case, the UnresolvedEntityRedirectException is ultimately reached through a Lua call to entityExists(), so I suppose that is what we should fix. I can’t quite explain the appearance and disappearance of the error based on the edits that affected it, but I assume that those edits somehow influenced the entity ID that the on-wiki Lua module passed into entityExists() – maybe the function was called with “the entity ID linked to the current page”, and that sometimes still pointed to the double-redirect entity and then was updated somehow.

Change 657817 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Catch wider exception type for unresolved redirects

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

Change 657817 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Catch wider exception type for unresolved redirects

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

Addshore moved this task from Active to Done on the wdwb-tech (legacy-backlog) board.
Addshore added a subscriber: Addshore.

I have not verified this locally by instead acted as a third pair of eyes and it looks like the code change should fix the issue.
+999 for also spotting that this may happen on other code paths and fixing the issue there too.