Page MenuHomePhabricator

Undocumented inter-dependencies of default options (namely wgDefaultUserOptions['rcdays'] and wgRCMaxAge) with hard fail
Open, MediumPublic


Author: zacharyharris

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.
  1. 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.
  1. 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.

Version: 1.23.0
Severity: normal
OS: Linux
Platform: PC