Page MenuHomePhabricator

Wikidata localisation is broken for units
Closed, ResolvedPublicBUG REPORT

Description

Wikidata localisation seems to be broken on units; also on test.wikidata.org.

Event Timeline

Lydia_Pintscher changed the subtype of this task from "Task" to "Bug Report".
Lydia_Pintscher added subscribers: Ladsgroup, Addshore.

This is a completely different problem than T238473: Label for unit isn't displayed correctly, just Q-number. The data exists:

MariaDB [wikidatawiki_p]> SELECT   wbit_item_id as id,   wby_name as type,   wbxl_language as language,   wbx_text as text FROM wbt_item_terms LEFT JOIN wbt_term_in_lang ON wbit_term_in_lang_id = wbtl_id LEFT JOIN wbt_type ON wbtl_type_id = wby_id LEFT JOIN wbt_text_in_lang ON wbtl_text_in_lang_id = wbxl_id LEFT JOIN wbt_text ON wbxl_text_id = wbx_id WHERE wbit_item_id = 174728 and wbxl_language = 'en';
+--------+-------------+----------+------------------------------------------+
| id     | type        | language | text                                     |
+--------+-------------+----------+------------------------------------------+
| 174728 | label       | en       | centimetre                               |
| 174728 | description | en       | unit of length equal to 1/100 of a metre |
| 174728 | alias       | en       | cm                                       |
| 174728 | alias       | en       | ㎝                                       |
| 174728 | alias       | en       | centimeter                               |
+--------+-------------+----------+------------------------------------------+
5 rows in set (0.18 sec)

I guess caches are working properly? I double check.

The traceback when removing the catch part:

[9fd1ee9b448d3854bf068132] /w2/index.php/Item:Q228 Wikibase\DataModel\Services\Lookup\LabelDescriptionLookupException from line 53 of /var/lib/mediawiki2/extensions/Wikibase/lib/includes/Store/LanguageFallbackLabelDescriptionLookup.php: Unknown entity Q228

Backtrace:

#0 /var/lib/mediawiki2/extensions/Wikibase/lib/includes/Formatters/VocabularyUriFormatter.php(76): Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookup->getLabel(Wikibase\DataModel\Entity\ItemId)
#1 /var/lib/mediawiki2/vendor/data-values/number/src/ValueFormatters/QuantityFormatter.php(261): Wikibase\Lib\Formatters\VocabularyUriFormatter->format(string)
#2 /var/lib/mediawiki2/vendor/data-values/number/src/ValueFormatters/QuantityHtmlFormatter.php(38): ValueFormatters\QuantityFormatter->formatUnit(string)
#3 /var/lib/mediawiki2/vendor/data-values/number/src/ValueFormatters/QuantityFormatter.php(125): ValueFormatters\QuantityHtmlFormatter->formatUnit(string)
#4 /var/lib/mediawiki2/extensions/Wikibase/lib/includes/Formatters/DispatchingValueFormatter.php(75): ValueFormatters\QuantityFormatter->format(DataValues\UnboundedQuantityValue)
#5 /var/lib/mediawiki2/extensions/Wikibase/lib/includes/Formatters/PropertyValueSnakFormatter.php(148): Wikibase\Lib\Formatters\DispatchingValueFormatter->formatValue(DataValues\UnboundedQuantityValue, string)
#6 /var/lib/mediawiki2/extensions/Wikibase/lib/includes/Formatters/PropertyValueSnakFormatter.php(117): Wikibase\Lib\Formatters\PropertyValueSnakFormatter->formatValue(DataValues\UnboundedQuantityValue, string)
#7 /var/lib/mediawiki2/extensions/Wikibase/lib/includes/Formatters/DispatchingSnakFormatter.php(151): Wikibase\Lib\Formatters\PropertyValueSnakFormatter->formatSnak(Wikibase\DataModel\Snak\PropertyValueSnak)
#8 /var/lib/mediawiki2/extensions/Wikibase/lib/includes/Formatters/ErrorHandlingSnakFormatter.php(67): Wikibase\Lib\Formatters\DispatchingSnakFormatter->formatSnak(Wikibase\DataModel\Snak\PropertyValueSnak)
#9 /var/lib/mediawiki2/extensions/Wikibase/view/src/SnakHtmlGenerator.php(129): Wikibase\Lib\Formatters\ErrorHandlingSnakFormatter->formatSnak(Wikibase\DataModel\Snak\PropertyValueSnak)
#10 /var/lib/mediawiki2/extensions/Wikibase/view/src/SnakHtmlGenerator.php(79): Wikibase\View\SnakHtmlGenerator->getFormattedSnakValue(Wikibase\DataModel\Snak\PropertyValueSnak)
#11 /var/lib/mediawiki2/extensions/Wikibase/view/src/StatementHtmlGenerator.php(80): Wikibase\View\SnakHtmlGenerator->getSnakHtml(Wikibase\DataModel\Snak\PropertyValueSnak, boolean)
#12 /var/lib/mediawiki2/extensions/Wikibase/view/src/StatementGroupListView.php(163): Wikibase\View\StatementHtmlGenerator->getHtmlForStatement(Wikibase\DataModel\Statement\Statement, string)
#13 /var/lib/mediawiki2/extensions/Wikibase/view/src/StatementGroupListView.php(145): Wikibase\View\StatementGroupListView->getHtmlForStatementListView(array, string)
#14 /var/lib/mediawiki2/extensions/Wikibase/view/src/StatementGroupListView.php(75): Wikibase\View\StatementGroupListView->getHtmlForStatementGroupView(array, string)
#15 /var/lib/mediawiki2/extensions/Wikibase/view/src/StatementSectionsView.php(71): Wikibase\View\StatementGroupListView->getHtml(array)
#16 /var/lib/mediawiki2/extensions/Wikibase/view/src/ItemView.php(125): Wikibase\View\StatementSectionsView->getHtml(Wikibase\DataModel\Statement\StatementList)
#17 /var/lib/mediawiki2/extensions/Wikibase/view/src/EntityView.php(56): Wikibase\View\ItemView->getMainHtml(Wikibase\DataModel\Entity\Item)
#18 /var/lib/mediawiki2/extensions/Wikibase/view/src/ItemView.php(104): Wikibase\View\EntityView->renderEntityView(Wikibase\DataModel\Entity\Item)
#19 /var/lib/mediawiki2/extensions/Wikibase/repo/includes/ParserOutput/FullEntityParserOutputGenerator.php(233): Wikibase\View\ItemView->getContent(Wikibase\DataModel\Entity\Item, integer)
#20 /var/lib/mediawiki2/extensions/Wikibase/repo/includes/ParserOutput/FullEntityParserOutputGenerator.php(161): Wikibase\Repo\ParserOutput\FullEntityParserOutputGenerator->addHtmlToParserOutput(ParserOutput, Wikibase\Lib\Store\EntityRevision, Wikibase\Lib\Store\EntityInfo)
#21 /var/lib/mediawiki2/extensions/Wikibase/repo/includes/ParserOutput/StatsdTimeRecordingEntityParserOutputGenerator.php(48): Wikibase\Repo\ParserOutput\FullEntityParserOutputGenerator->getParserOutput(Wikibase\Lib\Store\EntityRevision, boolean)
#22 /var/lib/mediawiki2/extensions/Wikibase/repo/includes/Content/EntityContent.php(242): Wikibase\Repo\ParserOutput\StatsdTimeRecordingEntityParserOutputGenerator->getParserOutput(Wikibase\Lib\Store\EntityRevision, boolean)
#23 /var/lib/mediawiki2/extensions/Wikibase/repo/includes/Content/ItemContent.php(234): Wikibase\EntityContent->getParserOutputFromEntityView(integer, ParserOptions, boolean)
#24 /var/lib/mediawiki2/extensions/Wikibase/repo/includes/Content/EntityContent.php(181): Wikibase\ItemContent->getParserOutputFromEntityView(integer, ParserOptions, boolean)
#25 /var/lib/mediawiki2/includes/Revision/RenderedRevision.php(267): Wikibase\EntityContent->getParserOutput(Title, integer, ParserOptions, boolean)
#26 /var/lib/mediawiki2/includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(Wikibase\ItemContent, boolean)
#27 /var/lib/mediawiki2/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#28 /var/lib/mediawiki2/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#29 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#30 /var/lib/mediawiki2/includes/Revision/RenderedRevision.php(198): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#31 /var/lib/mediawiki2/includes/poolcounter/PoolWorkArticleView.php(196): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#32 /var/lib/mediawiki2/includes/poolcounter/PoolCounterWork.php(125): PoolWorkArticleView->doWork()
#33 /var/lib/mediawiki2/includes/page/Article.php(811): PoolCounterWork->execute()
#34 /var/lib/mediawiki2/extensions/Wikibase/repo/includes/Actions/ViewEntityAction.php(79): Article->view()
#35 /var/lib/mediawiki2/extensions/Wikibase/repo/includes/Actions/ViewEntityAction.php(54): Wikibase\ViewEntityAction->showEntityPage()
#36 /var/lib/mediawiki2/includes/MediaWiki.php(519): Wikibase\ViewEntityAction->show()
#37 /var/lib/mediawiki2/includes/MediaWiki.php(305): MediaWiki->performAction(Article, Title)
#38 /var/lib/mediawiki2/includes/MediaWiki.php(973): MediaWiki->performRequest()
#39 /var/lib/mediawiki2/includes/MediaWiki.php(535): MediaWiki->main()
#40 /var/lib/mediawiki2/index.php(47): MediaWiki->run()
#41 {main}

Change 581644 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Fix 'max' to Int32EntityId::MAX conversion

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

Change 581674 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.24] Fix 'max' to Int32EntityId::MAX conversion

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

Change 581644 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fix 'max' to Int32EntityId::MAX conversion

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

Change 581674 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.24] Fix 'max' to Int32EntityId::MAX conversion

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

Mentioned in SAL (#wikimedia-operations) [2020-03-19T18:24:31Z] <ladsgroup@deploy1001> Synchronized php-1.35.0-wmf.24/extensions/Wikibase/data-access/src/SingleEntitySourceServices.php: [[gerrit:581674|Fix 'max' to Int32EntityId::MAX conversion (T247985)]], part I (duration: 01m 08s)

Mentioned in SAL (#wikimedia-operations) [2020-03-19T18:30:56Z] <ladsgroup@deploy1001> Synchronized php-1.35.0-wmf.24/extensions/Wikibase/lib/includes/Store/ByIdDispatchingEntityInfoBuilder.php: [[gerrit:581674|Fix 'max' to Int32EntityId::MAX conversion (T247985)]], part II (duration: 01m 07s)

This is fixed now, if you still see it please purge the page (action=purge) and if it's still happening, comment here.