Bug 734881

Summary: Failed to generate Drift Diff
Product: [Other] RHQ Project Reporter: Mike Foley <mfoley>
Component: driftAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.1CC: jsanda
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 19:28:55 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: 707225    
Attachments:
Description Flags
image of error
none
client-side error
none
server-side log (see the end of this file) none

Description Mike Foley 2011-08-31 18:19:12 UTC
Created attachment 520873 [details]
image of error

Description of problem:  Failed to generate Drift Diff


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


How reproducible:
100%


Steps to Reproduce:
1.  Drift, History, View Diff

  
Actual results:
error, see attached.  

Expected results:


Additional info:

Comment 1 Mike Foley 2011-08-31 18:19:37 UTC
Created attachment 520874 [details]
client-side error

Comment 2 Mike Foley 2011-08-31 18:20:09 UTC
Created attachment 520875 [details]
server-side log (see the end of this file)

Comment 3 John Sanda 2011-08-31 19:29:25 UTC
I am able to generate and view a diff without error. I need more details and steps to reproduce.

Comment 4 Mike Foley 2011-08-31 19:49:01 UTC
Steps to reproduce:
click on Inventory top-level menu
<mfoley_> click on Platforms on the right side under Resources
<mfoley_> click on my Linux box ... which is the only platform ... which is named foleymonsterbox1
<mfoley_> click on the Drift tab
<mfoley_> click on History
<mfoley_> there is only 1 item in Drift History ... click on it
<mfoley_> and then click View Diff

Comment 5 John Sanda 2011-09-01 02:49:47 UTC
After working on this with Mike, we discovered that this appears to be oracle specific. If generate drift on an empty file, the blob field in the rhq_drift_file table where the bits are stored is null. When you try to open and read an input stream from the blob with oracle, it results in the NPE originally reported. This however does not happen with postgresql. 

To work around this, we now check the file/content size before accessing the blob. If the size is zero, an empty string is returned. It also should be noted that before this fix, we were not storing the size, but we are now. There is a column for it in rhq_drift_file.

commit hash: b6125949237abceab2abd2fcee70f339f12c4fa6

Comment 6 Mike Foley 2011-09-02 14:47:36 UTC
verified RHQ 4.1 release candidate.

Comment 7 Mike Foley 2012-02-07 19:28:55 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE