Page MenuHomePhabricator

ResourceLoader: Fail more gracefully when a module name is registrated multiple times
Closed, DeclinedPublic

Description

MediaWiki internal error.

Original exception: exception 'MWException' with message 'ResourceLoader duplicate registration error. Another module has already been registered as jquery.form' in /home/wikipedia/common/php-1.18/includes/resourceloader/ResourceLoader.php:222
Stack trace:
#0 /home/wikipedia/common/php-1.18/includes/resourceloader/ResourceLoader.php(213): ResourceLoader->register('jquery.form', Array)
#1 /home/wikipedia/common/php-1.18/includes/resourceloader/ResourceLoader.php(189): ResourceLoader->register(Array)
#2 /home/wikipedia/common/php-1.18/includes/OutputPage.php(2331): ResourceLoader->__construct()
#3 /home/wikipedia/common/php-1.18/includes/OutputPage.php(398): OutputPage->getResourceLoader()
#4 /home/wikipedia/common/php-1.18/includes/OutputPage.php(423): OutputPage->filterModules(Array, 'bottom')
#5 /home/wikipedia/common/php-1.18/includes/OutputPage.php(493): OutputPage->getModules(true, 'bottom', 'mModuleMessages')
#6 /home/wikipedia/common/php-1.18/includes/OutputPage.php(2540): OutputPage->getModuleMessages(true, 'bottom')
#7 /home/wikipedia/common/php-1.18/includes/Skin.php(702): OutputPage->getBottomScripts(Object(SkinVector))
#8 /home/wikipedia/common/php-1.18/includes/SkinTemplate.php(451): Skin->bottomScripts(Object(OutputPage))
#9 /home/wikipedia/common/php-1.18/includes/OutputPage.php(1855): SkinTemplate->outputPage(Object(OutputPage))
#10 /home/wikipedia/common/php-1.18/includes/Wiki.php(380): OutputPage->output()
#11 /home/wikipedia/common/php-1.18/includes/Wiki.php(625): MediaWiki->finalCleanup()
#12 /home/wikipedia/common/php-1.18/includes/Wiki.php(531): MediaWiki->main()
#13 /home/wikipedia/common/php-1.18/index.php(57): MediaWiki->run()
#14 /usr/local/apache/common-local/live-1.5/index.php(3): require('/home/wikipedia...')
#15 {main}

Exception caught inside exception handler: exception 'MWException' with message 'ResourceLoader duplicate registration error. Another module has already been registered as jquery.form' in /home/wikipedia/common/php-1.18/includes/resourceloader/ResourceLoader.php:222
Stack trace:
#0 /home/wikipedia/common/php-1.18/includes/resourceloader/ResourceLoader.php(213): ResourceLoader->register('jquery.form', Array)
#1 /home/wikipedia/common/php-1.18/includes/resourceloader/ResourceLoader.php(189): ResourceLoader->register(Array)
#2 /home/wikipedia/common/php-1.18/includes/OutputPage.php(2331): ResourceLoader->__construct()
#3 /home/wikipedia/common/php-1.18/includes/OutputPage.php(398): OutputPage->getResourceLoader()
#4 /home/wikipedia/common/php-1.18/includes/OutputPage.php(423): OutputPage->filterModules(Array, 'bottom')
#5 /home/wikipedia/common/php-1.18/includes/OutputPage.php(493): OutputPage->getModules(true, 'bottom', 'mModuleMessages')
#6 /home/wikipedia/common/php-1.18/includes/OutputPage.php(2540): OutputPage->getModuleMessages(true, 'bottom')
#7 /home/wikipedia/common/php-1.18/includes/Skin.php(702): OutputPage->getBottomScripts(Object(SkinVector))
#8 /home/wikipedia/common/php-1.18/includes/SkinTemplate.php(451): Skin->bottomScripts(Object(OutputPage))
#9 /home/wikipedia/common/php-1.18/includes/OutputPage.php(1855): SkinTemplate->outputPage(Object(OutputPage))
#10 /home/wikipedia/common/php-1.18/includes/Exception.php(183): OutputPage->output()
#11 /home/wikipedia/common/php-1.18/includes/Exception.php(209): MWException->reportHTML()
#12 /home/wikipedia/common/php-1.18/includes/Exception.php(392): MWException->report()
#13 /home/wikipedia/common/php-1.18/includes/Exception.php(471): MWExceptionHandler::report(Object(MWException))
#14 /home/wikipedia/common/php-1.18/includes/Wiki.php(534): MWExceptionHandler::handle(Object(MWException))
#15 /home/wikipedia/common/php-1.18/index.php(57): MediaWiki->run()
#16 /usr/local/apache/common-local/live-1.5/index.php(3): require('/home/wikipedia...')
#17 {main}


Version: unspecified
Severity: normal

Details

Reference
bz31626
TitleReferenceAuthorSource BranchDest Branch
deploy-promote: make version matching regex less brittlerepos/releng/scap!138jnuchesimplify-regexmaster
deploy-promote: fix parsing of non-self closing tag with wiki versionrepos/releng/scap!135jnuchefix-deploy-promotemaster
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:53 PM
bzimport set Reference to bz31626.
bzimport added a subscriber: Unknown Object (MLST).

shealen.clare wrote:

This bug has not been voted, been the source of a duplicate or otherwise touched in at least six months. With this in mind, I've been asked by the bugmeister to bump this bug's priority down from "High". Concerns can be addressed to mah@everybody.org.

I'm not sure it should fail more graceful. It was specifically made to abort in that scenario. There is probably an underlying bug that needs to be solved instead.

If there are multiple versions of a module somehow making it into the registry, other module could break even worse by getting the wrong dependency and what not.

This is the functional equivalent of two pieces of php code in MediaWiki (e.g. core and an extension, or two extensions) registering the same class name in the Autoloader.

There is imho no acceptable graceful behaviour. It is front-end, not backend, so you could at most decide to disable the entire javascript pipeline, but that seems not worth implementing for this.