Bug 804139 - Bundle deploy error, fails SHA256 check
Summary: Bundle deploy error, fails SHA256 check
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Provisioning
Version: 4.4
Hardware: Unspecified
OS: Unspecified
urgent
medium
Target Milestone: ---
: JON 3.1.0
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon310-sprint11, rhq44-sprint11
TreeView+ depends on / blocked
 
Reported: 2012-03-16 15:48 UTC by Mike Foley
Modified: 2013-09-03 15:15 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-03 15:15:13 UTC
Embargoed:


Attachments (Terms of Use)
sample bundle (472 bytes, application/zip)
2012-03-16 15:49 UTC, Mike Foley
no flags Details
server log (209.85 KB, text/x-log)
2012-03-16 15:49 UTC, Mike Foley
no flags Details
screenshot of client (82.60 KB, image/png)
2012-03-16 15:50 UTC, Mike Foley
no flags Details

Description Mike Foley 2012-03-16 15:48:29 UTC
Description of problem:  Bundle deploy error, fails SHA256 check


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


How reproducible:
100%


Steps to Reproduce:
1. create group.  i created a group with 1 platform, my linux box
2. basic simple bundle deployment use-case...i am deploying to /home/mfoley/mybundledeploy2
3. deployment fails.  see screenshot.  see server log.  
  
Actual results:


Deployment failed: java.lang.Exception:Package version [PackageVersion[package=Package[name=a.txt,packageType=PackageType[id=10031,name=My Bundle 1297957137903,resourceType=Ant Bundle Handler]],version=1.0,architecture=Architecture: name=[noarch]]] failed SHA256 check. expected=[42144f3939c3ffbbf0bf8b1f12affb5c23a4c5bd41e0ff672d54a5754f062058], actual=[5e7995610bdefd0a9515a92e153f9587a7fdeca216a6c30cbaba0bd0080a698f]



Expected results:

successful deployment

Additional info:

attachments:  sample bundle, server log, screenshot of client

Comment 1 Mike Foley 2012-03-16 15:49:00 UTC
Created attachment 570638 [details]
sample bundle

Comment 2 Mike Foley 2012-03-16 15:49:37 UTC
Created attachment 570639 [details]
server log

Comment 3 Mike Foley 2012-03-16 15:50:06 UTC
Created attachment 570640 [details]
screenshot of client

Comment 4 Mike Foley 2012-03-16 15:51:01 UTC
1st error in server log


2012-03-16 11:42:49,926 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1, SQLState: 23000
2012-03-16 11:42:49,926 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: unique constraint (RHQ.RHQ_BUNDLE_DESTINATION_UNIQUE) violated

2012-03-16 11:42:49,927 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with

Comment 5 John Mazzitelli 2012-03-23 21:02:22 UTC
the bundle file is called "a.txt" whose content is "a=b".

but when the agent streams it down, the content of the file is "a=btyBlob"

I searched the codebase for "tyBlob" and here's what I find:

     /**
      *  Can be used as initial contents for a PackageVersion's PackageBits whenever a predictable non-null
      *  value is required. Use as an initial value for the PackageBits.blob.bits. The value will
      *  typically be replaced with the actual streamed content bits...<br>
      *  Note: This is a String and not a byte[] because gwt can't handle String.getBytes(). 
      */
     public static final String EMPTY_BLOB = "EmptyBlob";

It seems that:

org.rhq.enterprise.server.content.ContentManagerBean.initializePackageBits(PackageBits)

initializes the content - but if the file content is less than 9 chars, it doesn't clear out the rest!

Comment 6 John Mazzitelli 2012-03-23 21:04:30 UTC
this looks related to bug #611456

Comment 7 John Mazzitelli 2012-03-23 21:31:45 UTC
git commit to master: 0e44e44

please check this against Oracle DB as well as Postgres.

Once you see that this deploys properly, as a final check, DELETE the bundle. (that is, go to the main bundle list view in the GUI, select the test bundle and click the delete button). See that it deletes properly. Again, do this on both Postgres AND Oracle.

Comment 8 Sunil Kondkar 2012-05-15 09:54:31 UTC
Verified on Version: 3.1.0.BETA1 Build Number: 95ef567:68f5518

Uploaded and deployed the attached sample bundle successfully. Also verified that the bundle gets deleted successfully.
Verified on Postgres 8.3.8 and Oracle11G.

Comment 9 Heiko W. Rupp 2013-09-03 15:15:13 UTC
Bulk closing of old issues in VERIFIED state.


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