Page MenuHomePhabricator

Fatal exception error on Special:Preferences on Wikimedia Incubator
Closed, ResolvedPublic

Description

Hello,
Whenever I go to [[incubator:Special:Preferences]], I get an internal error similar to the following:

"[31b42f98] 2012-11-13 16:12:12: Fatal exception of type MWException"

I don't know if I changed my preferences there recently, but I'm unable to change preferences now, or even see what they're set to. Special:Preferences seems fine on other WMF wikis (works on metawiki and enwiki).


Version: unspecified
Severity: major

Details

Reference
bz42068

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:02 AM
bzimport set Reference to bz42068.
bzimport added a subscriber: Unknown Object (MLST).

Incubator is still on 1.21wmf3 but I couldn't reproduce on other wmf3 pages so moving from MediaWiki (software) to to Wikimedia (servers).

I believe this could somehow related to the language setting or the (WikimediaIncubator-extension specific) test wiki preference.

My settings for this are de/incubator and I am able to access Special:Preferences.
However, trying with another account whose preferences were never edited (therefore the settings are en/none), it fails.

I've also asked a non-sysop with the settings en/incubator if he can access it, to confirm that this is not because of my sysop status.

Probably a duplicate of bug 41337.

  • Bug 42079 has been marked as a duplicate of this bug. ***

2012-11-13 19:46:42 mw36 incubatorwiki: [3b5c13bd] /wiki/Special:Preferences
Exception from line 112 of
/usr/local/apache/common-local/php-1.21wmf3/includes/Preferences.php: Global
default '' is invalid for field incubatortestwiki-project
#0 /usr/local/apache/common-local/php-1.21wmf3/includes/Preferences.php(1243):
Preferences::getPreferences(Object(User), Object(RequestContext))
#1
/usr/local/apache/common-local/php-1.21wmf3/includes/specials/SpecialPreferences.php(60):
Preferences::getFormObject(Object(User), Object(RequestContext))
#2 /usr/local/apache/common-local/php-1.21wmf3/includes/SpecialPage.php(599):
SpecialPreferences->execute(NULL)
#3
/usr/local/apache/common-local/php-1.21wmf3/includes/SpecialPageFactory.php(497):
SpecialPage->run(NULL)
#4 /usr/local/apache/common-local/php-1.21wmf3/includes/Wiki.php(291):
SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#5 /usr/local/apache/common-local/php-1.21wmf3/includes/Wiki.php(555):
MediaWiki->performRequest()
#6 /usr/local/apache/common-local/php-1.21wmf3/includes/Wiki.php(448):
MediaWiki->main()
#7 /usr/local/apache/common-local/php-1.21wmf3/index.php(59): MediaWiki->run()
#8 /usr/local/apache/common-local/live-1.5/index.php(3):
require('/usr/local/apac...')
#9 {main}

gwaw_2003 wrote:

This happens to me as well (sorry bout the duplicate bug). I haven't ever been able to access them since starting on incubator 3 or so days ago.

I can reproduce on master.

Nothing related changed in the Incubator extension recently, so something must have changed in MediaWiki core.

It seems to be because of https://gerrit.wikimedia.org/r/#/c/30554 which caches the default user options.

Mhm, this should (as described in the code comment) never happen... probably the extension does some evil things to globals.

The problem is the following line (current WikimediaIncubator extension master):

IncubatorTest.php:51
$wgDefaultUserOptions[$wmincPref . '-project'] = 'none';

I don't really know what it does, in case it can't be (easily) changed, we need a way to invalidate the User::getDefaultOptions() cache. I'm happy to implement that, if needed.

(In reply to comment #11)

The problem is the following line (current WikimediaIncubator extension
master):

IncubatorTest.php:51
$wgDefaultUserOptions[$wmincPref . '-project'] = 'none';

I don't really know what it does, in case it can't be (easily) changed, we need
a way to invalidate the User::getDefaultOptions() cache. I'm happy to implement
that, if needed.

Well, it does what the name says: it sets default user options. As far as I know, it is/was an allowed way to set this through a GetPreferences hook function. At least it probably is/was done in other extensions too. I can move it to WikimediaIncubator.php but then I'll have to remove the $wmincPref variable.

I see... this is proper way to do this (please test):

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

(In reply to comment #13)

I see... this is proper way to do this (please test):

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

Yep, that's also a way to fix it while keeping the variable.

Tested and it works, thanks. I've merged the change.
Now it would probably be best to have it backported to wmf4.