Page MenuHomePhabricator

Fatal UnresolvedEntityRedirectException when viewing certain Wikidata item pages
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

If I call https://www.wikidata.org/w/index.php?title=Q28966042&redirect=no then I get a server error or an exception like [Xi8HgwpAADsAADteSMgAAACA] 2020-01-27 15:53:39: Fataler Ausnahmefehler des Typs „Wikibase\DataModel\Services\Lookup\UnresolvedEntityRedirectException“.

Wikimedia error message: "Error
Our servers are currently under maintenance or experiencing a technical problem. Please try again in a few minutes.
See the error message at the bottom of this page for more information."

2020-01-27 15:53:39 [Xi8HgwpAADsAADteSMgAAACA] mw1264 wikidatawiki 1.35.0-wmf.16 exception ERROR

Wikibase\DataModel\Services\Lookup\UnresolvedEntityRedirectException: Unresolved redirect from Q28966040 to Q28966039 

at /srv/mediawiki/php-1.35.0-wmf.16/extensions/Wikibase/lib/includes/Store/RevisionBasedEntityLookup.php:75
trace
#0 /srv/mediawiki/php-1.35.0-wmf.16/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.35.0-wmf.16/extensions/Wikibase/lib/includes/Store/RevisionBasedEntityLookup.php(77): Wikibase\Lib\Store\LatestRevisionIdResult->map()
#2 /srv/mediawiki/php-1.35.0-wmf.16/vendor/wikibase/data-model-services/src/Lookup/RedirectResolvingEntityLookup.php(72): Wikibase\Lib\Store\RevisionBasedEntityLookup->hasEntity(Wikibase\DataModel\Entity\ItemId)
#3 /srv/mediawiki/php-1.35.0-wmf.16/extensions/Wikibase/repo/RepoHooks.php(960): Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup->hasEntity(Wikibase\DataModel\Entity\ItemId)
#4 /srv/mediawiki/php-1.35.0-wmf.16/includes/Hooks.php(174): Wikibase\RepoHooks::onSkinTemplateBuildNavUrlsNavUrlsAfterPermalink(SkinVector, array, integer, integer)
#5 /srv/mediawiki/php-1.35.0-wmf.16/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#6 /srv/mediawiki/php-1.35.0-wmf.16/includes/skins/SkinTemplate.php(1332): Hooks::run(string, array)
#7 /srv/mediawiki/php-1.35.0-wmf.16/includes/skins/SkinTemplate.php(455): SkinTemplate->buildNavUrls()
#8 /srv/mediawiki/php-1.35.0-wmf.16/includes/skins/SkinTemplate.php(217): SkinTemplate->prepareQuickTemplate()
#9 /srv/mediawiki/php-1.35.0-wmf.16/includes/OutputPage.php(2593): SkinTemplate->outputPage()
#10 /srv/mediawiki/php-1.35.0-wmf.16/includes/MediaWiki.php(974): OutputPage->output(boolean)
#11 /srv/mediawiki/php-1.35.0-wmf.16/includes/MediaWiki.php(987): MediaWiki->{closure}()
#12 /srv/mediawiki/php-1.35.0-wmf.16/includes/MediaWiki.php(530): MediaWiki->main()
#13 /srv/mediawiki/php-1.35.0-wmf.16/index.php(46): MediaWiki->run()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}
Impact
  • Users unable to read or edit part of the data.
  • User stranded with no clue or further interface (useless system error).
  • Raised MW exeption noise affecting (alerts and deploy abort).
  • Raised HTTP 500 levels from prod traffic (alerts)
TODO

After talking to @Lydia_Pintscher her idea is that anything that's easiest to implement given that this page is barely going to be visited.

Event Timeline

Reedy changed the subtype of this task from "Task" to "Production Error".Jan 27 2020, 10:15 PM
Reedy edited Stack Trace. (Show Details)
Krinkle renamed this task from Wikidata internal error to Fatal UnresolvedEntityRedirectException when viewing certain Wikidata item pages.Jan 29 2020, 12:17 AM
Krinkle updated the task description. (Show Details)

I guess the expected behaviour here would be the same as mediawiki which is:

  • First Page 1 ius a redirect then redirect to displaying page 2
  • If page 2 is a redirect, display the content of page 2 showing that it is a redirect. (see below)

image.png (226×323 px, 8 KB)

Oh, interesting, the trace looks like it relates to something else though (not main content page render)

Addshore added a subscriber: Lydia_Pintscher.

@Lydia_Pintscher I'm going to bounce this one over to you for a decision.
I created an example of this happening on test https://test.wikidata.org/w/index.php?title=Q211856&redirect=no

Currently when viewing the item ending 57 which redirects to the item ending 58 we see the following page (when having redirect=no):

image.png (656×667 px, 45 KB)

Note that the concept URI appears in the toolbox with a link to the concept uri 57
The page content displays the fact the page is a redirect to 58.

If we take a step back in the chain we currently see this (see https://test.wikidata.org/w/index.php?title=Q211856&redirect=no)
we just appear to get a fatal.

image.png (629×747 px, 32 KB)

This error is happening because of a lookup to do with the concept URI.

I guess the desired behaviour is that this page would render in the same way as the next entity down the chain and the concept URI would be there in the side bar?

Should be quite an easy fix from us either checking if the title is a redirect and not doing the hasEntity check, or just deciding we never need to do the hasEntity check perhaps?

After talking to @Lydia_Pintscher her idea is that anything that's easiest to implement given that this page is barely going to be visited.

I created an example of this happening on test https://test.wikidata.org/w/index.php?title=Q211856&redirect=no

[…]
The page content displays the fact the page is a redirect to 58.

If we take a step back in the chain we currently see this (see https://test.wikidata.org/w/index.php?title=Q211856&redirect=no)
we just appear to get a fatal.

Fatal exception of type "Wikibase\DataModel\Services\Lookup\UnresolvedEntityRedirectException"

Still reproducible at that url, for the record :)

Change 574495 had a related patch set uploaded (by Rosalie Perside (WMDE); owner: Rosalie Perside (WMDE)):
[mediawiki/extensions/Wikibase@master] Fatal UnresolvedEntityRedirectException when viewing certain Wikidata item pages

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

Change 574495 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fatal UnresolvedEntityRedirectException when viewing certain Wikidata item pages

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