Page MenuHomePhabricator

en.wikipedia.beta RevisionBasedEntityLookup.php: Failed to unserialize the content object on multiple pages
Closed, ResolvedPublic

Description

While viewing https://en.wikipedia.beta.wmflabs.org/wiki/Sandbox

[Wj1GIQpEE4AAAEF9IvsAAAAH] /wiki/Sandbox Wikibase\DataModel\Services\Lookup\EntityLookupException from line 44 of /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/RevisionBasedEntityLookup.php: Failed to unserialize the content object.

Backtrace:

#0 /srv/mediawiki/php-master/vendor/wikibase/data-model-services/src/Lookup/RedirectResolvingEntityLookup.php(51): Wikibase\Lib\Store\RevisionBasedEntityLookup->getEntity(Wikibase\DataModel\Entity\ItemId)
#1 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/LangLinkHandler.php(109): Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup->getEntity(Wikibase\DataModel\Entity\ItemId)
#2 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/LangLinkHandler.php(331): Wikibase\Client\LangLinkHandler->getEntityLinks(Title)
#3 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/LangLinkHandler.php(352): Wikibase\Client\LangLinkHandler->getEffectiveRepoLinks(Title, ParserOutput)
#4 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandlers.php(97): Wikibase\Client\LangLinkHandler->addLinksFromRepository(Title, ParserOutput)
#5 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandlers.php(65): Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers->doContentAlterParserOutput(Title, ParserOutput)
#6 /srv/mediawiki/php-master/includes/Hooks.php(177): Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers::onContentAlterParserOutput(WikitextContent, Title, ParserOutput)
#7 /srv/mediawiki/php-master/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#8 /srv/mediawiki/php-master/includes/content/AbstractContent.php(520): Hooks::run(string, array)
#9 /srv/mediawiki/php-master/includes/poolcounter/PoolWorkArticleView.php(145): AbstractContent->getParserOutput(Title, integer, ParserOptions)
#10 /srv/mediawiki/php-master/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()
#11 /srv/mediawiki/php-master/includes/page/Article.php(597): PoolCounterWork->execute()
#12 /srv/mediawiki/php-master/includes/actions/ViewAction.php(68): Article->view()
#13 /srv/mediawiki/php-master/includes/MediaWiki.php(499): ViewAction->show()
#14 /srv/mediawiki/php-master/includes/MediaWiki.php(293): MediaWiki->performAction(Article, Title)
#15 /srv/mediawiki/php-master/includes/MediaWiki.php(851): MediaWiki->performRequest()
#16 /srv/mediawiki/php-master/includes/MediaWiki.php(523): MediaWiki->main()
#17 /srv/mediawiki/php-master/index.php(43): MediaWiki->run()
#18 /srv/mediawiki/w/index.php(3): include(string)
#19 {main}

Event Timeline

Addshore created this task.Dec 22 2017, 6:47 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 22 2017, 6:47 PM

As far as I can tell this was some kind of de-sync in the wb_items_per_site table. I went to the connected item https://wikidata.beta.wmflabs.org/wiki/Q7, removed and restored the sitelink to https://en.wikipedia.beta.wmflabs.org/wiki/Sandbox, and the error is gone.

Do you think this is worth investigating, or can we close this?

https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page gives the reported error - so, may be the issue is more pervasive?

[Wj1b@QpEE4AAAGBAqm0AAAAL] /wiki/Main_Page Wikibase\DataModel\Services\Lookup\EntityLookupException from line 44 of /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/RevisionBasedEntityLookup.php: Failed to unserialize the content object.
Addshore moved this task from Unsorted 💣 to Next on the User-Addshore board.Dec 23 2017, 11:55 AM
Addshore triaged this task as Unbreak Now! priority.Dec 23 2017, 3:48 PM
Restricted Application added subscribers: Liuxinyu970226, Jay8g, TerraCodes. · View Herald TranscriptDec 23 2017, 3:48 PM

So, after looking at logstash it looks like this lines up with each merge of the MCR patch for Revision using MCR.

Overview for the month: https://logstash-beta.wmflabs.org/goto/1cb4946b29abafb086a2f02b784045d2
Attempt 1: https://logstash-beta.wmflabs.org/goto/2b4d81656d2b92e9d5a74b9111755986
Attempt 2: https://logstash-beta.wmflabs.org/goto/c3fe177e24a3c6118f030038ad7c9f31

Addshore renamed this task from en.wikipedia.beta RevisionBasedEntityLookup.php: Failed to unserialize the content object. on Sandbox page to en.wikipedia.beta RevisionBasedEntityLookup.php: Failed to unserialize the content object on multiple pages.Dec 23 2017, 3:56 PM
Addshore moved this task from Inbox to Next on the Multi-Content-Revisions board.
Addshore moved this task from Next to Back Burner 🏛️ on the User-Addshore board.
Addshore added a comment.EditedDec 23 2017, 4:09 PM

As far as I can tell this was some kind of de-sync in the wb_items_per_site table. I went to the connected item https://wikidata.beta.wmflabs.org/wiki/Q7, removed and restored the sitelink to https://en.wikipedia.beta.wmflabs.org/wiki/Sandbox, and the error is gone.

Do you think this is worth investigating, or can we close this?

Per the fact this occurred with both merges of the patch I think we had best look into it some more.
See also T183631 which started happening at the same time and could be related.

The call through to Revision is Revision::getRevisionText in WikiPageEntityRevisionLookup::loadEntityBlob
Revision::getRevisionText calls BlobStore::expandBlob which has some caching which smells fishy to me (as you managed to make the exception go away for the Sandbox page)
the TTL for the cache is 7 days (in SqlBlobStore)

Change 399996 merged by jenkins-bot:
[mediawiki/core@master] [MCR] Introduce BlobStoreFactory

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

Addshore moved this task from Blocked 🚧 to Closing ✔️ on the User-Addshore board.