Page MenuHomePhabricator

"InvalidArgumentException" for some Property talk pages on Wikidata (Could not load data from the database of entity source: local)
Closed, ResolvedPublic

Description

Steps to Reproduce:

https://www.wikidata.org/wiki/Property_talk:P5137

Actual Results:

[XlV74wpAAEMAAAdR3ZoAAADP] 2020-02-25 19:56:19: Fatal undtagelse af typen "InvalidArgumentException"

Expected Results:

Wikipage should be rendered with discussion text.


Not all pages err

It seems to be related to lexeme properties.

lexeme properties:
https://www.wikidata.org/wiki/Property_talk:P6072 (error)
https://www.wikidata.org/wiki/Property_talk:P6271 (error)

Q-items properties:
https://www.wikidata.org/wiki/Property_talk:P6071 (no error)
https://www.wikidata.org/wiki/Property_talk:P5136 (no error)

Details

Request ID
XlV74wpAAEMAAAdR3ZoAAADP
Request URL
https://www.wikidata.org/wiki/Property:P5137
Stack Trace
InvalidArgumentException from line 237 of /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php: Could not load data from the database of entity source: local
#0 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php(228): Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->assertEntityIdFromKnownSource(Wikibase\Lexeme\Domain\Model\SenseId)
#1 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php(222): Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->assertCanHandleEntityId(Wikibase\Lexeme\Domain\Model\SenseId)
#2 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php(108): Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->assertCanHandleEntityIds(array)
#3 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/Sql/TypeDispatchingWikiPageEntityMetaDataAccessor.php(88): Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->loadRevisionInformation(array, string)
#4 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php(267): Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor->loadRevisionInformation(array, string)
#5 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php(189): Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor->doFetch(string)
#6 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php(178): Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor->loadRevisionInformation(array, string)
#7 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/data-access/src/ByTypeDispatchingEntityRevisionLookup.php(64): Wikibase\Lib\Store\Sql\WikiPageEntityRevisionLookup->getLatestRevisionId(Wikibase\Lexeme\Domain\Model\SenseId, string)
#8 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/CacheRetrievingEntityRevisionLookup.php(158): Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup->getLatestRevisionId(Wikibase\Lexeme\Domain\Model\SenseId, string)
#9 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(126): Wikibase\Lib\Store\CacheRetrievingEntityRevisionLookup->getLatestRevisionId(Wikibase\Lexeme\Domain\Model\SenseId, string)
#10 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/CacheRetrievingEntityRevisionLookup.php(158): Wikibase\Lib\Store\CachingEntityRevisionLookup->getLatestRevisionId(Wikibase\Lexeme\Domain\Model\SenseId, string)
#11 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(126): Wikibase\Lib\Store\CacheRetrievingEntityRevisionLookup->getLatestRevisionId(Wikibase\Lexeme\Domain\Model\SenseId, string)
#12 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/RedirectResolvingLatestRevisionLookup.php(36): Wikibase\Lib\Store\CachingEntityRevisionLookup->getLatestRevisionId(Wikibase\Lexeme\Domain\Model\SenseId)
#13 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/CachingFallbackLabelDescriptionLookup.php(113): Wikibase\Lib\Store\RedirectResolvingLatestRevisionLookup->lookupLatestRevisionResolvingRedirect(Wikibase\Lexeme\Domain\Model\SenseId)
#14 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/lib/includes/Store/CachingFallbackLabelDescriptionLookup.php(107): Wikibase\Lib\Store\CachingFallbackLabelDescriptionLookup->getTerm(Wikibase\Lexeme\Domain\Model\SenseId, string, string)
#15 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/client/includes/Usage/UsageTrackingLanguageFallbackLabelDescriptionLookup.php(71): Wikibase\Lib\Store\CachingFallbackLabelDescriptionLookup->getLabel(Wikibase\Lexeme\Domain\Model\SenseId)
#16 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/client/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindings.php(60): Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup->getLabel(Wikibase\Lexeme\Domain\Model\SenseId)
#17 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Wikibase/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php(605): Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageDependentLuaBindings->getLabel(string)
#18 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxCallback.php(26): Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary->getLabel(string)
#19 [internal function]: Scribunto_LuaSandboxCallback->__call(string, array)
#20 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxInterpreter.php(113): LuaSandboxFunction->call(LuaSandboxFunction)
#21 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(291): Scribunto_LuaSandboxInterpreter->callFunction(LuaSandboxFunction, LuaSandboxFunction)
#22 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Scribunto/includes/engines/LuaCommon/LuaModule.php(69): Scribunto_LuaEngine->executeFunctionChunk(LuaSandboxFunction, PPTemplateFrame_Hash)
#23 /srv/mediawiki/php-1.35.0-wmf.20/extensions/Scribunto/includes/common/Hooks.php(128): Scribunto_LuaModule->invoke(string, PPTemplateFrame_Hash)
#24 /srv/mediawiki/php-1.35.0-wmf.20/includes/parser/Parser.php(3604): ScribuntoHooks::invokeHook(Parser, PPTemplateFrame_Hash, array)
#25 /srv/mediawiki/php-1.35.0-wmf.20/includes/parser/Parser.php(3308): Parser->callParserFunction(PPTemplateFrame_Hash, string, array)
#26 /srv/mediawiki/php-1.35.0-wmf.20/includes/parser/PPFrame_Hash.php(253): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#27 /srv/mediawiki/php-1.35.0-wmf.20/includes/parser/Parser.php(3486): PPFrame_Hash->expand(PPNode_Hash_Tree)
#28 /srv/mediawiki/php-1.35.0-wmf.20/includes/parser/PPFrame_Hash.php(253): Parser->braceSubstitution(array, PPFrame_Hash)
#29 /srv/mediawiki/php-1.35.0-wmf.20/includes/parser/Parser.php(3149): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#30 /srv/mediawiki/php-1.35.0-wmf.20/includes/parser/Parser.php(1483): Parser->replaceVariables(string)
#31 /srv/mediawiki/php-1.35.0-wmf.20/includes/parser/Parser.php(599): Parser->internalParse(string)
#32 /srv/mediawiki/php-1.35.0-wmf.20/includes/content/WikitextContent.php(368): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#33 /srv/mediawiki/php-1.35.0-wmf.20/includes/content/AbstractContent.php(565): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#34 /srv/mediawiki/php-1.35.0-wmf.20/includes/Revision/RenderedRevision.php(267): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#35 /srv/mediawiki/php-1.35.0-wmf.20/includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#36 /srv/mediawiki/php-1.35.0-wmf.20/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#37 /srv/mediawiki/php-1.35.0-wmf.20/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#38 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#39 /srv/mediawiki/php-1.35.0-wmf.20/includes/Revision/RenderedRevision.php(198): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#40 /srv/mediawiki/php-1.35.0-wmf.20/includes/poolcounter/PoolWorkArticleView.php(196): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#41 /srv/mediawiki/php-1.35.0-wmf.20/includes/poolcounter/PoolCounterWork.php(125): PoolWorkArticleView->doWork()
#42 /srv/mediawiki/php-1.35.0-wmf.20/includes/page/Article.php(797): PoolCounterWork->execute()
#43 /srv/mediawiki/php-1.35.0-wmf.20/includes/actions/ViewAction.php(63): Article->view()
#44 /srv/mediawiki/php-1.35.0-wmf.20/includes/MediaWiki.php(518): ViewAction->show()
#45 /srv/mediawiki/php-1.35.0-wmf.20/includes/MediaWiki.php(304): MediaWiki->performAction(Article, Title)
#46 /srv/mediawiki/php-1.35.0-wmf.20/includes/MediaWiki.php(971): MediaWiki->performRequest()
#47 /srv/mediawiki/php-1.35.0-wmf.20/includes/MediaWiki.php(534): MediaWiki->main()
#48 /srv/mediawiki/php-1.35.0-wmf.20/index.php(47): MediaWiki->run()
#49 /srv/mediawiki/w/index.php(3): require(string)
#50 {main}
Related Gerrit Patches:

Event Timeline

Fnielsen created this task.Feb 25 2020, 8:04 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 25 2020, 8:04 PM
Lucas_Werkmeister_WMDE changed the subtype of this task from "Bug Report" to "Production Error".
Lucas_Werkmeister_WMDE renamed this task from "InvalidArgumentException" for Proper talk pages on Wikidata to "InvalidArgumentException" for some Property talk pages on Wikidata (Could not load data from the database of entity source: local).Feb 25 2020, 8:16 PM
Lucas_Werkmeister_WMDE set Request URL to https://www.wikidata.org/wiki/Property:P5137.
Lucas_Werkmeister_WMDE set Request ID to XlV74wpAAEMAAAdR3ZoAAADP.
Lucas_Werkmeister_WMDE set Phatality ID to d8fa8633dec14da769b0d6c85009be1fd5b43a79848bcbaeb418c3c013b8390f.

First occurrence in Logstash at 2020-02-24T14:40:09, on Property talk:P443 (pronunciation audio).

Addshore triaged this task as Unbreak Now! priority.Feb 25 2020, 9:51 PM
Addshore added a subscriber: Addshore.
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptFeb 25 2020, 9:51 PM
Jakob_WMDE added a subscriber: Jakob_WMDE.

Looking into it!

It appears that somehow a Sense id is getting passed into a getLabel function in Lua. I'm assuming it has to do with how https://www.wikidata.org/wiki/Module:Property_documentation is formatting the Property usage examples.

Can also be reproduced on some Lua debug console:

=mw.wikibase.getLabel( 'L1-S1' )
[XlZ4zQpAIDMAAFSmgeIAAACL] Caught exception of type InvalidArgumentException

(I haven’t bothered checking Logstash if it’s actually the same InvalidArgumentException.) This reproducer also works on my local wiki and produces the same exception message.

Tarrow claimed this task.Feb 26 2020, 2:11 PM

Stack trace locally looks like:

WikiPageEntityMetaDataLookup.php:206, Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->assertCanHandleEntityId()
WikiPageEntityMetaDataLookup.php:200, Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->assertCanHandleEntityIds()
WikiPageEntityMetaDataLookup.php:86, Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->loadRevisionInformation()
TypeDispatchingWikiPageEntityMetaDataAccessor.php:88, Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor->loadRevisionInformation()
PrefetchingWikiPageEntityMetaDataAccessor.php:267, Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor->doFetch()
PrefetchingWikiPageEntityMetaDataAccessor.php:189, Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor->loadRevisionInformation()
WikiPageEntityRevisionLookup.php:178, Wikibase\Lib\Store\Sql\WikiPageEntityRevisionLookup->getLatestRevisionId()
ByTypeDispatchingEntityRevisionLookup.php:64, Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup->getLatestRevisionId()
CacheRetrievingEntityRevisionLookup.php:158, Wikibase\Lib\Store\CacheRetrievingEntityRevisionLookup->getLatestRevisionId()
CachingEntityRevisionLookup.php:126, Wikibase\Lib\Store\CachingEntityRevisionLookup->getLatestRevisionId()
CacheRetrievingEntityRevisionLookup.php:158, Wikibase\Lib\Store\CacheRetrievingEntityRevisionLookup->getLatestRevisionId()
CachingEntityRevisionLookup.php:126, Wikibase\Lib\Store\CachingEntityRevisionLookup->getLatestRevisionId()
RedirectResolvingLatestRevisionLookup.php:36, Wikibase\Lib\Store\RedirectResolvingLatestRevisionLookup->lookupLatestRevisionResolvingRedirect()
CachingFallbackLabelDescriptionLookup.php:113, Wikibase\Lib\Store\CachingFallbackLabelDescriptionLookup->getTerm()
CachingFallbackLabelDescriptionLookup.php:107, Wikibase\Lib\Store\CachingFallbackLabelDescriptionLookup->getLabel()
UsageTrackingLanguageFallbackLabelDescriptionLookup.php:71, Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup->getLabel()
WikibaseLanguageDependentLuaBindings.php:60, Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageDependentLuaBindings->getLabel()
Scribunto_LuaWikibaseLibrary.php:605, Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary->getLabel()
LuaStandaloneInterpreter.php:387, Scribunto_LuaStandaloneInterpreter->callback()
LuaStandaloneInterpreter.php:358, Scribunto_LuaStandaloneInterpreter->handleCall()
LuaStandaloneInterpreter.php:424, Scribunto_LuaStandaloneInterpreter->dispatch()
LuaStandaloneInterpreter.php:265, Scribunto_LuaStandaloneInterpreter->callFunction()
LuaEngine.php:439, Scribunto_LuaStandaloneEngine->runConsole()
ApiScribuntoConsole.php:102, ApiScribuntoConsole->runConsole()
ApiScribuntoConsole.php:68, ApiScribuntoConsole->execute()
ApiMain.php:1590, ApiMain->executeAction()
ApiMain.php:522, ApiMain->executeActionWithErrorHandling()
ApiMain.php:493, ApiMain->execute()
api.php:84, {main}()

So, I was a little mislead and thought this was mostly about turning on entity federation.

After doing a poor-man's bisect through history it was actually broken by: 8edefdbde63e20329e8fe6fe8ab94c99ed713f8a

Before this instead of using a CachingFallbackLabelDescriptionLookup it was using a LanguageFallbackLabelDescriptionLookup

Change 575308 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/Wikibase@master] DNM: SingleEntitySourceServices to use ByTypeDispatchingEntityRevisionLookup

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

Addshore lowered the priority of this task from Unbreak Now! to High.Feb 28 2020, 10:32 AM

Change 575308 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] SingleEntitySourceServices to use ByTypeDispatchingEntityRevisionLookup

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

We're going to backport the fix later today.

Change 575978 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.21] SingleEntitySourceServices to use ByTypeDispatchingEntityRevisionLookup

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

Checked on beta and doesn't throw any more, just returns nil nil

Tarrow added a comment.Mon, Mar 2, 2:26 PM

We were going to backport this in SWAT but we decided not due to the risk of of some problem. This is due to the fact that during sync each file happens separately and by changing the signature of \Wikibase\DataAccess\SingleEntitySourceServices we'd be sure to create some errors.

If this was only going to impact web requests to Wikidata for the small transient time while the files were out of sync we might be happy to do this but since this changes WikibaseClient.php I'm concerned that this will cause fatals on all wikis during the deployment as well as jobs/api requests.

I think we could consider writing some extra intermediate patches to make it possible to SWAT in but on balance it's probably worth just waiting until Wednesday with the train; what are your thoughts @Lydia_Pintscher

As a temporary workaround, I made the on-wiki module stop showing examples for lexicographical properties (diff), which seems to resolve the issue for all the pages linked in the task description. Someone should revert that once the fix is deployed.

Property talk:P5972 still errors out, even after purge. Oh well… I hope the workaround at least fixed the majority of affected pages, or something like that?

Property talk:P5972 still errors out, even after purge.

The page used {{Property documentation/sandbox}} for testing purposes. I restored it.

Change 575978 abandoned by Addshore:
SingleEntitySourceServices to use ByTypeDispatchingEntityRevisionLookup

Reason:
Going to abandon this as it was not deployed and will not be now (other than with the train)

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

With the train deployed, the page looks fine again to me even without the workaround. Well, more or less.

(Those redlinks point to Lexeme:L2046-S1, Lexeme:L2521-S1, etc.)

Let’s wait a bit longer before reverting the workaround, though, in case the train is rolled back.

Let’s wait a bit longer before reverting the workaround, though, in case the train is rolled back.

The wmf22 train seams stably out, although wmf23 was rolled back on group2 wikis for some reason. Can we revert the workaround?

@matej_suchanek replaced my workaround with a “deeper” one already, so I guess I’ll leave the revert to him.

Reverted. Anything left?

Lucas_Werkmeister_WMDE closed this task as Resolved.Wed, Mar 25, 10:26 AM

I don’t think so.