Bug 556848

Summary: Cannot delete RHN repo
Product: [Other] RHQ Project Reporter: Corey Welton <cwelton>
Component: ContentAssignee: Jay Dobies <jason.dobies>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: jason.dobies, pkilambi
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:45:26 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: 538145    

Description Corey Welton 2010-01-19 15:43:06 UTC
Description of problem:

User gets db error when trying to delete content providers

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


How reproducible:
Every time, I think

Steps to Reproduce:
1. Create an RHN Content provider
2. Import a channel repo.
3. Delete Channel Repo
4. Attempt to delete Content Provider
  
Actual results:

Failed to delete content providers. Cause: javax.ejb.EJBException:javax.persistence.EntityExistsException: org.hibernate.exception.ConstraintViolationException: could not execute update query -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: could not execute update query -> org.hibernate.exception.ConstraintViolationException:could not execute update query -> org.postgresql.util.PSQLException:ERROR: update or delete on table "rhq_package_version" violates foreign key constraint "rhq_advisory_package_package_version_id_fkey" on table "rhq_advisory_package" Detail: Key (id)=(10004) is still referenced from table "rhq_advisory_package".[SQLException=ERROR: update or delete on table "rhq_package_version" violates foreign key constraint "rhq_advisory_package_package_version_id_fkey" on table "rhq_advisory_package" Detail: Key (id)=(10004) is still referenced from table "rhq_advisory_package".]

Expected results:

CP can be deleted.

Additional info:

Comment 1 Jay Dobies 2010-02-10 21:19:52 UTC
Commit dbc2429e2a4c6eb03109ded64d30a104490c4623

Advisory.java
AdvisoryPackage.java
ContentSourceManagerBean.java
ContentSourceRepoFlowTest.java

Need to make sure we delete orphaned advisories when deleting orphaned packages.

Comment 2 Corey Welton 2010-02-12 17:09:41 UTC
QA Verified.

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