Page MenuHomePhabricator

Form ID “does not implement Int32EntityId” error in TermSqlIndex when rendering some constraint violation messages
Closed, ResolvedPublicPRODUCTION ERROR

Description

TermSqlIndex no longer uses numeric entity IDs (T188995), but it still asserts that entity IDs are numeric in some places, leading to unnecessary log errors like this one:

Entity ID: L123-F1 does not implement Int32EntityId
#0 /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/lib/includes/Store/Sql/TermSqlIndex.php(573): Wikibase\Lib\Store\Sql\TermSqlIndex->assertIsNumericEntityId(Wikibase\Lexeme\DataModel\FormId)
#1 /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/lib/includes/Store/Sql/TermSqlIndex.php(539): Wikibase\Lib\Store\Sql\TermSqlIndex->fetchTerms(array, array, array)
#2 /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/lib/includes/Store/BufferingTermLookup.php(139): Wikibase\Lib\Store\Sql\TermSqlIndex->getTermsOfEntities(array, array, array)
#3 /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/lib/includes/Store/DispatchingTermBuffer.php(87): Wikibase\Store\BufferingTermLookup->prefetchTerms(array, array, array)
#4 /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/lib/includes/Store/DispatchingTermBuffer.php(43): Wikibase\Lib\Store\DispatchingTermBuffer->prefetchTerms(array, array, array)
#5 /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/lib/includes/Store/EntityTermLookupBase.php(46): Wikibase\Lib\Store\DispatchingTermBuffer->getTermsOfType(Wikibase\Lexeme\DataModel\FormId, string, array)
#6 /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/lib/includes/Store/LanguageFallbackLabelDescriptionLookup.php(48): Wikibase\Lib\Store\EntityTermLookupBase->getLabels(Wikibase\Lexeme\DataModel\FormId, array)
#7 /srv/mediawiki/php-1.32.0-wmf.5/vendor/wikibase/data-model-services/src/EntityId/EntityIdLabelFormatter.php(55): Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookup->getLabel(Wikibase\Lexeme\DataModel\FormId)
#8 /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/lib/includes/Formatters/EntityIdHtmlLinkFormatter.php(64): Wikibase\DataModel\Services\EntityId\EntityIdLabelFormatter->lookupEntityLabel(Wikibase\Lexeme\DataModel\FormId)
#9 /srv/mediawiki/php-1.32.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Message/ViolationMessageRenderer.php(215): Wikibase\Lib\EntityIdHtmlLinkFormatter->formatEntityId(Wikibase\Lexeme\DataModel\FormId)
#10 /srv/mediawiki/php-1.32.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Message/ViolationMessageRenderer.php(142): WikibaseQuality\ConstraintReport\ConstraintCheck\Message\ViolationMessageRenderer->renderEntityId(Wikibase\Lexeme\DataModel\FormId, string)
#11 /srv/mediawiki/php-1.32.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Message/ViolationMessageRenderer.php(85): WikibaseQuality\ConstraintReport\ConstraintCheck\Message\ViolationMessageRenderer->renderArgument(array)
#12 /srv/mediawiki/php-1.32.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Message/MultilingualTextViolationMessageRenderer.php(60): WikibaseQuality\ConstraintReport\ConstraintCheck\Message\ViolationMessageRenderer->render(WikibaseQuality\ConstraintReport\ConstraintCheck\Message\ViolationMessage)
#13 /srv/mediawiki/php-1.32.0-wmf.5/extensions/WikibaseQualityConstraints/src/Api/CheckResultsRenderer.php(103): WikibaseQuality\ConstraintReport\ConstraintCheck\Message\MultilingualTextViolationMessageRenderer->render(WikibaseQuality\ConstraintReport\ConstraintCheck\Message\ViolationMessage)
#14 /srv/mediawiki/php-1.32.0-wmf.5/extensions/WikibaseQualityConstraints/src/Api/CheckResultsRenderer.php(65): WikibaseQuality\ConstraintReport\Api\CheckResultsRenderer->checkResultToArray(WikibaseQuality\ConstraintReport\ConstraintCheck\Result\CheckResult)
#15 /srv/mediawiki/php-1.32.0-wmf.5/extensions/WikibaseQualityConstraints/src/Api/CheckConstraints.php(266): WikibaseQuality\ConstraintReport\Api\CheckResultsRenderer->render(WikibaseQuality\ConstraintReport\ConstraintCheck\Cache\CachedCheckResults)
#16 /srv/mediawiki/php-1.32.0-wmf.5/includes/api/ApiMain.php(1579): WikibaseQuality\ConstraintReport\Api\CheckConstraints->execute()
#17 /srv/mediawiki/php-1.32.0-wmf.5/includes/api/ApiMain.php(535): ApiMain->executeAction()
#18 /srv/mediawiki/php-1.32.0-wmf.5/includes/api/ApiMain.php(506): ApiMain->executeActionWithErrorHandling()
#19 /srv/mediawiki/php-1.32.0-wmf.5/api.php(83): ApiMain->execute()
#20 /srv/mediawiki/w/api.php(3): include(string)
#21 {main}

In this case, it happens when attempting to render a form ID in a WBQC ViolationMessage for a “inverse” constraint (attempting to render the form ID “L123-F1” as the expected value of the inverse statement), but I suspect it might be possible to trigger this error in some other edge cases as well.

Event Timeline

Change 435998 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Remove numeric entity ID assertions from TermSqlIndex

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

Change 435998 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Remove numeric entity ID assertions from TermSqlIndex

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

Ladsgroup assigned this task to Lucas_Werkmeister_WMDE.
Ladsgroup moved this task from incoming to in progress on the Wikidata board.
Ladsgroup moved this task from Incoming to Done on the Wikidata-Campsite board.
Ladsgroup subscribed.

logsatsh is clean

Vvjjkkii renamed this task from Form ID “does not implement Int32EntityId” error in TermSqlIndex when rendering some constraint violation messages to a3baaaaaaa.Jul 1 2018, 1:07 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Lucas_Werkmeister_WMDE as the assignee of this task.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from a3baaaaaaa to Form ID “does not implement Int32EntityId” error in TermSqlIndex when rendering some constraint violation messages.Jul 2 2018, 3:26 PM
CommunityTechBot closed this task as Resolved.
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM