Last modified: 2014-10-09 18:31:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T69440, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67440 - Running installer on existing wiki can fail when extensions are enabled
Running installer on existing wiki can fail when extensions are enabled
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-02 22:32 UTC by Chad H.
Modified: 2014-10-09 18:31 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---
mah: Backport_to_Stable+


Attachments

Description Chad H. 2014-07-02 22:32:08 UTC
Running the installer on your existing wiki can fail when extension entry points expect their own classes to be registered already when we call Installer::getExistingLocalSettings(). Since the require() there isn't in the global scope, $wgAutoloadClasses doesn't "work" and the subsequent call to the class will fail.

---

Fatal error: Class 'MwEmbedResourceManager' not found in /vagrant/mediawiki/extensions/MwEmbedSupport/MwEmbedSupport.php on line 58

Call Stack:
    0.0000     638800   1. {main}() /vagrant/mediawiki/mw-config/index.php:0
    0.0281    3246320   2. wfInstallerMain() /vagrant/mediawiki/mw-config/index.php:31
    0.0852    7279256   3. WebInstaller->execute() /vagrant/mediawiki/mw-config/index.php:72
    0.0903    7662024   4. WebInstallerExistingWiki->execute() /vagrant/mediawiki/includes/installer/WebInstaller.php:280
    0.0903    7662024   5. Installer::getExistingLocalSettings() /vagrant/mediawiki/includes/installer/WebInstallerPage.php:316
    0.0908    8019208   6. require('/vagrant/mediawiki/LocalSettings.php') /vagrant/mediawiki/includes/installer/Installer.php:541
    0.0915    8020256   7. require_once('/vagrant/LocalSettings.php') /vagrant/mediawiki/LocalSettings.php:128
    0.0929    8028128   8. include_once('/vagrant/settings.d/puppet-managed/10-CirrusSearch.php') /vagrant/LocalSettings.php:91
    0.0935    8087728   9. include_once('/vagrant/mediawiki/extensions/CirrusSearch/tests/jenkins/Jenkins.php') /vagrant/settings.d/puppet-managed/10-CirrusSearch.php:6
    0.0943    8149968  10. require_once('/vagrant/mediawiki/extensions/MwEmbedSupport/MwEmbedSupport.php') /vagrant/mediawiki/extensions/CirrusSearch/tests/jenkins/Jenkins.php:45

---

This is based on me running Cirrus + MwEmbedSupport on vagrant but it's not specific to any of these cases. You could do a simpler case like this in your LocalSettings:

---
// other config above here
require_once( "test.php" );

---

With a test.php of:

---
<?php

$wgAutoloadClasses['foo'] = 'foo.php';

foo::bar()

---

This coding style works when in normal execution but explodes for very obvious reasons otherwise. Other than "we shouldn't do that and fix instances where we are" can we think of any sorts of ways to mitigate the problem?
Comment 1 Gerrit Notification Bot 2014-07-02 22:44:19 UTC
Change 143779 had a related patch set uploaded by Chad:
Allow classes to be registered properly from installer

https://gerrit.wikimedia.org/r/143779
Comment 2 Gerrit Notification Bot 2014-08-01 20:56:15 UTC
Change 143779 merged by jenkins-bot:
Allow classes to be registered properly from installer

https://gerrit.wikimedia.org/r/143779
Comment 3 Kunal Mehta (Legoktm) 2014-08-01 20:57:14 UTC
"fixed" for now, should probably revisit when we have sane extension registration. Flagging for backport.
Comment 4 Gerrit Notification Bot 2014-10-09 14:34:36 UTC
Change 165727 had a related patch set uploaded by MarkAHershberger:
Allow classes to be registered properly from installer

https://gerrit.wikimedia.org/r/165727
Comment 5 Gerrit Notification Bot 2014-10-09 14:35:59 UTC
Change 165728 had a related patch set uploaded by MarkAHershberger:
Allow classes to be registered properly from installer

https://gerrit.wikimedia.org/r/165728
Comment 6 Gerrit Notification Bot 2014-10-09 14:38:21 UTC
Change 165729 had a related patch set uploaded by MarkAHershberger:
Allow classes to be registered properly from installer

https://gerrit.wikimedia.org/r/165729
Comment 7 Gerrit Notification Bot 2014-10-09 14:40:07 UTC
Change 165727 merged by jenkins-bot:
Allow classes to be registered properly from installer

https://gerrit.wikimedia.org/r/165727
Comment 8 Gerrit Notification Bot 2014-10-09 14:40:53 UTC
Change 165728 merged by jenkins-bot:
Allow classes to be registered properly from installer

https://gerrit.wikimedia.org/r/165728
Comment 9 Gerrit Notification Bot 2014-10-09 14:41:14 UTC
Change 165729 merged by jenkins-bot:
Allow classes to be registered properly from installer

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links