Page MenuHomePhabricator

Vagrant first provision with wikibase and CirrusSearch causes 1146 Table 'wikidatawiki.wb_items_per_site' doesn't exist
Open, Needs TriagePublic

Description

==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: Wikimedia\Rdbms\DBQueryError from line 1591 of /vagrant/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: Query: SELECT  ips_item_id  FROM `wb_items_per_site`    WHERE ips_site_id = 'enwiki' AND ips_site_page = 'Main Page'  LIMIT 1  
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: Function: Wikimedia\Rdbms\Database::selectRow
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: Error: 1146 Table 'wikidatawiki.wb_items_per_site' doesn't exist (127.0.0.1)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: 
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #0 /vagrant/mediawiki/includes/libs/rdbms/database/Database.php(1562): Wikimedia\Rdbms\Database->getQueryExceptionAndLog('Table 'wikidata...', 1146, 'SELECT  ips_ite...', 'Wikimedia\\Rdbms...')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #1 /vagrant/mediawiki/includes/libs/rdbms/database/Database.php(1150): Wikimedia\Rdbms\Database->reportQueryError('Table 'wikidata...', 1146, 'SELECT  ips_ite...', 'Wikimedia\\Rdbms...', false)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #2 /vagrant/mediawiki/includes/libs/rdbms/database/Database.php(1794): Wikimedia\Rdbms\Database->query('SELECT  ips_ite...', 'Wikimedia\\Rdbms...')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #3 /vagrant/mediawiki/includes/libs/rdbms/database/Database.php(1886): Wikimedia\Rdbms\Database->select('wb_items_per_si...', Array, Array, 'Wikimedia\\Rdbms...', Array, Array)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #4 /vagrant/mediawiki/extensions/Wikibase/lib/includes/Store/Sql/SiteLinkTable.php(266): Wikimedia\Rdbms\Database->selectRow('wb_items_per_si...', Array, Array)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #5 /vagrant/mediawiki/extensions/Wikibase/lib/includes/Store/CachingSiteLinkLookup.php(147): Wikibase\Lib\Store\Sql\SiteLinkTable->getItemIdForLink('enwiki', 'Main Page')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #6 /vagrant/mediawiki/extensions/Wikibase/lib/includes/Store/CachingSiteLinkLookup.php(75): Wikibase\Lib\Store\CachingSiteLinkLookup->getAndCacheItemIdForLink('enwiki', 'Main Page')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #7 /vagrant/mediawiki/extensions/Wikibase/client/includes/LangLinkHandler.php(101): Wikibase\Lib\Store\CachingSiteLinkLookup->getItemIdForLink('enwiki', 'Main Page')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #8 /vagrant/mediawiki/extensions/Wikibase/client/includes/LangLinkHandler.php(331): Wikibase\Client\LangLinkHandler->getEntityLinks(Object(Title))
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #9 /vagrant/mediawiki/extensions/Wikibase/client/includes/LangLinkHandler.php(352): Wikibase\Client\LangLinkHandler->getEffectiveRepoLinks(Object(Title), Object(ParserOutput))
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #10 /vagrant/mediawiki/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandlers.php(97): Wikibase\Client\LangLinkHandler->addLinksFromRepository(Object(Title), Object(ParserOutput))
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #11 /vagrant/mediawiki/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandlers.php(65): Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers->doContentAlterParserOutput(Object(Title), Object(ParserOutput))
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #12 /vagrant/mediawiki/includes/Hooks.php(174): Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers::onContentAlterParserOutput(Object(WikitextContent), Object(Title), Object(ParserOutput))
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #13 /vagrant/mediawiki/includes/Hooks.php(202): Hooks::callHook('ContentAlterPar...', Array, Array, NULL)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #14 /vagrant/mediawiki/includes/content/AbstractContent.php(559): Hooks::run('ContentAlterPar...', Array)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #15 /vagrant/mediawiki/includes/Revision/RenderedRevision.php(265): AbstractContent->getParserOutput(Object(Title), 1, Object(ParserOptions), true)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #16 /vagrant/mediawiki/includes/Revision/RenderedRevision.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(Object(WikitextContent), true)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #17 /vagrant/mediawiki/includes/Revision/RevisionRenderer.php(214): MediaWiki\Revision\RenderedRevision->getSlotParserOutput('main')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #18 /vagrant/mediawiki/includes/Revision/RevisionRenderer.php(151): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(Object(MediaWiki\Revision\RenderedRevision), Array)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #19 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(Object(MediaWiki\Revision\RenderedRevision), Array)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #20 /vagrant/mediawiki/includes/Revision/RenderedRevision.php(197): call_user_func(Object(Closure), Object(MediaWiki\Revision\RenderedRevision), Array)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #21 /vagrant/mediawiki/includes/content/ContentHandler.php(1367): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #22 /vagrant/mediawiki/extensions/CirrusSearch/includes/Updater.php(377): ContentHandler->getParserOutputForIndexing(Object(WikiPage), Object(ParserCache))
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #23 /vagrant/mediawiki/extensions/CirrusSearch/includes/Updater.php(458): CirrusSearch\Updater::buildDocument(Object(CirrusSearch\CirrusSearch), Object(WikiPage), Object(CirrusSearch\Connection), 0, 0, 4)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #24 /vagrant/mediawiki/extensions/CirrusSearch/includes/Updater.php(236): CirrusSearch\Updater->buildDocumentsForPages(Array, 5)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #25 /vagrant/mediawiki/extensions/CirrusSearch/maintenance/forceSearchIndex.php(219): CirrusSearch\Updater->updatePages(Array, 5)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #26 /vagrant/mediawiki/extensions/CirrusSearch/tests/jenkins/cleanSetup.php(45): CirrusSearch\ForceSearchIndex->execute()
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #27 /vagrant/mediawiki/maintenance/update.php(217): CirrusSearch\Jenkins\CleanSetup->execute()
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #28 /vagrant/mediawiki/maintenance/doMaintenance.php(99): UpdateMediaWiki->execute()
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #29 /vagrant/mediawiki/maintenance/update.php(277): require_once('/vagrant/mediaw...')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #30 /var/www/w/MWScript.php(98): require_once('/vagrant/mediaw...')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #31 {main}

Workaround: run vagrant provision a second time

Event Timeline

dcausse created this task.Aug 29 2019, 9:45 AM
Restricted Application added projects: Wikidata, Discovery-Search. · View Herald TranscriptAug 29 2019, 9:45 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tgr added a subscriber: Tgr.Aug 29 2019, 2:04 PM

IIRC this happens when Wikibase server code is loaded for a client wiki. I tried to sort that apart in gerrit 524617 but maybe didn't fully succeed.

(Note that enabling roles before the very first provisioning of a new Vagrant box is not really supported, in that almost no one ever tests it.)