Bug 813427 - JDBC error when trying to delete org.
JDBC error when trying to delete org.
Product: Red Hat Satellite 6
Classification: Red Hat
Component: WebUI (Show other bugs)
Unspecified Unspecified
high Severity high (vote)
: Unspecified
: --
Assigned To: Justin Sherrill
Corey Welton
Depends On:
Blocks: 812346
  Show dependency treegraph
Reported: 2012-04-17 14:28 EDT by Corey Welton
Modified: 2013-03-27 16:32 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-05-15 14:59:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
relevant catalina log (217.66 KB, application/octet-stream)
2012-04-17 14:32 EDT, Corey Welton
no flags Details

  None (edit)
Description Corey Welton 2012-04-17 14:28:13 EDT
Discovered when trying to test bug #812346. I have repeated this four times in a row -- three after having created environments (per aformentioned bz) and once w/o creating environments 

1. Create org 812346
3. Switch to org 812346; Upload manifest
4. Enable repo 6Server - x86_64 - Red Hat Enterprise Linux 6 Server RPMs x86_64
5. 6Server; do not promote
6. Switch to ACME_Corporation
7. Attempt to delete 812346
8. Navigate around the UI a bit, or perhaps just try to create another org (812346_new or what have you).  

Current result:

Org delete is scheduled for background deletion
Upon attempting to delete org:

Candlepin::Content: 500 Internal Server Error {"displayMessage":"Runtime Error
Could not execute JDBC batch update at
(DELETE /candlepin/content/861)

At this point, the org has disappeared from the UI, but still exists in the
background - and user cannot use the manifest from before, as CFSE thinks the
manifest is still in use.


Expected result:
* Org is deleted
* If org fails to be deleted, we don't end up in a wedged state.

Will be attaching relevant tomcat logs

Other notes:
Probably blocks testing for bug #812346
Comment 1 Corey Welton 2012-04-17 14:32:14 EDT
Created attachment 578120 [details]
relevant catalina log
Comment 2 Corey Welton 2012-04-17 14:36:30 EDT
per jsherrill, this is different than bug #812346, evidenced by the fact that it does not require the creation of environments.
Comment 3 Devan Goodwin 2012-04-18 14:20:48 EDT
Candlepin is refusing to delete the content as a product is still set to reference it. This might be wrong and Candlepin should cleanup any product references, but it also might be acting correctly and preventing the deletion of something that crosses organizations, a RH product for example.

I guess it's a question of what product was still referencing that content?

I would try to look at the results of some SQL queries after this happens:

select * from cp_product_content where content_id = failedID;

Then match up with cp_product and see which product that is, is it something used across orgs? 

If this is custom content involved, and definitely isn't used in another org, then we need to decide if Katello can/should delete the product first, or if Candlepin should clean up the references automatically. Given the global nature of products though I am tempted to leave the restriction in place and see if we can't get Katello doing product delete prior to content delete.

(bearing in mind content can be shared by multiple products, used by subscriptions in multiple orgs)
Comment 4 Justin Sherrill 2012-04-18 15:24:36 EDT
some information:  

    candlepin=# select * from cp_product_content where content_id = '861';
    product_id | content_id | enabled | created | updated
    RH0103708 | 861 | f | |
    (1 row)
    candlepin=# select name from cp_product where id = 'RH0103708';
    Red Hat Enterprise Linux Server, Premium (8 sockets) (Up to 4 guests)
    (1 row)
Comment 5 Justin Sherrill 2012-04-19 14:54:01 EDT
katello fix:


no longer deleting content objects from candlepin in the case of a redhat consumer.  We still disassociate the content from the product in all cases.
Comment 6 Justin Sherrill 2012-04-19 15:00:05 EDT
actually that was the incorrect hash, still waiting on ack.
Comment 7 Justin Sherrill 2012-04-19 16:15:45 EDT
fixed in katello:

Comment 10 Corey Welton 2012-04-23 11:33:16 EDT
QA Verified in latest brewroot - CloudForms System Engine Version: 0.1.311-1.el6_2
Comment 11 errata-xmlrpc 2012-05-15 14:59:38 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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