Bug 805212

Summary: Group: Operations portlet fails to load data if Oracle is used on the back-end due to 0 length rhq_config_property.string_value for OPERATION_STATUS being treated as NULL
Product: [Other] RHQ Project Reporter: bkramer <bkramer>
Component: Core UIAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: 4.2CC: hrupp, jsanda, jshaughn, loleary
Target Milestone: ---   
Target Release: RHQ 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-01 06:19:08 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 735475, 805210    

Description bkramer 2012-03-20 12:47:56 EDT
Description of problem:

When navigating to the Group View summary page there is continuous "Loading
data..." message on the Group Operations portlet.

When trying to get the portlet settings the following exceptions are thrown:

Message : Globally uncaught exception 
Severity : Error  

Time : Friday, March 16, 2012 1:53:55 PM Etc/GMT-1 
Detail : com.google.gwt.core.client.JavaScriptException:(TypeError): Für
die Eigenschaft "length" kann kein Wert abgerufen werden: Das Objekt ist
Null oder undefiniert
description: Für die Eigenschaft "length" kann kein Wert abgerufen
werden: Das Objekt ist Null oder undefiniert
number: -2146823281--- STACK TRACE FOLLOWS ---(TypeError): Für die
Eigenschaft "length" kann kein Wert abgerufen werden: Das Objekt ist
Null oder undefiniert
description: Für die Eigenschaft "length" kann kein Wert abgerufen
werden: Das Objekt ist Null oder undefiniert
number: -2146823281


Message : Failure in datasource while processing FETCH request. 
Severity : Error  

Time : Friday, March 16, 2012 1:55:40 PM Etc/GMT-1 
Detail : com.google.gwt.core.client.JavaScriptException:(TypeError): Für
die Eigenschaft "length" kann kein Wert abgerufen werden: Das Objekt ist
Null oder undefiniert
description: Für die Eigenschaft "length" kann kein Wert abgerufen
werden: Das Objekt ist Null oder undefiniert
number: -2146823281--- STACK TRACE FOLLOWS ---(TypeError): Für die
Eigenschaft "length" kann kein Wert abgerufen werden: Das Objekt ist
Null oder undefiniert
description: Für die Eigenschaft "length" kann kein Wert abgerufen
werden: Das Objekt ist Null oder undefiniert
number: -2146823281

The following SQL:

select c.* 
from   rhq_dashboard_portlet p inner join rhq_config_property c 
       on p.configuration_id = c.configuration_id inner join rhq_dashboard d 
       on p.dashboard_id = d.id inner join rhq_subject s on d.subject_id = s.id 
where  s.name = 'rhqadmin' and p.name = 'Group: Operations'


returns null for the OPERATION_STATUS property value.


Version-Release number of selected component (if applicable):
RHQ 4.2

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 bkramer 2012-03-20 12:49:14 EDT
JON bugzilla for the same issue: 

https://bugzilla.redhat.com/show_bug.cgi?id=805210
Comment 2 Mike Foley 2012-03-26 11:55:33 EDT
per BZ triage ... make this a high.

JON had no locale requirements.

So these are not release blocking for JON.
Comment 3 Larry O'Leary 2012-03-26 12:17:15 EDT
Please note that the locale requirement mentioned in Comment 2 is assuming that this issue is actually due to locale support.
Comment 4 Jay Shaughnessy 2012-03-27 09:22:39 EDT
Looking at this portlet it doesn't have the "unlimited" configuration value
that was causing the "locale" issue in some other portlets.  Having said
that, I haven't reproduced in any simple way, with a single element
group and the default locale.

Has anyone reproduce this?
Comment 5 Jay Shaughnessy 2012-03-27 14:54:59 EDT
master commit 8ffe2a02a8a8fb6b12e78ea02b3c4ee588c82fd7

I couldn't reproduce the issue directly but I did find a few problems in
the portlet which I fixed here.  I think it's likely that the problem
will be solved by these fixes.  Primarily, it adds support in this portlet
and others to better handle having all of the enum filter values (in this
case the operation status enums) unset. Also, changes in config were not
being applied to the current instantiation of the portlet.

A workaround for existing, problematic portlets is to delete it and then add 
it back using "Edit Mode" and "Add Portlet".

Test Notes:
Make sure you try the global/group/resource level operation history portlets.
Alter various config and make sure it affects the current portlet and
is also stored properly (leave global dash or the detail view, and then
and come back and see if it is correct).
Comment 6 Larry O'Leary 2012-04-10 23:11:02 EDT
This issue is a direct result of Oracle and its VARCHAR2 type treating null and
empty string as one in the same and returning null in both cases. This was
originally reported in Bug 536526.

The fix for this needs to be to handle the null values returned properly (i.e.
we can not use empty string as a valid/meaningful value as it will be no
different then null).
Comment 7 Charles Crouch 2012-04-16 10:14:02 EDT
Interesting/worrying https://bugzilla.redhat.com/show_bug.cgi?id=805210#c7
Comment 8 Jay Shaughnessy 2012-04-16 15:30:04 EDT
master commit 246d533ac9d1ff238f52b643696f7f362823e606

Cleaned up a bunch of dangerous code in the portlets including several
instances of where we didn't handle the null returning from oracle when
storing "" for a varchar2 field.


Test Notes:
This will be a bit tedious, but test the configuration of all portlets,
at the global, resource and group dashboards, on oracle (especially) and
postgres.  Make changes to result counts, metric ranges, and any enumerated
filters (like Alert priorty, operation status, etc). For the enumerated
filters ensure you set all,some and none (note - when unchecking all of the
enumerated values the filter should go back to checking all of them.
Comment 9 Heiko W. Rupp 2013-09-01 06:19:08 EDT
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.