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
Created attachment 570638 [details] sample bundle
Created attachment 570639 [details] server log
Created attachment 570640 [details] screenshot of client
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
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!
this looks related to bug #611456
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.
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.
Bulk closing of old issues in VERIFIED state.