Bug 490524
| Summary: | Perl pages don't work in CET time zone | ||
|---|---|---|---|
| Product: | Red Hat Satellite 5 | Reporter: | Jay Dobies <jason.dobies> |
| Component: | WebUI | Assignee: | Jan Pazdziora (Red Hat) <jpazdziora> |
| Status: | CLOSED ERRATA | QA Contact: | Martin Minar <mminar> |
| Severity: | high | Docs Contact: | |
| Priority: | medium | ||
| Version: | 530 | CC: | asv, jpazdziora, mkoci, mkpai, mminar, ppatanka |
| Target Milestone: | --- | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | spacewalk-web-1.7.28-31 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-11-26 07:46:37 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 819027 | ||
|
Description
Jay Dobies
2009-03-16 20:12:59 UTC
Note about reproducing -- a push has to be initiated to see the issue. If you just enable monitoring and scount, the page /network/monitoring/scout/index.pxt loads OK. The full traceback is:
[Thu Nov 08 17:28:21 2012] [error] Execution of /var/www/html/network/monitoring/scout/index.pxt failed at Thu Nov 8 17:28:21 2012: Cannot determine local time zone
at /usr/lib/perl5/site_perl/5.8.8/DateTime/TimeZone/Local.pm line 27
DateTime::TimeZone::Local::local_time_zone() called at /usr/lib/perl5/site_perl/5.8.8/DateTime/TimeZone.pm line 54
DateTime::TimeZone::new('undef', 'name', 'local') called at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/DateTime.pm line 1523
DateTime::set_time_zone('DateTime=HASH(0x2ad35616bfb0)', 'local') called at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/DateTime.pm line 451
DateTime::from_epoch('undef', 'epoch', 1352391915, 'time_zone', 'local') called at /usr/lib/perl5/vendor_perl/5.8.8/RHN/Date.pm line 65
RHN::Date::new('undef', 'string', '2012-11-08 17:25:15', 'user', 'RHN::User=HASH(0x2ad354e376c0)') called at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB/User.pm line 428
RHN::DB::User::convert_time('RHN::User=HASH(0x2ad354e376c0)', '2012-11-08 17:25:15', '0.000000 %r %Z') called at /usr/lib/perl5/vendor_perl/5.8.8/Sniglets/ListView/ScoutList.pm line 65
Sniglets::ListView::ScoutList::row_callback('Sniglets::ListView::ScoutList=HASH(0x2ad355bda440)', 'HASH(0x2ad355bede60)', 'PXT::Request=HASH(0x2ad337abf7d0)') called at /usr/lib/perl5/vendor_perl/5.8.8/Sniglets/ListView/List.pm line 1017
Sniglets::ListView::List::render('Sniglets::ListView::ScoutList=HASH(0x2ad355bda440)', 'PXT::Request=HASH(0x2ad337abf7d0)') called at /usr/lib/perl5/vendor_perl/5.8.8/Sniglets/Lists.pm line 119
Sniglets::Lists::listview('PXT::Request=HASH(0x2ad337abf7d0)', 'mode', 'scouts_all', 'class', 'Sniglets::ListView::ScoutList', '__block__', '\\x{a} <formvars>\\x{a} <var name="set_label" type="literal">sc...') called at /usr/lib/perl5/vendor_perl/5.8.8/PXT/Parser.pm line 160
PXT::Parser::expand_tag('PXT::Parser=HASH(0x2ad354fd9570)', 'rhn-listview', 'CODE(0x2ad355ba6700)', 'SCALAR(0x2ad349022870)', 'PXT::Request=HASH(0x2ad337abf7d0)') called at /usr/lib/perl5/vendor_perl/5.8.8/PXT/Parser.pm line 72
PXT::Parser::expand_tags('PXT::Parser=HASH(0x2ad354fd9570)', 'SCALAR(0x2ad349022870)', 'PXT::Request=HASH(0x2ad337abf7d0)') called at /usr/lib/perl5/vendor_perl/5.8.8/PXT/ApacheHandler.pm line 489
PXT::ApacheHandler::pxt_parse_data('PXT::ApacheHandler', 'PXT::Request=HASH(0x2ad337abf7d0)', 'SCALAR(0x2ad349022870)') called at /usr/lib/perl5/vendor_perl/5.8.8/PXT/ApacheHandler.pm line 103
eval {...} called at /usr/lib/perl5/vendor_perl/5.8.8/PXT/ApacheHandler.pm line 103
PXT::ApacheHandler::handler('Apache2::RequestRec=SCALAR(0x2ad355063fb0)') called at -e line 0
eval {...} called at -e line 0
[Thu Nov 08 17:28:21 2012] [error] Traceback sent to root@localhost at /usr/lib/perl5/vendor_perl/5.8.8/PXT/ApacheHandler.pm line 563.
Patch for the scout/index.pxt page:
diff --git a/web/modules/rhn/RHN/Date.pm b/web/modules/rhn/RHN/Date.pm
index 5df2daa..ebef623 100644
--- a/web/modules/rhn/RHN/Date.pm
+++ b/web/modules/rhn/RHN/Date.pm
@@ -34,6 +34,11 @@ sub new {
my $class = shift;
my %params = validate(@_, { -now => 0, -epoch => 0, -string => 0, -user => 0, from_zone => 0, source => 0 });
+ my $time_zone = 'local';
+ if ($params{user}) {
+ $time_zone = $params{user}->get_timezone;
+ }
+
my $dt;
if (exists $params{source}) {
my $from = $params{source};
@@ -50,19 +55,19 @@ sub new {
$dt = $from->clone;
}
elsif (exists $params{now}) {
- $dt = DateTime->now(time_zone => "local");
+ $dt = DateTime->now(time_zone => $time_zone);
}
elsif (exists $params{epoch}) {
- $dt = DateTime->from_epoch(epoch => $params{epoch}, time_zone => "local");
+ $dt = DateTime->from_epoch(epoch => $params{epoch}, time_zone => $time_zone);
}
elsif (exists $params{string}) {
my $from_zone = $params{from_zone};
if ($from_zone) {
$dt = DateTime->from_epoch(epoch => date_to_epoch($params{string}, $from_zone),
- time_zone => "local");
+ time_zone => $time_zone);
}
else {
- $dt = DateTime->from_epoch(epoch => str2time($params{string}), time_zone => "local");
+ $dt = DateTime->from_epoch(epoch => str2time($params{string}), time_zone => $time_zone);
}
}
else {
@@ -71,10 +76,6 @@ sub new {
my $self = bless { dt => $dt }, $class;
- if ($params{user}) {
- $self->time_zone($params{user}->get_timezone);
- }
-
return $self;
}
Another page that needs to be fixed is /network/systems/details/history/snapshots/rollback.pxt I have a fix. I believe that we will be able to change the Perl code to avoid using DateTime's time_zone local altogether. Making bugzilla public, taking. Fixed in Spacewalk master, 9a6c6950d8d66f61d6f07ad60bcaa9ed020d2e31, 5a0049556ca3b8a9fbaca979b1f659a26d4299a3, 75fe42d376b34c0a0cef0e7371b510346ec721a6, 108d293dd49cd20a8cc18fc47cde762ca258f6e9 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-1486.html |