Last modified: 2014-03-10 08:55:33 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 T64426, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62426 - Undocumented inter-dependencies of default options (namely wgDefaultUserOptions['rcdays'] and wgRCMaxAge) with hard fail
Undocumented inter-dependencies of default options (namely wgDefaultUserOptio...
Product: MediaWiki
Classification: Unclassified
User preferences (Other open bugs)
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: documentation
  Show dependency treegraph
Reported: 2014-03-08 04:47 UTC by Zach
Modified: 2014-03-10 08:55 UTC (History)
2 users (show)

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


Description Zach 2014-03-08 04:47:04 UTC
If I set $wgRCMaxAge to a value such that ceil($wgRCMaxAge/(24*3600)) < $wgDefaultUserOptions['rcdays'] then upon clicking "preferences" the following scary and (perhaps intentionally) uninformative message shows up:

Internal error - {{SITENAME}}
[********] 2014-03-08 03:56:05: Fatal exception of type MWException

Upon searching the web and finding that I should activate $wgShowExceptionDetails, I get the following more informative error message:

/wiki/Special:Preferences Exception from line 134 of /usr/local/lib/mediawiki/includes/Preferences.php: Global default '7' is invalid for field rcdays

and with a little more digging eventually figure out that I have unintentionally set the number of days for retaining recent changes to be less than the number of days to display recent changes. So I solved the immediate problem of concern for my own system, but the following concerns remain:

1) Documentation: I added brief documentation of this inter-dependency to the Manual pages for $wgDefaultUserOptions and $wgRCMaxAge at, since it was not presently documented there. However, I wonder how many other such inter-dependencies exist that remain undocumented.

2) Hard fail: Setting an integer/float to a value outside of an elsewhere-specified-range may indeed qualify as an error, but throwing an uncaught exception that totally crashes the page in question, without offering a very helpful explanation as to what has gone wrong, seems a bit extreme. Or again, choosing settings that would display up to 7 days of recent changes even though I am only actually retaining 3 days of recent changes may be a *silly* and partly frivolous choice of settings, but reckoning it as a hard and unrecoverable fault seems to be going too far.

3) The situation above is actually further complicated by the fact that, from what experience tells me, rcdays actually gets set to max(3, my setting for $wgDefaultUserOptions['rcdays']), although I still haven't found anywhere that the "3" bound is documented or where it occurs in the code.

In summary, I foresee that having to track down the cause of a fault to unexpected inter-dependencies of settings to be a likely cause of headache for other site admins in the future. Documentation of such inter-dependencies under all affected configurable variables would be one nice step.
Comment 1 Andre Klapper 2014-03-10 08:55:33 UTC
(In reply to Zach from comment #0)
> Internal error - {{SITENAME}}
> [********] 2014-03-08 03:56:05: Fatal exception of type MWException

Is this on Wikimedia site, or on your wiki?

If the latter, see how to get a stacktrace.

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