Page MenuHomePhabricator

[beta-enwiki] Config variable CiteBacklinkCommunityConfiguration not found in community configuration
Closed, ResolvedPublic

Description

https://en.wikipedia.beta.wmcloud.org/wiki/Special:CommunityConfiguration/Cite displays Internal error:

[aKOUNrFco0ums1Kh0hapNAAAAMI] /wiki/Special:CommunityConfiguration/Cite MediaWiki\Config\ConfigException: Config variable CiteBacklinkCommunityConfiguration not found in community configuration.Should be requested via MediaWikiConfigRouter instead.

Backtrace:

from /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Access/MediaWikiConfigReader.php(110)
#0 /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Access/MediaWikiConfigReader.php(122): MediaWiki\Extension\CommunityConfiguration\Access\MediaWikiConfigReader->getConfigByVariableName(string)
#1 /srv/mediawiki/php-master/extensions/Cite/src/Config/CiteEditorCapability.php(36): MediaWiki\Extension\CommunityConfiguration\Access\MediaWikiConfigReader->get(string)
#2 /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Specials/SpecialCommunityConfiguration.php(63): Cite\Config\CiteEditorCapability->execute(MediaWiki\Extension\CommunityConfiguration\Provider\MediaWikiConfigProvider, null)
#3 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(725): MediaWiki\Extension\CommunityConfiguration\Specials\SpecialCommunityConfiguration->execute(string)
#4 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(1732): MediaWiki\SpecialPage\SpecialPage->run(string)
#5 /srv/mediawiki/php-master/includes/actions/ActionEntryPoint.php(499): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#6 /srv/mediawiki/php-master/includes/actions/ActionEntryPoint.php(143): MediaWiki\Actions\ActionEntryPoint->performRequest()
#7 /srv/mediawiki/php-master/includes/MediaWikiEntryPoint.php(198): MediaWiki\Actions\ActionEntryPoint->execute()
#8 /srv/mediawiki/php-master/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#9 /srv/mediawiki/w/index.php(3): require(string)
#10 {main}

Event Timeline

I think this is a bug for the Growth-Team who is responsible for the AbstractEditorCapability infrastructure in MediaWiki-extensions-CommunityConfiguration.

The stack trace above confuses me. How is it possible that …

  1. the Cite extension is loaded
  2. CommunityConfiguration is able to find the attributesCommunityConfigurationEditorCapabilities in extension.json
  3. CommunityConfiguration starts executing Cite's CiteEditorCapability
  4. but the config flag CiteBacklinkCommunityConfiguration is missing and doesn't have the default that is specified in extension.json?

Maybe the "CommunityConfiguration.MediaWikiConfigReader" service changed and returns a limited config reader now that doesn't contain the Cite config?

I think this is a bug for the Growth-Team who is responsible for the AbstractEditorCapability infrastructure in MediaWiki-extensions-CommunityConfiguration.

The stack trace above confuses me. How is it possible that …

  1. the Cite extension is loaded
  2. CommunityConfiguration is able to find the attributesCommunityConfigurationEditorCapabilities in extension.json
  3. CommunityConfiguration starts executing Cite's CiteEditorCapability
  4. but the config flag CiteBacklinkCommunityConfiguration is missing and doesn't have the default that is specified in extension.json?

Maybe the "CommunityConfiguration.MediaWikiConfigReader" service changed and returns a limited config reader now that doesn't contain the Cite config?

The error message is intended to be clear and explicit about what is going on: "Config variable CiteBacklinkCommunityConfiguration not found in community configuration.Should be requested via MediaWikiConfigRouter instead."

MediaWikiConfigReader is for reading config stored in CommunityConfiguration. That was always its intended purpose, though a deprecated fallback mechanism existed for a short while. If one also wants to read from the PHP config instead, one should use MediaWikiConfigRouter.

That being said, I'm confused about this breaking now. The change that is throwing that exception was merged two months ago: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CommunityConfiguration/+/1129342 Before that, we carefully checked logs to see if there were any warnings anywhere about the fallback mechanism still being used and the logs were clean. How come this has not been triggered until now?

Change #1180092 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/Cite@master] fix: use MediaWikiConfigRouter to access php config

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

I added a 1-line change to fix the issue.
I think it might make sense for the team to also add a (smoke) test to make sure that the configuration can actually be loaded and used: maybe a browser test that goes to the configuration page with the admin user, changes a detail, saves, and then goes somewhere to verify that the changed config has taken effect.

Oh. I would have never guessed from the class name alone, to be honest. They look so identical I didn't even spot the difference in the exception message. Can you rename MediaWikiConfigReader to e.g. CommunityConfigurationConfigReader? Some of the comments even call it the "CommunityConfiguration provider". Why not go so far and actually name the class like that?

Change #1180092 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] fix: use MainConfig to access php config

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

Change #1180126 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/CommunityConfiguration@master] Add documentation to ambiguous MediaWikiConfigReader/Router

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

Change #1180126 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Add documentation to ambiguous MediaWikiConfigReader/Router

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

Checked on enwiki beta- the reported issue has been fixed. Since all the patches associated with ttak are merged, I'm resolving the ticket. If there some additional work to be done, please re-open or report in a separate task.