Last modified: 2013-11-12 22:08:25 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 T58955, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56955 - wmerrors does not use UTC for log timestamps
wmerrors does not use UTC for log timestamps
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
wmf-deployment
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-12 20:22 UTC by Antoine "hashar" Musso (WMF)
Modified: 2013-11-12 22:08 UTC (History)
1 user (show)

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


Attachments

Description Antoine "hashar" Musso (WMF) 2013-11-12 20:22:08 UTC
The timestamps in fatal.log is using the Wiki timezone instead of UTC as noticed during an outage on Nov 1th:

On Nov 1st 2013 01:31, Rob Lanphier wrote:
>> *Possibly unrelated but needs sorting out:*
>     Timestamps in fatals.log skip by 1 hour between hosts
>     [31-Oct-2013 16:52:25] Fatal error: Class 'PoolCounter_Client' not
> found at
> /usr/local/apache/common-local/php-1.23wmf1/includes/PoolCounter.php on
> line 91
> Server: mw1208
> [31-Oct-2013 17:52:27] Fatal error: Class 'PoolCounter_Client' not found
> at /usr/local/apache/common-local/php-1.23wmf1/includes/PoolCounter.php
> on line 91
> Server: mw1201
> :Related to the timezone weirdness this week maybe?

The times in fatal.log come from $wgLocalTimezone which is different on some wikis:

The first trace on mw1208 was on the wikimedia foundation wiki:

 $ mwscript eval.php --wiki=wikimediawiki
 > return $wgLocaltimezone;
 UTC
 >

The second on mw1201 is from itwiktionary:

 $ mwscript eval.php --wiki=itwiktionary
 > return $wgLocaltimezone;
 Europe/Berlin

We used to have that issue with the debug logs as well until 1.20 introduced $wgDBerrorLogTZ ( https://gerrit.wikimedia.org/r/15605 though with a different name).

This time the issue in PHP itself / wmerrors.  PHP 5.3.9 changed php_format_date() to default to

Since Setup.php does:

 date_default_timezone_set( $wgLocaltimezone );

The wmerrors PHP extension rely on php_format_date which is set to use a
localtimezone:

    error_time_str = php_format_date(
       "d-M-Y H:i:s",
       11,
       time(NULL),
       1 TSRMLS_CC  // <-- localtime
    );

That last parameter should be 0 to skip the localtime lookup and thus use UTC.



We have set date.timezone to UTC in Wikimedia configuration with https://gerrit.wikimedia.org/r/#/c/93009/  I am pretty sure that is overridden by MediaWiki in Setup.php by doing something like:

 date_default_timezone_set( $wgLocaltimezone );

The php_format_date() call in our PHP extension wmerror needs to be adjusted to use GMT instead of localtime.
Comment 1 Gerrit Notification Bot 2013-11-12 20:26:42 UTC
Change 94978 had a related patch set uploaded by Hashar:
report fatals using UTC

https://gerrit.wikimedia.org/r/94978
Comment 2 Tim Starling 2013-11-12 21:55:50 UTC
I fixed this yesterday in I6d605f41
Comment 3 Antoine "hashar" Musso (WMF) 2013-11-12 22:07:56 UTC
Awesome! Thank you Tim :)
Comment 4 Gerrit Notification Bot 2013-11-12 22:08:25 UTC
Change 94978 abandoned by Hashar:
report fatals using UTC

Reason:
Fixed properly by Tim in https://gerrit.wikimedia.org/r/#/c/94838/

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

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


Navigation
Links