Page MenuHomePhabricator

Wikidata issues break addWiki.php for 'wikimedia' sites
Closed, ResolvedPublic

Description

Exception encountered, of type "Wikibase\Client\Usage\UsageTrackerException"
[2e25ac28] [no req]   Wikibase\Client\Usage\UsageTrackerException from line 155 of /srv/mediawiki-staging/php-1.27.0-wmf.9/extensions/Wikidata/extensions/Wikibase/client/includes/Usage/Sql/SqlUsageTracker.php: A database error has occurred. Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: SELECT  eu_aspect,eu_entity_id  FROM `wbc_entity_usage`   WHERE eu_page_id = '1' AND (eu_touched >= '00000000000000')  
Function: Wikibase\Client\Usage\Sql\EntityUsageTable::queryUsages
Error: 1146 Table 'wikimania2017wiki.wbc_entity_usage' doesn't exist (10.64.16.27)

Backtrace:
#0 /srv/mediawiki-staging/php-1.27.0-wmf.9/extensions/Wikidata/extensions/Wikibase/client/includes/store/UsageUpdater.php(81): Wikibase\Client\Usage\Sql\SqlUsageTracker->trackUsedEntities(integer, array, string)
#1 /srv/mediawiki-staging/php-1.27.0-wmf.9/extensions/Wikidata/extensions/Wikibase/client/includes/Hooks/DataUpdateHookHandlers.php(147): Wikibase\Client\Store\UsageUpdater->addUsagesForPage(integer, array, string)
#2 /srv/mediawiki-staging/php-1.27.0-wmf.9/extensions/Wikidata/extensions/Wikibase/client/includes/Hooks/DataUpdateHookHandlers.php(61): Wikibase\Client\Hooks\DataUpdateHookHandlers->doLinksUpdateComplete(LinksUpdate)
#3 [internal function]: Wikibase\Client\Hooks\DataUpdateHookHandlers::onLinksUpdateComplete(LinksUpdate)
#4 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/Hooks.php(195): call_user_func_array(string, array)
#5 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/deferred/LinksUpdate.php(148): Hooks::run(string, array)
#6 [internal function]: {closure}()
#7 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/db/Database.php(3310): call_user_func(Closure)
#8 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/db/Database.php(3271): DatabaseBase->runOnTransactionIdleCallbacks()
#9 [internal function]: DatabaseBase->onTransactionIdle(Closure)
#10 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/db/DBConnRef.php(39): call_user_func_array(array, array)
#11 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/db/DBConnRef.php(417): DBConnRef->__call(string, array)
#12 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/deferred/LinksUpdate.php(149): DBConnRef->onTransactionIdle(Closure)
#13 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/deferred/DataUpdate.php(99): LinksUpdate->doUpdate()
#14 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/deferred/DeferredUpdates.php(147): DataUpdate::runUpdates(array, string)
#15 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/deferred/DeferredUpdates.php(88): DeferredUpdates::execute(array, string)
#16 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/deferred/DeferredUpdates.php(123): DeferredUpdates::doUpdates()
#17 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/deferred/DeferredUpdates.php(59): DeferredUpdates::push(array, LinksUpdate)
#18 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/page/WikiPage.php(2238): DeferredUpdates::addUpdate(LinksUpdate)
#19 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/page/WikiPage.php(2000): WikiPage->doEditUpdates(Revision, User, array)
#20 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/page/WikiPage.php(1737): WikiPage->doCreate(WikitextContent, integer, User, string, array)
#21 /srv/mediawiki-staging/php-1.27.0-wmf.9/includes/page/WikiPage.php(1611): WikiPage->doEditContent(WikitextContent, string, integer, boolean, NULL)
#22 /srv/mediawiki-staging/php-1.27.0-wmf.9/extensions/WikimediaMaintenance/addWiki.php(188): WikiPage->doEdit(string, string, integer)
#23 /srv/mediawiki-staging/php-1.27.0-wmf.9/maintenance/doMaintenance.php(103): AddWiki->execute()
#24 /srv/mediawiki-staging/php-1.27.0-wmf.9/extensions/WikimediaMaintenance/addWiki.php(269): require_once(string)
#25 /srv/mediawiki-staging/multiversion/MWScript.php(97): require_once(string)
#26 {main}

Did someone add an extra table dependency without making sure it gets created by addWiki?

Event Timeline

Krenair raised the priority of this task from to High.
Krenair updated the task description. (Show Details)
Krenair subscribed.
Krenair renamed this task from Wikidata issues break addWiki.php to Wikidata issues break addWiki.php for 'wikimedia' sites.Feb 4 2016, 7:56 PM
Krenair set Security to None.

the table is added depending on what site group the site is:

https://github.com/wikimedia/mediawiki-extensions-WikimediaMaintenance/blob/master/addWiki.php#L131-L133

now I look at it, I think check is flawed. in this context, wikimania2017wiki would be considered in the 'wikipedia' site group. I think we can improve the way this check is done.

Change 268710 had a related patch set uploaded (by Aude):
Add wbc_entity_usage table if wiki is in wikidataclient.dblist

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

Change 268710 merged by jenkins-bot:
Add wbc_entity_usage table if wiki is in wikidataclient.dblist

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

Krenair claimed this task.

That should fix it