WeBWorK Main Forum

Timezone issues

Timezone issues

by Michael Schultheiss -
Number of replies: 1
Our primary Webwork admin reported a recent issue he's seeing with our production WeBWorK environment. Problems in multiple courses have pages of timezone warnings at the bottom:

WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

Warning messages

  • Loaded DateTime::TimeZone::America::New_York, which is from an older version (2017b) of the Olson database than this installation of DateTime::TimeZone (2013h).
I've got the latest versions of DateTime::TimeZone and DateTime::TimeZone::America::New_York from CPAN. We're running on Red Hat Enterprise Linux 7.5

What needs to be done to fix or suppress these warnings?
In reply to Michael Schultheiss

Re: Timezone issues

by Nathan Wallach -
It seems that the Perl module DateTime::TimeZone has a bug in how it detects and compares the version string and issues this warning, so in many cases gives the warning even when the system has a new version.

I recommend the following (on your WW server):
  • Find the file TimeZone.pm file in the Perl folder for the DateTime module.
  • On a RHEL 7 system I manage, the relevant file is /usr/share/perl5/vendor_perl/DateTime/TimeZone.pm
  • Check which files in the relevant directory have the string "which is from an older version".
  • Edit the file in your favorite text editor. Search for the line with the text "which is from an older version". It will be in the middle of a block like:
    • if ( $object_version ne $catalog_version ) {
    • warn
    • "Loaded $real_class, which is from an older version ($object_version) of the Olson database than this installation of DateTime::TimeZone ($catalog_version).\n";
    • }
  • in which the warn call is split over several lines.
  • Hack the code to bypass the warning.
    • Option 1: Comment out the lines which issue the warning.
    • Option 2: Replace the if condition line by "if ( 1 == 0 ) {" so the warning will not be issued.