Page MenuHomePhabricator

Exception: Table 'enwiki.wb_items_per_site' doesn't exist
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

On every page on a number of beta wikis (I guess those which have Wikibase?), you see the exception:

[YIp1J7nigq-MNnno3cbqsAAAAAs] /wiki/Main_Page Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Error 1146: Table 'enwiki.wb_items_per_site' doesn't exist (172.16.6.39:3306)
Function: Wikibase\Lib\Store\Sql\SiteLinkTable::getItemIdForLink
Query: SELECT ips_item_id FROM `wb_items_per_site` WHERE ips_site_id = 'enwiki' AND ips_site_page = 'Main Page' LIMIT 1

Backtrace:

from /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1738)
#0 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1722): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1697): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#2 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1260): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#3 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1948): Wikimedia\Rdbms\Database->query(string, string, integer)
#4 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(2048): Wikimedia\Rdbms\Database->select(string, array, array, string, array, array)
#5 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->selectRow(string, array, array, string)
#6 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(331): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#7 /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/Sql/SiteLinkTable.php(253): Wikimedia\Rdbms\DBConnRef->selectRow(string, array, array, string)
#8 /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/CachingSiteLinkLookup.php(147): Wikibase\Lib\Store\Sql\SiteLinkTable->getItemIdForLink(string, string)
#9 /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/CachingSiteLinkLookup.php(75): Wikibase\Lib\Store\CachingSiteLinkLookup->getAndCacheItemIdForLink(string, string)
#10 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/SiteLinksForDisplayLookup.php(76): Wikibase\Lib\Store\CachingSiteLinkLookup->getItemIdForLink(string, string)
#11 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/LangLinkHandler.php(269): Wikibase\Client\Hooks\SiteLinksForDisplayLookup->getSiteLinksForPageTitle(Title)
#12 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/LangLinkHandler.php(290): Wikibase\Client\Hooks\LangLinkHandler->getEffectiveRepoLinks(Title, ParserOutput)
#13 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandler.php(101): Wikibase\Client\Hooks\LangLinkHandler->addLinksFromRepository(Title, ParserOutput)
#14 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandler.php(83): Wikibase\Client\Hooks\ParserOutputUpdateHookHandler->doContentAlterParserOutput(Title, ParserOutput)
#15 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(160): Wikibase\Client\Hooks\ParserOutputUpdateHookHandler->onContentAlterParserOutput(WikitextContent, Title, ParserOutput)
#16 /srv/mediawiki/php-master/includes/HookContainer/HookRunner.php(1273): MediaWiki\HookContainer\HookContainer->run(string, array)
#17 /srv/mediawiki/php-master/includes/content/AbstractContent.php(595): MediaWiki\HookContainer\HookRunner->onContentAlterParserOutput(WikitextContent, Title, ParserOutput)
#18 /srv/mediawiki/php-master/includes/Revision/RenderedRevision.php(266): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#19 /srv/mediawiki/php-master/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#20 /srv/mediawiki/php-master/includes/Revision/RevisionRenderer.php(217): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#21 /srv/mediawiki/php-master/includes/Revision/RevisionRenderer.php(154): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#22 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#23 /srv/mediawiki/php-master/includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#24 /srv/mediawiki/php-master/includes/poolcounter/PoolWorkArticleView.php(137): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#25 /srv/mediawiki/php-master/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()
#26 /srv/mediawiki/php-master/includes/page/ParserOutputAccess.php(281): PoolCounterWork->execute()
#27 /srv/mediawiki/php-master/includes/page/Article.php(763): MediaWiki\Page\ParserOutputAccess->getParserOutput(WikiPage, ParserOptions, MediaWiki\Revision\RevisionStoreCacheRecord, integer)
#28 /srv/mediawiki/php-master/includes/page/Article.php(575): Article->generateContentOutput(User, ParserOptions, integer, OutputPage, array)
#29 /srv/mediawiki/php-master/includes/actions/ViewAction.php(74): Article->view()
#30 /srv/mediawiki/php-master/includes/MediaWiki.php(535): ViewAction->show()
#31 /srv/mediawiki/php-master/includes/MediaWiki.php(319): MediaWiki->performAction(Article, Title)
#32 /srv/mediawiki/php-master/includes/MediaWiki.php(916): MediaWiki->performRequest()
#33 /srv/mediawiki/php-master/includes/MediaWiki.php(550): MediaWiki->main()
#34 /srv/mediawiki/php-master/index.php(53): MediaWiki->run()
#35 /srv/mediawiki/php-master/index.php(46): wfIndexMain()
#36 /srv/mediawiki/w/index.php(3): require(string)
#37 {main}

This means beta is unusable (so far as I have been able to make out).

Steps to reproduce problem

Visit one of the below:

Environment

Wiki(s): MediaWiki 1.37.0-alpha (5278aae) 07:41, 29 April 2021; WikibaseClient – (83c0c4f) 06:55, 29 April 2021; WikibaseLexeme – (231a777) 17:09, 28 April 2021.

Event Timeline

Aren't those supposed to exist on wikidatawiki and not on enwiki?

wikiadmin@172.16.6.39(enwiki)> show tables like 'wb%';
+------------------------+
| Tables_in_enwiki (wb%) |
+------------------------+
| wbc_entity_usage       |
+------------------------+
1 row in set (0.00 sec)

wikiadmin@172.16.6.39(wikidatawiki)> show tables like 'wb%';
+------------------------------+
| Tables_in_wikidatawiki (wb%) |
+------------------------------+
| wb_changes                   |
| wb_changes_dispatch          |
| wb_changes_subscription      |
| wb_id_counters               |
| wb_items_per_site            |
| wb_property_info             |
| wbc_entity_usage             |
| wbq_violations               |
| wbqc_constraints             |
| wbs_propertypairs            |
| wbt_item_terms               |
| wbt_property_terms           |
| wbt_term_in_lang             |
| wbt_text                     |
| wbt_text_in_lang             |
| wbt_type                     |
+------------------------------+
16 rows in set (0.01 sec)

Treating as a software bug and not a betacluster infrastructure one, this is a blocker for next train

Slight note, mobile view works fine

Slight note, mobile view works fine

Really? It does not work for me. I still see the error and cannot successfully edit pages.

By mobile view, I assume you mean https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Main_Page