Bug 612115

Summary: Provisioning: Unable to upgrade/revert bundle to a latest/previous version at same Root Deployment Directory
Product: [Other] RHQ Project Reporter: Sudhir D <sdharane>
Component: ProvisioningAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: medium Docs Contact:
Priority: urgent    
Version: 3.0.0CC: jshaughn
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:56:20 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: 601949    

Description Sudhir D 2010-07-07 10:54:32 UTC
Description of problem:
Unable to upgrade/revert bundle to a latest/previous version at same path

Version-Release number of selected component (if applicable):
jon-server-2.4.0.GA_QA Build# 51

How reproducible:
Always

Steps to Reproduce:
1. Go to Administration->Content->Bundles
2. Select the existing bundle
3. Click on Deploy.
4. Provide the existing Root Deployment directory where we want to upgrade/revert the bundle to latest/previous version.
  
Actual results:
Throws constraint voilation error.

Expected results:
In place upgrade/degrade of version should be allowed.

Additional info:
log snippet:

java.lang.Exception: java.lang.RuntimeException:javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.transaction.RollbackException:[com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update -> org.hibernate.exception.ConstraintViolationException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch entry 0 insert into RHQ_BUNDLE_DESTINATION (NAME, DESCRIPTION, DEPLOY_DIR, CTIME, MTIME, BUNDLE_ID, GROUP_ID, ID) values ('dhcp6-1.1', NULL, '/root/Desktop/JON/LATEST', '1278479759447', '1278479759447', '10001', '10001', '10013') was aborted. Call getNextException to see the cause.[SQLException=Batch entry 0 insert into RHQ_BUNDLE_DESTINATION (NAME, DESCRIPTION, DEPLOY_DIR, CTIME, MTIME, BUNDLE_ID, GROUP_ID, ID) values ('dhcp6-1.1', NULL, '/root/Desktop/JON/LATEST', '1278479759447', '1278479759447', '10001', '10001', '10013') was aborted. Call getNextException to see the cause. -> ERROR: duplicate key value violates unique constraint "rhq_bundle_destination_unique"(error-code=0,sql-state=23505)]

Comment 1 Jay Shaughnessy 2010-07-07 19:51:11 UTC
fix commit: 91c9d1fb7849b9966f60a2cdeb8bca1903e3389c

The problem here is that the user tried to create the same destination twice. Meaning, A bundle can have multiple destinations, but each must be unique, meaning for a Bundle, two destinations can not have the same deploy directory and target group (of platforms).

Once a destination exists and you want to deploy to it *again*, you do it from the destination view's Deploy button.

I've improved handling of this situation and display a (hopefully) useful message.

Comment 2 Sunil Kondkar 2010-07-08 11:31:52 UTC
Verified on jon-2.4.0.GA_QA build#52

If a destination exists and user tries to upgrade bundle to the same destination, below message is displayed.

"Failed to create destination, it may already exist. (Note, for an existing destination deploy from the Destination view)"

Comment 3 Corey Welton 2010-08-12 16:56:20 UTC
Mass-closure of verified bugs against JON.