Bug 1264218 - Invalid Timezone: xyz ( [vm_infra/perf_chart_chooser] error when any non-default time profile is selected for C&U charts
Invalid Timezone: xyz ( [vm_infra/perf_chart_chooser] error when any non-defa...
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS (Show other bugs)
Unspecified Unspecified
high Severity medium
: GA
: 5.5.0
Assigned To: Harpreet Kataria
Dave Johnson
Depends On:
  Show dependency treegraph
Reported: 2015-09-17 18:25 EDT by Nandini Chandra
Modified: 2015-12-08 08:31 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-08 08:31:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nandini Chandra 2015-09-17 18:25:40 EDT
Description of problem:
I ran into this issue while verifying 

The following error is seen on the UI when when any non-default time profile is selected for C&U charts.In this case,I had a Time profile with the Eastern Time
time zone.

Error text:

Invalid Timezone: Eastern Time (US [vm_infra/perf_chart_chooser] 

Version-Release number of selected component (if applicable):
CFME 5.5

How reproducible:

Steps to Reproduce:
1.Create a time profile with any time zone.
2.Enable 'Roll up daily performance' for the time profile.
3.Add any infra/cloud provider and enable C&U collection for the provider.
4)View C&U daily charts for VMs,hosts etc.While viewing the C&U charts,select the newly created time profile.

Actual results:
Error occurs

Expected results:
No errors

Additional info:
Snippet from production.log:

[----] I, [2015-09-17T18:03:02.952511 #20188:a3d98c]  INFO -- : Started POST "/vm_infra/perf_chart_chooser/1000000000064" for at 2015-09-17 18:03:02 -0400
[----] I, [2015-09-17T18:03:03.026341 #20188:a3d98c]  INFO -- : Processing by VmInfraController#perf_chart_chooser as JS
[----] I, [2015-09-17T18:03:03.026562 #20188:a3d98c]  INFO -- :   Parameters: {"time_profile"=>"1000000000002", "id"=>"1000000000064"}
[----] F, [2015-09-17T18:03:03.108447 #20188:a3d98c] FATAL -- : Error caught: [ArgumentError] Invalid Timezone: Eastern Time (US
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/core_ext/time/zones.rb:72:in `rescue in find_zone!'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/core_ext/time/zones.rb:56:in `find_zone!'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/core_ext/date_and_time/zones.rb:20:in `in_time_zone'
/var/www/miq/vmdb/app/controllers/application_controller/performance.rb:203:in `perf_set_or_fix_dates'
/var/www/miq/vmdb/app/controllers/application_controller/performance.rb:40:in `perf_chart_chooser'
/opt/rh/cfme-gemset/gems/actionpack-4.2.4/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/opt/rh/cfme-gemset/gems/actionpack-4.2.4/lib/abstract_controller/base.rb:198:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-4.2.4/lib/action_controller/metal/rendering.rb:10:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-4.2.4/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:117:in `call'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:117:in `call'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:505:in `call'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:505:in `call'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/cfme-gemset/gems/actionpack-4.2.4/lib/abstract_controller/callbacks.rb:19:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-4.2.4/lib/action_controller/metal/rescue.rb:29:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-4.2.4/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/notifications.rb:164:in `block in instrument'
Comment 3 Nick Carboni 2015-09-21 13:10:33 EDT
Looks like the issue is html escaping the time zone string.  After creating a time profile with the "Eastern Time (US & Canada)" the time zone in the database shows ":tz: 'Eastern Time (US '" (in the time_profiles table) which causes the issue with the in_time_zone function call.

Was able to successfully run through these steps with a time zone with no html escapable strings (e.g. "Hawaii").
Comment 5 CFME Bot 2015-10-01 18:56:16 EDT
New commit detected on ManageIQ/manageiq/master:

commit 6e8fac094d48e26d2ae7e2c95effa5744a73d219
Author:     Harpreet Kataria <hkataria@redhat.com>
AuthorDate: Wed Sep 30 13:41:36 2015 -0400
Commit:     Harpreet Kataria <hkataria@redhat.com>
CommitDate: Wed Sep 30 13:41:36 2015 -0400

    escape selected value in bootstrap selects before sending them to server
    No need to escape drop down values and encodeURI before sending up to server.

 app/assets/javascripts/miq_application.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 7 Nandini Chandra 2015-10-09 19:09:14 EDT
Verified in
Comment 9 errata-xmlrpc 2015-12-08 08:31:08 EST
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.


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