Bug 1418455 - unable to unregister host if candlepin record is missing
Summary: unable to unregister host if candlepin record is missing
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.2.7
Hardware: Unspecified
OS: Unspecified
Target Milestone: Unspecified
Assignee: Chris Duryee
QA Contact: jcallaha
Depends On: 1419985
Blocks: 1426417
TreeView+ depends on / blocked
Reported: 2017-02-01 21:28 UTC by Chris Duryee
Modified: 2020-07-16 09:10 UTC (History)
19 users (show)

Fixed In Version: tfm-rubygem-katello-
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1426417 (view as bug list)
Last Closed: 2017-05-01 13:58:50 UTC
Target Upstream Version:

Attachments (Terms of Use)
verification screenshot (51.77 KB, image/png)
2017-04-10 17:45 UTC, jcallaha
no flags Details

System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2991221 0 None None None 2017-04-04 09:51:58 UTC
Red Hat Product Errata RHBA-2017:1191 0 normal SHIPPED_LIVE Satellite 6.2.9 Async Bug Release 2017-05-01 17:49:42 UTC

Description Chris Duryee 2017-02-01 21:28:21 UTC
Description of problem:

downstream-only bug! do not clone. This is already fixed upstream via a larger refactor. Its very likely not worth cherrypicking the entire change for this.

In certain cases, users may have hosts that are registered in Katello but not Candlepin. This typically occurs due to bugs related to registration.

When this happens, the host cannot be removed from Katello. There is some code that checks for the host's entitlements, but if it gets a 404 from Candlepin, it will error with the following:

RestClient::ResourceNotFound: Katello::Resources::Candlepin::CandlepinResource: 404 Resource Not Found {"displayMessage":"Runtime Error RESTEASY001185: Could not find resource for relative : /consumers//entitlements of full path: https://localhost:8443/candlepin/consumers//entitlements at org.jboss.resteasy.core.registry.PathParamSegment.matchPattern:209","requestUuid":"e7511d96-c594-48b2-b572-f5cb1eddd579"} (GET /candlepin/consumers//entitlements)

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

How reproducible: every time

Steps to Reproduce:
1. load database with affected records
2. attempt to delete host via foreman-rake console

Actual results: error

Expected results: successful unregister

Additional info:

Comment 4 pm-sat@redhat.com 2017-02-23 21:11:35 UTC
Please add verifications steps for this bug to help QE verify

Comment 5 Chris Duryee 2017-03-01 18:03:59 UTC
repro steps:

NOTE: the repro steps involve causing some data corruption to occur!

* create fresh satellite, register one host
* log into postgres db (sudo su - postgres; psql candlepin)

* run this sql:
delete from cp_consumer_facts;
delete from cp_installed_products ;
delete from cp_consumer;

* now, attempt to delete host via web UI

without the patch, this will fail and the host will stick around. With the patch, you'll still get an error raised in the web UI, but the delete will succeed.

Comment 12 jcallaha 2017-04-10 17:44:50 UTC
Verified in Satellite 6.2.9 Snap 2.

Followed the steps outlined in #5, but was more selective with the cp_consumer delete. The host deletion task still produced an error, as expected (see attached), however the host was deleted. To get past the paused deletion task, you can go into the dynflow console, skip the "Actions::Candlepin::Consumer::Destroy" step, then navigate back to the task and click resume.

Comment 13 jcallaha 2017-04-10 17:45:47 UTC
Created attachment 1270547 [details]
verification screenshot

Comment 14 satish sherkar 2017-04-24 21:33:13 UTC
Hello Team,

Is there any workaround for this?

Comment 15 Nithin Thomas 2017-04-25 01:31:24 UTC
Hi Satish,

Please refer the below KCS:
==> https://access.redhat.com/solutions/2991221


Comment 18 errata-xmlrpc 2017-05-01 13:58:50 UTC
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.