Bug 826995
Summary: | Problem when an old bundle version is deleted | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [JBoss] JBoss Operations Network | Reporter: | bkramer <bkramer> | ||||||||||
Component: | Provisioning | Assignee: | John Mazzitelli <mazz> | ||||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | ||||||||||
Severity: | high | Docs Contact: | |||||||||||
Priority: | urgent | ||||||||||||
Version: | JON 3.0.1 | CC: | klaus.erber, loleary, mazz, vnguyen | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | JON 3.1.1 | ||||||||||||
Hardware: | All | ||||||||||||
OS: | All | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | 826998 | ||||||||||||
: | 828905 916380 (view as bug list) | Environment: | |||||||||||
Last Closed: | 2013-09-11 11:01:50 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: | 826998 | ||||||||||||
Bug Blocks: | 828905, 916380 | ||||||||||||
Attachments: |
|
Description
bkramer
2012-05-31 11:43:55 UTC
No help make this issue clear and better define, 'deploy' and 'deployed' as mentioned in comment #0 refers to the actual creation of the bundle and its versions. i.e. uploading a bundle ZIP containing version 1, then uploading a bundle ZIP that contains version 2, deleting bundle version 1, then uploading a bundle ZIP that contains version 3. Additionally, it appears that the upload and creation of bundle version 3 is successful but nothing is displayed in the UI due to the duplicate rows as described in comment #0. This means version 3 can not be deployed to a destination because the bundle is no longer available from the UI. However, if you create bundle version 4, the versions become visible again in the UI and the UI error goes away. Once version 4 has been created the rhq_bundle_version table looks like: Results for statement 1 of 1: SELECT name, version, version_order FROM rhq_bundle_version WHERE name = 'base_jee_test' name version version_order base_jee_test 1.0.1-SNAPSHOT 1 base_jee_test 1.0.2-SNAPSHOT 1 base_jee_test 1.0.3-SNAPSHOT 2 name version version_order Query Time=1 To provide even further details and correct a statement from comment #1: > ...This means version 3 can not be deployed to a destination because the bundle is no longer available from the UI.... You actually can still deploy the version to a destination. You just don't see the bundle listed on the Bundles (http://localhost:7080/coregui/#Bundles) page and you see mentioned error message in the UI. However, the navigation tree does not seem to be affected. You can still expand and select Destinations from the navigation tree and deploy the bundle via the destination page. Not sure what other issues these duplicate version_order rows will cause. Perhaps reverting to a previous version will be broken? for the record, there is this unit test: org.rhq.enterprise.server.bundle.BundleManagerBeanTest.testCreateBundleVersionOrdering() that we can add to in order to check for this condition (unfortunately, it currently does not test for the case when the bundle version is deleted, which is why we didn't catch this bug). git commit to master: f364f5f this also updates the unit tests in BundleManagerBeanTest to confirm the fix. for this BZ, we need to remember to cherry pick that commit to the proper jon 3.1.1 branch commit to release/jon3.1.x branch: b42e0606e6c048b36632b40691facfd6b2487390 JON 3.1.1 ER1 build is available. Moving to ON_QA. https://brewweb.devel.redhat.com/buildinfo?buildID=226942 Created attachment 603086 [details]
rhq-server-log
Created attachment 603087 [details]
test-bundle-v1
Created attachment 603088 [details]
test-bundle-v2
I was able to reproduce in 3.1.0. In 3.1.1.ER1 JON UI won't let me upload version 2 of the bundle "Failed to create destination, it may already exist. (Note, for an existing destination deploy from the Destination view)" see attached log and test bundles ** correction ** I can upload new versions. It's 'deploy' that I was having trouble with. I couldn't seem to deploy new version to the same destination. verified. Disregard my previous comments (#10 and #11) if you think you have this problem, run this manual SQL query to find out which bundle versions are duplicated: select name, version_order, count(version_order) from rhq_bundle_version t1 group by name, version_order having count(version_order) > 1; this will tell you which bundle name has more than one bundle version with the same version_order. These are the rows you need to manually update - either delete the from the UI or do a manual SQL UPDATE to fix the rows so you have monotonically increasing version_order values starting at 0. Created attachment 703675 [details] CLI script to tell you what UPDATE SQL to execute to fix attached is a .js RHQ CLI script that you can use to determine if you need to run any SQL UPDATE commands to fix your DB due to this bug. You will only need to worry about this if you deleted bundles while running an RHQ version that had this bug. When you run this, it will look at all your bundle versions and try to determine what rows need to be fixed. At the end of the run, it will spit out a list of all UPDATE SQL statements you must execute on your DB to fix up the data. A run will look something like this: rhqadmin@localhost:7080$ exec -f BZ826995.js ______ Bundle: Small Bundle (10001) Bundle Version: 1.0 [1] (10001) UPDATE RHQ_BUNDLE_VERSION SET VERSION_ORDER=0 WHERE ID=10001 Bundle Version: 1.5 [1] (10002) Bundle Version: 3.0 [2] (10003) ______ Bundle: My Simple WAR Application (10002) Bundle Version: 1.0 [0] (10004) Bundle Version: 2.0 [1] (10005) ======== Execute these SQL UPDATE statements: ======== UPDATE RHQ_BUNDLE_VERSION SET VERSION_ORDER=0 WHERE ID=10001 Created attachment 703676 [details] CLI script to tell you what UPDATE SQL to execute to fix slightly fix script - have it output the SQL with ";" at the end of each line. When you run this script, you can easily copy-n-paste the UPDATE SQL statements into: http://localhost:7080/coregui/CoreGUI.html#Test/ServerAccess/SQL and click press the "Execute SQL" button. |