Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Having a content view (CV) published with >40 repositories (the more, the higher probable the bug is) and trying to delete the CV (remove a version promoted to a lifecycle environment, i.e. to Library), there is a probability it will fail due to some candlepin concurrent activity that fails and returns:
Katello::Resources::Candlepin::Environment: 400 Bad Request (DELETE /candlepin/environments/1-35/content?content=2413)
The key problem sounds to be due to the fact candlepin is requested to remove one content (repo in katello words) after another from its environment (candlepin environment is pair CV+lifecycle env.) and deleting the environment at the end. Removing a repo triggers recalculation of certificates/subscriptions that apparently can interfere with the next removal of next piece of content / next repo.
Version-Release number of selected component (if applicable):
Sat6.1.7
katello-2.2.0.18-1.el7sat.noarch
candlepin-0.9.49.11-1.el7.noarch
How reproducible:
50% for CV with 40 repos
(the more repos in the CV, the more probable it is)
Steps to Reproduce:
1. Create a CV with >40 repos
2. publish it
3. Delete the CV / remove version promoted to Library
Actual results:
With some probability, error as above is hit
Expected results:
No such error
Additional info:
(In reply to Pavel Moravec from comment #1)
> Created attachment 1136610[details]
> candlepin.lgo
See timestamp:
2016-03-14 17:01:06,808 [req=b678a64f-6db1-4f61-8411-762bc4b13379, org=Default_Organization] ERROR org.candlepin.common.exceptions.mappers.CandlepinExceptionMapper - Runtime Error Error while committing the transaction at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched:81
and an attempt to delete environment 1-35 (first by removing individual contents one by one from it).
From Candlepin logs, I can see that there are interleaved calls [1][3] to DELETE the environment [0]. Because request [1] finishes at [4], the request [2] is trying to delete something that is already deleted
In other words, the problem is that the caller who is issuing duplicit deletes to [0]. These deletes must be issued concurrently by the client (or by multiple clients), otherwise it would be impossible to interleave them (client would wait for one of [1] and [3] to finish)
[0] 1-35/content?content=2413
[1]
2016-03-14 17:01:06,692 [req=2e896897-5dcf-4432-952c-8f318b70cca4, org=] INFO org.candlepin.common.filter.LoggingFilter - Request: verb=DELETE, uri=/candlepin/environments/1-35/content?content=2413
[2]
2016-03-14 17:01:06,692 [req=b98b8e29-e4f0-4069-893e-46818b9147e9, org=Default_Organization] INFO org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=24
[3]
2016-03-14 17:01:06,713 [req=b678a64f-6db1-4f61-8411-762bc4b13379, org=] INFO org.candlepin.common.filter.LoggingFilter - Request: verb=DELETE, uri=/candlepin/environments/1-35/content?content=2413
[4]
2016-03-14 17:01:06,792 [req=2e896897-5dcf-4432-952c-8f318b70cca4, org=Default_Organization] INFO org.candlepin.common.filter.LoggingFilter - Response: status=202, content-type="application/json", time=100
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.
https://access.redhat.com/errata/RHBA-2016:1501