Page MenuHomePhabricator

SiteMatrix API returns unexpected null for 'wiki.url' field of Wikipedia project
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/#/c/225287/ has exposed some strangeness around SiteMatrix and MediaWiki's wgConf - in https://es.wikipedia.org/w/api.php?action=sitematrix&format=jsonfm "url" and "sitename" are null for wikipedias.

> var_dump( $wgConf->get( 'wgCanonicalServer', 'eswiki', 'wiki', array( 'lang' => 'es', 'site' => 'wiki' ) ) ); // What SiteMatrix would be doing
NULL

> var_dump( $wgConf->get( 'wgCanonicalServer', 'eswiki', 'wikipedia', array( 'lang' => 'es', 'site' => 'wiki' ) ) ); // Whereas this actually works
string(24) "https://es.wikipedia.org"

Spotted by @Sitic

Event Timeline

Krenair created this task.Jul 25 2015, 9:41 PM
Krenair updated the task description. (Show Details)
Krenair raised the priority of this task from to High.
Krenair added subscribers: Krenair, Sitic.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 25 2015, 9:41 PM

Do we just need to change "wiki" --> "wikipedia" in SiteMatrix's extension.json? My hunch is this is a regression from rMWbc2915b7220e: Attempt to remove a hard-coded "wikipedia". that was masked by the default value until now.

I tried that on mw1017 earlier, breaks other things, probably because it's also used as the database name suffix.

Change 227065 had a related patch set uploaded (by Legoktm):
"wiki" → "wikipedia"

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

Mjbmr set Security to None.Jul 26 2015, 10:20 AM
Mjbmr added a subscriber: Mjbmr.
coren claimed this task.Jul 27 2015, 6:05 PM
coren removed coren as the assignee of this task.Jul 27 2015, 6:28 PM
coren added a subscriber: coren.
Krinkle renamed this task from SiteMatrix returning null for wikipedia canonical URLs and site names to SiteMatrix API returns unexpected null for 'wiki.url' field of Wikipedia project.Jul 27 2015, 6:46 PM
Krinkle raised the priority of this task from High to Unbreak Now!.
Krinkle added a project: Regression.

This is causing Global SUL to throw a runtime exception because wikiObj.url is null instead of a string. As such it is unable to establish an HTTP connection to any Wikipedia domain.

This also breaks Synchbot, which has been disabled until this is fixed.

As per discussion with @Legoktm and @Krinkle, I'm going to re-add the default=wikipedia lines temporarily, until we can get this properly fixed. But this is not going to be closed until it is fixed properly.

Change 227273 had a related patch set uploaded (by Alex Monk):
Re-add default=wikipedia lines to wgCanonicalServer and wgSitename

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

Change 227273 merged by jenkins-bot:
Re-add default=wikipedia lines to wgCanonicalServer and wgSitename

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

There's still other broken things in SiteMatrix. E.g. the sitename is now all completely "Wikipedia" (it was null before the above commit), even for non-wikipedias. If you change SiteMatrix::getSitename to include $major as the third (optional) parameter to $wgConf->get, it gives you all of the English sitenames of the project. Which is better, but not by much.

Reedy added a subscriber: aude.
Reedy added a subscriber: Reedy.

Change 227350 had a related patch set (by Aude) published:
Fix loading of canonical url and site name settings

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

Change 227350 had a related patch set uploaded (by Reedy):
Fix loading of canonical url and site name settings

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

Change 227350 merged by jenkins-bot:
Fix loading of canonical url and site name settings

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

Change 227379 had a related patch set uploaded (by Alex Monk):
Fix loading of canonical url and site name settings

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

Change 227379 merged by jenkins-bot:
Fix loading of canonical url and site name settings

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

Krenair assigned this task to aude.Jul 28 2015, 12:36 AM
Krenair closed this task as Resolved.

Change 227065 abandoned by Legoktm:
"wiki" → "wikipedia"

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