⚓ T380423 Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
Page Menu
Phabricator
Create Task
Maniphest
T380423
Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
Closed, Resolved
Public
BUG REPORT
Actions
Edit Task
Edit Related Tasks...
Create Subtask
Edit Parent Tasks
Edit Subtasks
Merge Duplicates In
Close As Duplicate
Edit Related Objects...
Edit Commits
Edit Mocks
Mute Notifications
Protect as security issue
Assigned To
AS1100K
Authored By
Novem_Linguae
Nov 20 2024, 9:44 PM
2024-11-20 21:44:03 (UTC+0)
Tags
MediaWiki-Configuration
(Backlog)
MW-1.44-notes (1.44.0-wmf.6; 2024-12-03)
MW-1.39-notes
MW-1.43-notes
Referenced Files
F57756845: image.png
Nov 28 2024, 7:43 PM
2024-11-28 19:43:08 (UTC+0)
F57756837: image.png
Nov 28 2024, 7:43 PM
2024-11-28 19:43:08 (UTC+0)
F57726286: image.png
Nov 20 2024, 10:57 PM
2024-11-20 22:57:23 (UTC+0)
F57726291: image.png
Nov 20 2024, 10:57 PM
2024-11-20 22:57:23 (UTC+0)
F57726289: image.png
Nov 20 2024, 10:57 PM
2024-11-20 22:57:23 (UTC+0)
Subscribers
Aklapper
Func
matmarex
Novem_Linguae
Description
Steps to replicate the issue
(include links if applicable):
Add
$wgLocaltimezone = 'America/New York';
to LocalSetting.php (note the space not underscore, this will trigger an error)
Load a page on your wiki
What happens?
Depending on your error reporting settings, either an error 500 with no information, or
Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (America/New York) in /var/www/html/w/includes/MainConfigSchema.php:5122 Stack trace: #0 /var/www/html/w/includes/MainConfigSchema.php(5122): DateTimeZone->__construct() #1 /var/www/html/w/includes/Settings/DynamicDefaultValues.php(92): MediaWiki\MainConfigSchema::getDefaultLocalTZoffset() #2 /var/www/html/w/includes/Settings/DynamicDefaultValues.php(37): MediaWiki\Settings\DynamicDefaultValues->computeDefaultFor() #3 /var/www/html/w/includes/Setup.php(259): MediaWiki\Settings\DynamicDefaultValues->applyDynamicDefaults() #4 /var/www/html/w/includes/WebStart.php(85): require_once('...') #5 /var/www/html/w/index.php(50): require('...') #6 {main} thrown in /var/www/html/w/includes/MainConfigSchema.php on line 5122
What should have happened instead?
Human readable message such as "Invalid timezone specified for $wgLocaltimezone. Please see the list of valid timezones at
. Please note that you should use underscores, not spaces."
Software version
(on
Special:Version
page; skip for WMF-hosted wikis like Wikipedia):
Other information
(browser name/version, screenshots, etc.):
Details
Related Changes in Gerrit:
Subject
Repo
Branch
Lines +/-
Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
mediawiki/core
REL1_43
+14
-1
Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
mediawiki/core
REL1_39
+14
-1
Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
mediawiki/core
master
+14
-1
Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
mediawiki/core
master
+8
-1
Customize query in gerrit
Event Timeline
Novem_Linguae
created this task.
Nov 20 2024, 9:44 PM
2024-11-20 21:44:03 (UTC+0)
Restricted Application
added a subscriber:
Aklapper
View Herald Transcript
Nov 20 2024, 9:44 PM
2024-11-20 21:44:04 (UTC+0)
Novem_Linguae
added a comment.
Nov 20 2024, 10:57 PM
2024-11-20 22:57:23 (UTC+0)
Comment Actions
There doesn't appear to be a standard way to handle errors before the skin is loaded. Lots of variation.
Unformatted:
Bad extension:
Bad default skin:
matmarex
subscribed.
Nov 21 2024, 12:00 AM
2024-11-21 00:00:02 (UTC+0)
Comment Actions
By the way, DiscussionTools also displays an error when $wgLocaltimezone is not set. It's not exactly standard either:
AS1100K
claimed this task.
Nov 21 2024, 5:48 PM
2024-11-21 17:48:48 (UTC+0)
gerritbot
added a comment.
Nov 21 2024, 6:18 PM
2024-11-21 18:18:41 (UTC+0)
Comment Actions
Change #1093977 had a related patch set uploaded (by AS1100K; author: AS1100K):
[mediawiki/core@master] Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
gerritbot
added a project:
Patch-For-Review
Nov 21 2024, 6:18 PM
2024-11-21 18:18:42 (UTC+0)
gerritbot
added a comment.
Nov 22 2024, 5:39 AM
2024-11-22 05:39:25 (UTC+0)
Comment Actions
Change #1094167 had a related patch set uploaded (by AS1100K; author: AS1100K):
[mediawiki/core@master] Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
gerritbot
added a comment.
Nov 22 2024, 5:41 AM
2024-11-22 05:41:35 (UTC+0)
Comment Actions
Change #1093977
abandoned
by AS1100K:
[mediawiki/core@master] Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
Reason:
A new patch is at https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1094167 I am new to gerrit and messed up with Change-Id. Sorry!
Pppery
edited projects, added
MediaWiki-Configuration
; removed
MediaWiki-General
Nov 27 2024, 12:38 AM
2024-11-27 00:38:51 (UTC+0)
gerritbot
added a comment.
Nov 28 2024, 4:29 AM
2024-11-28 04:29:41 (UTC+0)
Comment Actions
Change #1094167
merged
by jenkins-bot:
[mediawiki/core@master] Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
Maintenance_bot
removed a project:
Patch-For-Review
Nov 28 2024, 4:30 AM
2024-11-28 04:30:19 (UTC+0)
ReleaseTaggerBot
added a project:
MW-1.44-notes (1.44.0-wmf.6; 2024-12-03)
Nov 28 2024, 5:00 AM
2024-11-28 05:00:45 (UTC+0)
matmarex
closed this task as
Resolved
Nov 28 2024, 2:44 PM
2024-11-28 14:44:36 (UTC+0)
Comment Actions
Thanks for the patch
@AS1100K
Novem_Linguae
added a comment.
Nov 28 2024, 7:43 PM
2024-11-28 19:43:08 (UTC+0)
Comment Actions
Old:
New:
Still shows a stack trace, which may be a bit confusing to folks that don't know how to program. However it's an improvement since it now mentions $wgLocaltimezone, and links to the timezone allow list.
Func
subscribed.
Jul 30 2025, 12:53 PM
2025-07-30 12:53:40 (UTC+0)
Comment Actions
This can also be a Debian 13 support issue, some MW installations may have had
$wgLocaltimezone
set to
deprecated values
like
PRC
by the installer or manually. After they upgrade to Debian 13, the
tzdata
package no longer provides these timezones, and the
tzdata-legacy
package is not to be installed by default.
So I think it would be nice to backport the patch to supported branches.
gerritbot
added a comment.
Jul 30 2025, 1:02 PM
2025-07-30 13:02:18 (UTC+0)
Comment Actions
Change #1174456 had a related patch set uploaded (by Func; author: AS1100K):
[mediawiki/core@REL1_43] Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
gerritbot
added a project:
Patch-For-Review
Jul 30 2025, 1:02 PM
2025-07-30 13:02:20 (UTC+0)
gerritbot
added a comment.
Jul 30 2025, 1:04 PM
2025-07-30 13:04:38 (UTC+0)
Comment Actions
Change #1174458 had a related patch set uploaded (by Func; author: AS1100K):
[mediawiki/core@REL1_39] Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
gerritbot
added a comment.
Jul 30 2025, 3:45 PM
2025-07-30 15:45:23 (UTC+0)
Comment Actions
Change #1174458
merged
by jenkins-bot:
[mediawiki/core@REL1_39] Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
gerritbot
added a comment.
Jul 30 2025, 3:50 PM
2025-07-30 15:50:48 (UTC+0)
Comment Actions
Change #1174456
merged
by jenkins-bot:
[mediawiki/core@REL1_43] Show user a human readable message when $wgLocaltimezone is set to an invalid timezone
ReleaseTaggerBot
added projects:
MW-1.39-notes
MW-1.43-notes
Jul 30 2025, 4:00 PM
2025-07-30 16:00:21 (UTC+0)
Maintenance_bot
removed a project:
Patch-For-Review
Jul 30 2025, 4:31 PM
2025-07-30 16:31:13 (UTC+0)
Log In to Comment
Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct.
Wikimedia Foundation
Code of Conduct
Disclaimer
CC-BY-SA
GPL
Credits
US