Bug 796421 - Pools with Duplicate ProductPoolAttributes cannot be deleted
Summary: Pools with Duplicate ProductPoolAttributes cannot be deleted
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: William Poteat
QA Contact: Eric Sammons
URL:
Whiteboard:
Depends On:
Blocks: 809078
TreeView+ depends on / blocked
 
Reported: 2012-02-22 20:38 UTC by Andrew Edwards
Modified: 2016-04-18 06:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 809078 (view as bug list)
Environment:
Last Closed: 2012-07-17 13:04:01 UTC


Attachments (Terms of Use)
stack trace of hibernate exception for constraint violation (8.84 KB, application/octet-stream)
2012-02-22 20:38 UTC, Andrew Edwards
no flags Details

Description Andrew Edwards 2012-02-22 20:38:38 UTC
Created attachment 565095 [details]
stack trace of hibernate exception for constraint violation

Description of problem:
If a pool has duplicate ProductPoolAttributes it can not be deleted via the DELETE pool api method or via refresh pools.

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

How reproducible:
100%

Steps to Reproduce:
1. Create a new pool
2. Create a ProductPoolAttribute and set pool_id to the previously created pool
3. Duplicate the created ProductPoolAttribute and change the id
4. call DELETE /pools/{pool_id}
  
Actual results:
hibernate raises constraint violation (see attached)

Expected results:
pool is deleted.

Additional info:
if you were to call GET /pools/{pool_id} you will only see one of the attributes created. I think this may be the root of the problem since hibernate may only be trying to delete one of the attributes. When it attempts to save this state back to the database the existing ProductPoolAttribute complains.

Comment 1 Andrew Edwards 2012-02-22 20:43:15 UTC
To be clear, this is a problem we can see in QA,STAGE, PROD environments. We have not determined how the ProductPoolAttributes were duplicated but many of our pools have this issue.

Comment 2 William Poteat 2012-04-02 12:06:52 UTC
commit bbc8359d0d1fb9fba8837f838e8c00eb3c62e152 on master.

This fix will allow the pool to be deleted even if duplicate attributes have been created. 

A separate bug will be set up to cover the problem of the attributes creation.

Comment 3 Bryan Kearney 2012-07-17 13:04:01 UTC
Marking all community bugs modified or beyong as closed.


Note You need to log in before you can comment on or make changes to this bug.