Red Hat Bugzilla – Bug 1575140
Cannot delete host when missing from the candlepin database
Last modified: 2018-10-18 12:49:30 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
Upstream bug assigned to jsherril@redhat.com
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23489 has been resolved.
Verified with Sat 6.4 snap 13. Used reproducer from OP, the host got deleted, no traceback.
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
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.
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
*** Bug 1609066 has been marked as a duplicate of this bug. ***