Bug 1092507

Summary: Globally uncaught exception when selecting an area which doesn't contain data in unfolded graph
Product: [Other] RHQ Project Reporter: Filip Brychta <fbrychta>
Component: Core UIAssignee: Mike Thompson <mithomps>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.11CC: hrupp, mithomps, skondkar
Target Milestone: ---   
Target Release: RHQ 4.11   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-21 10:13:28 UTC Type: Bug
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: 1134445    
Attachments:
Description Flags
screen shot
none
screenshot-Exception
none
Stack_Trace none

Description Filip Brychta 2014-04-29 13:06:01 UTC
Created attachment 890789 [details]
screen shot

Description of problem:
This issue occurs when you select some area in graph without any data, but it can occure (which is more likely) when you select some area with data on certain metric and then you unfold differend graph in which given range doesn't contain any data. 

Version-Release number of selected component (if applicable):
Version :	
4.11.0-SNAPSHOT
Build Number :	
e686783

How reproducible:
Always

Steps to Reproduce:
1. navigate to platform resource->Monitoring->Metrics
2. unfold some graph and select any area which doesn't contain any data (see attached screen shot)


Actual results:
Message :	
Globally uncaught exception
Severity :	
Error
	
Time :	
Tuesday, April 29, 2014 2:46:20 PM UTC+2
Root Cause :	
(TypeError) : lowestValue is null
Detail :	

com.google.gwt.core.client.JavaScriptException:(TypeError) : lowestValue is null
--- STACK TRACE FOLLOWS ---
(TypeError) : lowestValue is null
   at Unknown.$getJsonMetrics(Unknown Source)
   at Unknown.getJsonMetrics(Unknown Source)
   at Unknown.$drawJsniChart_0(Unknown Source)
   at Unknown.run_34(Unknown Source)
   at Unknown.fire_1(Unknown Source)
   at Unknown.createTimeout/<(Unknown Source)
   at Unknown.apply(Unknown Source)
   at Unknown.entry0(Unknown Source)
   at Unknown.entry_0/<(Unknown Source)
   at Unknown.anonymous(Unknown Source)

Expected results:
No errors

Comment 1 Sunil Kondkar 2014-04-29 15:49:15 UTC
Another way I reproduced the Globally uncaught exception:

1. Navigate to a resource ( RHQ AGENT)
2. Navigate to Monitoring->Metrics tab
3. Unfold the metric 'Agent-Server clock difference'
4. click on the time range '1m' or '3m'( range having no data )
5. It display Globally uncaught exception in UI

There are no errors in server log and agent log

Please refer the attached screenshot for exception and the stack trace in message center.

Comment 2 Sunil Kondkar 2014-04-29 15:50:07 UTC
Created attachment 890853 [details]
screenshot-Exception

Comment 3 Sunil Kondkar 2014-04-29 15:50:41 UTC
Created attachment 890854 [details]
Stack_Trace

Comment 4 Mike Thompson 2014-04-29 17:29:33 UTC
Good catch, although this is not particularly useful thing to do as you are zooming in on a part of the graph where there exists no data. If an time range is selected with no valid values (all NaN) then the lowestValue is null (as shown in the stack trace) because a lowestValue could not be selected. The fix is to simply default the units to definition.getUnits() if no  value records were found in the graph data.

Comment 5 Mike Thompson 2014-04-29 17:37:09 UTC
Committed to master:

commit 17239b3b948a8c2b05a21bd87d25aeed7217020f
Author: Mike Thompson <mithomps>
Date:   Tue Apr 29 10:34:00 2014 -0700

    [BZ 1092507] Globally uncaught exception when selecting an area which doesn't contain data in unfolded graph. Zooming in on range of no data (NaN) causes the lowestValue to become null because there is no low value (there are no valid values at all). This scenario was solved by assigning the measurement definition UOM when no valid values are available.

Comment 6 Filip Brychta 2014-04-30 06:39:23 UTC
Verified on
Version :	
4.11.0-SNAPSHOT
Build Number :	
bc47bf3

Comment 7 Heiko W. Rupp 2014-07-21 10:13:28 UTC
Bulk closing of RHQ 4.11 issues, now that RHQ 4.12 is out.

If you find an issue with those, please open a new BZ, linking to the old one.