Bug 815869

Summary: Trying to delete a Dynagroup Definition gives db constraint errors
Product: [JBoss] JBoss Operations Network Reporter: dsteigne
Component: Resource GroupingAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: high    
Version: JON 3.0.1CC: gluszczy, hrupp, jshaughn, loleary, skondkar
Target Milestone: ---   
Target Release: JON 3.1.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 817604 (view as bug list) Environment:
Last Closed: 2013-09-11 11:03:23 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: 817604    
Bug Blocks:    

Description dsteigne 2012-04-24 17:22:04 UTC
Description of problem:
I created a new dynagroup with the follow customized expression:
"resource.name.endsWith = .sh"

Recursive flag is checked and recalculation interval is 0.
Now I can't delete this group. JON server shows above: "Failed to delete the selected group definitions"
Here is the stacktrace tail:

"Message: Failed to delete the selected group definitions
Severity :	
Error

Time :	
Thursday, April 19, 2012 2:31:11 PM Etc/GMT+3
Detail :	
java.lang.RuntimeException:[1334856671827] 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 delete from RHQ_RESOURCE_GROUP where ID='10131' was aborted.  Call getNextException to see the cause.[SQLException=Batch entry 0 delete from RHQ_RESOURCE_GROUP where ID='10131' was aborted.  Call getNextException to see the cause. -> ERROR: update or delete on table "rhq_resource_group" violates foreign key constraint "rhq_resource_group_cluster_resource_group_id_fkey" on table "rhq_resource_group"
  Detail: Key (id)=(10131) is still referenced from table "rhq_resource_group".(error-code=0,sql-state=23503)]

Somehow a cluster group was created, I had to manually delete the cluster group and the main group definition from rhq_resource_group


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

Comment 1 Charles Crouch 2012-04-30 16:02:21 UTC
Moving sprint tracker bug to upstream issue

Comment 2 Jay Shaughnessy 2012-05-08 15:44:20 UTC
upstream fixed. waiting on 3.1 branch.

Comment 3 Charles Crouch 2012-05-21 01:31:58 UTC
This was fixed in release/jon3.1.x here

http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=2f9c4823ea11cfdc6f289d865661b06ed4063c6d

Its available in any recent JON3.1 ER build so pushing this to ONQA

Comment 4 Sunil Kondkar 2012-06-07 11:48:40 UTC
Verified on Version: 3.1.0.CR3 Build Number: 1ceb7bf:74870eb

Created a dynagroup with customized expression:
"resource.name.endsWith = .sh" 
checked Recursive flag and set recalculation interval is 0.

Deleted the dynagroup successfully and no errors are observed. also verified deleting dynagroups after changing the dynagroup name and expression.