Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1418455 - unable to unregister host if candlepin record is missing
unable to unregister host if candlepin record is missing
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hosts (Show other bugs)
6.2.7
Unspecified Unspecified
high Severity medium (vote)
: 6.2.9
: Unused
Assigned To: Chris Duryee
jcallaha
: Triaged
Depends On: 1419985
Blocks: 1426417
  Show dependency treegraph
 
Reported: 2017-02-01 16:28 EST by Chris Duryee
Modified: 2017-06-27 08:40 EDT (History)
19 users (show)

See Also:
Fixed In Version: tfm-rubygem-katello-3.0.0.115-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1426417 (view as bug list)
Environment:
Last Closed: 2017-05-01 09:58:50 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)
verification screenshot (51.77 KB, image/png)
2017-04-10 13:45 EDT, jcallaha
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2991221 None None None 2017-04-04 05:51 EDT
Red Hat Product Errata RHBA-2017:1191 normal SHIPPED_LIVE Satellite 6.2.9 Async Bug Release 2017-05-01 13:49:42 EDT

  None (edit)
Description Chris Duryee 2017-02-01 16:28:21 EST
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 16:11:35 EST
Please add verifications steps for this bug to help QE verify
Comment 5 Chris Duryee 2017-03-01 13:03:59 EST
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 13:44:50 EDT
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 13:45 EDT
Created attachment 1270547 [details]
verification screenshot
Comment 14 satish sherkar 2017-04-24 17:33:13 EDT
Hello Team,

Is there any workaround for this?
Comment 15 Nithin Thomas 2017-04-24 21:31:24 EDT
Hi Satish,

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

Regards,
Nithin
Comment 18 errata-xmlrpc 2017-05-01 09:58:50 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-2017:1191

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