Page MenuHomePhabricator

In CI, local wiki ID is not found in the sites table
Closed, DuplicatePublic

Description

Example: https://integration.wikimedia.org/ci/job/mwext-mw-selenium-composer/2033/artifact/log/mw-error.log/*view*/

2016-03-03 18:31:07 integration-slave-trusty-1006 jenkins_u1_mw: [e812b46f] /jenkins-mwext-mw-selenium-composer-2033/index.php/Special:BlankPage
ErrorException from line 300 of /mnt/jenkins-workspace/workspace/mwext-mw-selenium-composer/src/includes/debug/MWDebug.php:
PHP Notice: Cannot find site jenkins_u1_mw in sites table [Called from Wikibase\Client\WikibaseClient::newSiteGroup
in /mnt/jenkins-workspace/workspace/mwext-mw-selenium-composer/src/extensions/Wikibase/client/includes/WikibaseClient.php at line 611]

One possible fix would be T126596: During update.php (and install), add an entry in the sites table / SiteStore for the local wiki. However, the problem should not arise at all: WikibaseClinet::newSiteGroup() loks for the siteGroup setting. If it's not there, it looks for the siteGlobalID setting, and tries to look up the local wiki in the sites table based on that ID. So, we should be able to fix this by:

  • making site siteGroup is set for CI runs. Adding it to WikibaseClient.example.php should be sufficient. It's however unclear if should really be set in the exampe settings. Typical installs should not have this set.
  • making siteGlobalID something that can actually be found in the sites table. According to WikibaseClient.example.php, siteGlobalID should be "mywiki". However, this does not seem to be the case, since we find this in the logs:

    [Wikibase\SettingsArray] getSetting: setting siteGlobalID was given as a closure, resolve it to 'jenkins_u1_mw'

(from https://integration.wikimedia.org/ci/job/mwext-mw-selenium-composer/2033/artifact/log/mw-debug-www.log)

That would indicate that no example settings got loaded, and the extension is relying on default setting alone.

Investigation is needed to determine what is actually happening, and how to best fix it.

Event Timeline

daniel created this task.Mar 3 2016, 7:52 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 3 2016, 7:52 PM
daniel triaged this task as High priority.Mar 3 2016, 7:52 PM
daniel added subscribers: aude, JanZerebecki.

Bumping to high, since this happens for all repos that run tests against wikibase, some of which fail on warning like this.

daniel added a comment.Mar 3 2016, 8:26 PM

I tried adding the group in https://gerrit.wikimedia.org/r/#/c/274792/ with no effect. It seems like example settings are not loaded by the mwext-mw-selenium-composer job.

daniel added a comment.Mar 3 2016, 8:37 PM

Verified that the top level entry point (Wikibase.php) gets loaded by putting die() at the top of the file: https://gerrit.wikimedia.org/r/#/c/274792/2

daniel added a comment.Mar 3 2016, 8:59 PM

Verified that the top level entry point (Wikibase.php) goes into the branch that has

require_once __DIR__ . '/client/ExampleSettings.php';

see https://gerrit.wikimedia.org/r/#/c/274792/3

So apparently, the mwext-mw-selenium-composer job doesn't hit the die() in WikibaseClient.example.php, even though the branch that should include the example settings does get hit. What the hell?

See https://gerrit.wikimedia.org/r/#/c/274792/4

daniel added a comment.Mar 4 2016, 9:18 AM

Oh duh!

From WikibaseClient.example.php:

  // NOTE: If this wiki also runs the Wikibase repo extension,
  //       stop and just use the defaults for settings.
  if ( defined( 'WB_VERSION' ) ) {
	  return;
  }

Change 274792 had a related patch set uploaded (by Daniel Kinzler):
Provide config ovberrides for Jenkins

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

JanZerebecki lowered the priority of this task from High to Low.Mar 4 2016, 2:20 PM

No job know to me fails because of this notice. Please change and add a link if you know of one.

daniel added a comment.Mar 4 2016, 2:44 PM

No job know to me fails because of this notice. Please change and add a link if you know of one.

@Krinkle can you explain again why this is blocking you?

Change 274792 merged by jenkins-bot:
Add a config override for siteGroup

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

Bene moved this task from Review to Done on the Wikidata-Sprint-2016-03-01 board.Mar 8 2016, 10:24 AM