Page MenuHomePhabricator

[BUG] ZeroConfig broke parsing of configuration
Closed, ResolvedPublicBUG REPORT

Description

Warning: JsonConfig: Invalid $wgJsonConfigs['JsonZeroConfig']['remote']['url']: API URL is not set, and this config is not being stored locally [Called from JsonConfig\JCSingleton::parseConfiguration in /srv/mediawiki/php-1.28.0-wmf.22/extensions/JsonConfig/includes/JCSingleton.php at line 147] in /srv/mediawiki/php-1.28.0-wmf.22/includes/debug/MWDebug.php on line 311

seems related to T88001 or T88002

Event Timeline

ZeroBanner's extension.json:

"JsonConfigs": {
  "JsonZeroConfig": { "namespace": 480, "nsName": "Zero", "isLocal": false, "cacheKey": "1" }
},

wmf-config/mobile.php tries to modify ZeroBanner's values, and I think this is where it fails:

$wgJsonConfigs['JsonZeroConfig']['isLocal'] = false;
$wgJsonConfigs['JsonZeroConfig']['remote'] = [
  'url' => 'https://zero.wikimedia.org/w/api.php',
  'username' => $wmgZeroPortalApiUserName,
  'password' => $wmgZeroPortalApiPassword,
];
jhobs triaged this task as Medium priority.Oct 13 2016, 8:22 PM
jhobs moved this task from Incoming to Triaged but Future on the Web-Team-Backlog board.
greg raised the priority of this task from Medium to Unbreak Now!.Oct 13 2016, 8:48 PM
greg subscribed.

If blocker for deployment => UBN!

Related, higher-frequency warning:

Warning: JsonConfig: In $wgJsonConfigs['JsonZeroConfig']['remote'] is set for the config that will be stored on this wiki. 'remote' parameter will be ignored. [Called from JsonConfig\JCSingleton::parseConfiguration in /srv/mediawiki/php-1.28.0-wmf.22/extensions/JsonConfig/includes/JCSingleton.php at line 161] in /srv/mediawiki/php-1.28.0-wmf.22/includes/debug/MWDebug.php on line 311
Aklapper renamed this task from [BUG] ZeroConfig broke parsing of configutation to [BUG] ZeroConfig broke parsing of configuration .Oct 14 2016, 9:38 AM

Related, higher-frequency warning:

Warning: JsonConfig: In $wgJsonConfigs['JsonZeroConfig']['remote'] is set for the config that will be stored on this wiki. 'remote' parameter will be ignored. [Called from JsonConfig\JCSingleton::parseConfiguration in /srv/mediawiki/php-1.28.0-wmf.22/extensions/JsonConfig/includes/JCSingleton.php at line 161] in /srv/mediawiki/php-1.28.0-wmf.22/includes/debug/MWDebug.php on line 311

From last night:

[00:33:11] <yurik> Reedy, that's fine

I propose we just disable that warning, and/or downgrade it from E_USER_WARNING to something even lower

https://github.com/wikimedia/mediawiki-extensions-JsonConfig/blob/master/includes/JCSingleton.php#L153-L156

Actually, there's no sign of it in the last hour or so?

Reedy lowered the priority of this task from Unbreak Now! to High.Oct 14 2016, 11:34 AM

Actually, there's no sign of it in the last hour or so?

Agreed. I've also failed to reproduce this locally.

Oh, and reverting ZeroPortal in master... is broken. Which is a sign of there being bigger issues...

https://gerrit.wikimedia.org/r/#/c/315864/

23:41:24 1) JsonConfig\Tests\JCTitleParsingTest::testTitleParsing with data set #0 (false, null, false)
23:41:24 JsonConfig: Invalid $wgJsonConfigs['JsonZeroConfig']['remote']['url']: API URL is not set, and this config is not being stored locally [Called from JsonConfig\JCSingleton::parseConfiguration in /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/extensions/JsonConfig/includes/JCSingleton.php at line 147]
23:41:24 
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/includes/debug/MWDebug.php:311
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/includes/debug/MWDebug.php:166
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/includes/GlobalFunctions.php:1155
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/extensions/JsonConfig/includes/JCSingleton.php:147
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/extensions/JsonConfig/includes/JCSingleton.php:74
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/extensions/JsonConfig/includes/JCSingleton.php:381
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/extensions/JsonConfig/tests/phpunit/JCTitleParsingTest.php:49
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/tests/phpunit/MediaWikiTestCase.php:392
23:41:24 /srv/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/maintenance/doMaintenance.php:110
23:41:24

We have https://gerrit.wikimedia.org/r/#/c/315844/ merged into .22, which I guess fixed the issue in production, so should probably be merged into master

Yep, found tons more "bigger issues" :)
T148493 ignores merge strategy, and also zerobanner & zeroconfig config's are incorrect for the 2nd extension.json version -- both jsonconfig values should be moved to the "config" section, and the actual values must be stored under "value" key. Still working on the fix...

Change 316524 had a related patch set uploaded (by Yurik):
Fixed JsonConfigs global var initialization

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

Change 316523 had a related patch set uploaded (by Yurik):
Use array_replace_recursive to merge jsonconfigs

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

Change 316525 had a related patch set uploaded (by Yurik):
Fixed JsonConfigs global var initialization

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

Change 316524 merged by Reedy:
Fixed JsonConfigs global var initialization

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

Change 316525 merged by jenkins-bot:
Fixed JsonConfigs global var initialization

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

Change 316523 merged by Reedy:
Use array_replace_recursive to merge jsonconfigs

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

Yep, found tons more "bigger issues" :)
Still working on the fix...

@Yurik: Were the three patches sufficient or is there more work to do here?

Yurik claimed this task.

Seems like all's good now :)

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM
Restricted Application changed the subtype of this task from "Production Error" to "Bug Report". · View Herald TranscriptAug 28 2019, 11:11 PM