Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1575140 - Cannot delete host when missing from the candlepin database
Cannot delete host when missing from the candlepin database
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hosts - Content (Show other bugs)
6.3.1
Unspecified Unspecified
unspecified Severity medium (vote)
: 6.3.4
: Unused
Assigned To: Justin Sherrill
Lukáš Hellebrandt
: Reopened, Triaged
: 1609066 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-04 16:52 EDT by David Kaylor
Modified: 2018-10-18 12:49 EDT (History)
22 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1609066 1624019 (view as bug list)
Environment:
Last Closed: 2018-10-16 14:56:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3424791 None None None 2018-07-11 05:09 EDT
Foreman Issue Tracker 23489 None None None 2018-05-14 16:24 EDT
Red Hat Product Errata RHBA-2018:2550 None None None 2018-08-22 16:07 EDT

  None (edit)
Description David Kaylor 2018-05-04 16:52:54 EDT
Description of problem:
If a host cannot be found in the candlepin database, attempting to delete this host will fail with an error similar to the following:

Katello::Resources::Candlepin::Consumer: 404 Resource Not Found {"displayMessage":"Consumer with id e7d9a1f4-51f7-4b9a-b92b-43f72ce371de could not be found.","requestUuid":"22fcfb9a-6e57-46ca-8e39-184ec57035c2"} (DELETE /candlepin/consumers/e7d9a1f4-51f7-4b9a-b92b-43f72ce371de) 

Katello::Resources::Candlepin::Consumer: 404 Resource Not Found {"displayMessage":"Consumer with id d346d3f2-a287-4e55-8a93-eec225495245 could not be found.","requestUuid":"614508bb-5b43-4ac4-9768-ad82a884dfbb"} (DELETE /candlepin/consumers/d346d3f2-a287-4e55-8a93-eec225495245)

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

How reproducible:

The customer is not sure how the host got into its current state. I was able to reproduce it by manually deleting candlepin records from the database.


Steps to Reproduce:
1. Register a content host to Satellite
2. Connect to the candlepin database and run queries to delete the consumer. Example:

delete from cp_consumer_facts where cp_consumer_id = '4028fcae632b664d01632cc5dffd0000';
delete from cp_ent_certificate where entitlement_id in (select id from  cp_entitlement where consumer_id = '4028fcae632b664d01632cc5dffd0000');
delete from cp_entitlement where consumer_id = '4028fcae632b664d01632cc5dffd0000';
delete from cp_installed_products where consumer_id = '4028fcae632b664d01632cc5dffd0000';
delete from cp_consumer where id = '4028fcae632b664d01632cc5dffd0000';

3. Attempt to delete the host via the web UI or hammer

Actual results:
Host is not deleted and an error is received

Expected results:
Host is deleted

Additional info:
We also tried using the following but it did not help:

# foreman-rake katello:clean_backend_objects COMMIT=true
# foreman-rake katello:reimport
Comment 3 pm-sat@redhat.com 2018-05-14 18:07:34 EDT
Upstream bug assigned to jsherril@redhat.com
Comment 4 pm-sat@redhat.com 2018-05-14 18:07:37 EDT
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23489 has been resolved.
Comment 13 Lukáš Hellebrandt 2018-07-26 07:43:14 EDT
Verified with Sat 6.4 snap 13.

Used reproducer from OP, the host got deleted, no traceback.
Comment 17 errata-xmlrpc 2018-08-22 16:07:12 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.

https://access.redhat.com/errata/RHBA-2018:2550
Comment 18 Mike McCune 2018-08-28 16:48:43 EDT
This bug was mistakenly added to https://access.redhat.com/errata/RHBA-2018:2550 6.3.3 but was not shipped in that update.

We will be releasing this in 6.3.4 and making a hotfix available here for anyone on 6.3.3 who needs this fix.
Comment 23 Bryan Kearney 2018-10-16 14:56:44 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.

https://access.redhat.com/errata/RHSA-2018:2927
Comment 24 Mike McCune 2018-10-18 12:49:30 EDT
*** Bug 1609066 has been marked as a duplicate of this bug. ***

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