https://bugzilla.wikimedia.org/show_bug.cgi?id=56955

       Web browser: ---
            Bug ID: 56955
           Summary: wmerrors does not use UTC for log timestamps
           Product: Wikimedia
           Version: wmf-deployment
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General/Unknown
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to