Page MenuHomePhabricator

Running update.php fails
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Start with a clean, empty Mediawiki install
  • Enable Wikibase in LocalSettings.php
  • Set $wgWBRepoSettings['federatedPropertiesEnabled'] = true;
  • Run php update.php

Work Around

  • set up as above
  • Set $wgWBRepoSettings['federatedPropertiesEnabled'] = false;
  • Run php update.php
  • Set $wgWBRepoSettings['federatedPropertiesEnabled'] = true;
  • Run php update.php

What happens?:
[5f9ec436b7b226e031b69051] [no req] Error: Call to a member function getSourceName() on null
Backtrace:
from /var/www/html/w/extensions/Wikibase/repo/includes/Store/Sql/DatabaseSchemaUpdater.php(171)
#0 /var/www/html/w/includes/installer/DatabaseUpdater.php(533): Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::rebuildPropertyTerms(MysqlUpdater)
#1 /var/www/html/w/includes/installer/DatabaseUpdater.php(501): DatabaseUpdater->runUpdates(array, boolean)
#2 /var/www/html/w/maintenance/update.php(193): DatabaseUpdater->doUpdates(array)
#3 /var/www/html/w/maintenance/doMaintenance.php(108): UpdateMediaWiki->execute()
#4 /var/www/html/w/maintenance/update.php(264): require_once(string)
#5 {main}

What should have happened instead?:
update.php should have exited successfully

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
Wikibase - 3239a0ce72719bf808af42a8988b441c13abb771

Event Timeline

Tarrow updated the task description. (Show Details)

@Jakob_WMDE correctly identified that:

so the example settings contain an entity source config for local items and properties. with $wgWBRepoSettings['federatedPropertiesEnabled'] = true; FederatedPropertiesEntitySourceDefinitionsConfigParser unsets the local property source and turns it into a fed prop source (an API source) which is why getDatabaseSourceForEntityType comes back empty

Looks like extensions/Wikibase/repo/includes/FederatedProperties/FederatedPropertiesEntitySourceDefinitionsConfigParser.php:87 is doing the wrong thing and always unsetting the db source. Of course this only happens with the default setting of sourceScriptUrl !== 'https://www.wikidata.org/w/'

Change 711128 had a related patch set uploaded (by Tarrow; author: Tarrow):

[mediawiki/extensions/Wikibase@master] Introduce and use DefaultFederatedPropertiesEntitySourceAdder

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

Change 711128 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Introduce and use DefaultFederatedPropertiesEntitySourceAdder

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