Provider GrowthSuggestedEdits is not supported on wiktionary sites
Closed, ResolvedPublicBUG REPORT

Description

Wiktionary sites with CommunityConfiguration enabled and GrowthExperiments enabled break due to fatal exception

Steps to replicate the issue (include links if applicable):

What happens?:

An exception is shown on the screen, the site is non functional

 InvalidArgumentException: Provider GrowthSuggestedEdits is not supported
Backtrace:
from /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Provider/ConfigurationProviderFactory.php(143)
#0 /srv/mediawiki/php-master/extensions/GrowthExperiments/ServiceWiring.php(615): MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory->newProvider(string)
#1 /srv/mediawiki/php-master/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer::{closure}(MediaWiki\MediaWikiServices)
#2 /srv/mediawiki/php-master/vendor/wikimedia/services/src/ServiceContainer.php(411): Wikimedia\Services\ServiceContainer->createService(string)
#3 /srv/mediawiki/php-master/includes/MediaWikiServices.php(354): Wikimedia\Services\ServiceContainer->getService(string)
#4 /srv/mediawiki/php-master/vendor/wikimedia/services/src/ServiceContainer.php(419): MediaWiki\MediaWikiServices->getService(string)
#5 /srv/mediawiki/php-master/vendor/wikimedia/object-factory/src/ObjectFactory.php(204): Wikimedia\Services\ServiceContainer->get(string)
#6 /srv/mediawiki/php-master/vendor/wikimedia/object-factory/src/ObjectFactory.php(149): Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec(array, array)
#7 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(256): Wikimedia\ObjectFactory\ObjectFactory->createObject(array)
#8 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(348): MediaWiki\HookContainer\HookContainer->makeExtensionHandlerCallback(string, array, array)
#9 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(524): MediaWiki\HookContainer\HookContainer->normalizeHandler(string, array, array)
#10 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(146): MediaWiki\HookContainer\HookContainer->getHandlers(string, array)
#11 /srv/mediawiki/php-master/includes/HookContainer/HookRunner.php(4216): MediaWiki\HookContainer\HookContainer->run(string, array)
#12 /srv/mediawiki/php-master/includes/user/Options/DefaultOptionsLookup.php(117): MediaWiki\HookContainer\HookRunner->onUserGetDefaultOptions(array)
#13 /srv/mediawiki/php-master/includes/user/Options/DefaultOptionsLookup.php(126): MediaWiki\User\Options\DefaultOptionsLookup->getGenericDefaultOptions()
#14 /srv/mediawiki/php-master/includes/user/Options/UserOptionsManager.php(541): MediaWiki\User\Options\DefaultOptionsLookup->getDefaultOptions(MediaWiki\User\User)
#15 /srv/mediawiki/php-master/includes/user/Options/UserOptionsManager.php(456): MediaWiki\User\Options\UserOptionsManager->loadOriginalOptions(MediaWiki\User\User, integer)
#16 /srv/mediawiki/php-master/includes/user/Options/UserOptionsManager.php(163): MediaWiki\User\Options\UserOptionsManager->loadUserOptions(MediaWiki\User\User, integer)
#17 /srv/mediawiki/php-master/includes/user/Options/UserOptionsLookup.php(125): MediaWiki\User\Options\UserOptionsManager->getOption(MediaWiki\User\User, string, NULL, boolean, integer)
#18 /srv/mediawiki/php-master/includes/actions/ActionEntryPoint.php(380): MediaWiki\User\Options\UserOptionsLookup->getBoolOption(MediaWiki\User\User, string)
#19 /srv/mediawiki/php-master/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#20 /srv/mediawiki/php-master/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#21 /srv/mediawiki/php-master/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#22 /srv/mediawiki/w/index.php(3): require(string)
#23 {main}

What should have happened instead?:
The site should operate normally without using GrowthExperimentsProvider

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Looking through GrowthExperiments' extension.json, I notice that the GrowthExperimentsNewcomerTasksConfigurationLoader service is loaded in a lot of places.

From the top of my head, I can think of two possible ways forward:

  1. return a "Null ConfigurationLoader" instead if GEHomepageSuggestedEditsEnabled is false.
    • problem: as it is loaded in a lot of places, some of these places might actually try to access some config without first checking GEHomepageSuggestedEditsEnabled?
  2. don't disable the Provider if GEHomepageSuggestedEditsEnabled is false. That is closest to the legacy GE behavior, that also still has the config for suggested edits available on https://fr.wiktionary.org/wiki/Sp%C3%A9cial:EditGrowthConfig#mw-htmlform-newcomertasks even though suggested edits are not enabled on fr wiktionary

Great catch, thanks for reporting. What about checking GEHomepageSuggestedEditsEnabled in CommunityConfigurationLoader, and returning an empty array if that is the case? That should work, and while it might not be exactly equivalent, it should be at least close?

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

[mediawiki/extensions/GrowthExperiments@master] Don't break if suggested edits are disabled

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

Great catch, thanks for reporting. What about checking GEHomepageSuggestedEditsEnabled in CommunityConfigurationLoader, and returning an empty array if that is the case? That should work, and while it might not be exactly equivalent, it should be at least close?

Mh. Maybe that could work. I've uploaded a quick change, could you let me know if that goes into the direction that you were thinking? Then I can polish it and get it ready for proper review.

Great catch, thanks for reporting. What about checking GEHomepageSuggestedEditsEnabled in CommunityConfigurationLoader, and returning an empty array if that is the case? That should work, and while it might not be exactly equivalent, it should be at least close?

Mh. Maybe that could work. I've uploaded a quick change, could you let me know if that goes into the direction that you were thinking? Then I can polish it and get it ready for proper review.

Conceptually, LGTM. I'm wondering whether it makes more sense to ask "does this provider exist", or whether we should ask for "are Suggested edits enabled". Maybe we should check for both, and only log a warning when the provider does not exist, even when Suggested edits are enabled. But all of those are relatively minor details, and I'll be happy to merge any solution for those questions you end up with.

Urbanecm_WMF triaged this task as High priority.

Since this causes frwiktionary beta to go down, marking as High and moving to sprint. Since @Michael is looking at it, assigning it to him. Happy to take over whenever needed, feel free to let me know.

Change #1052115 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Don't break if suggested edits are disabled

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