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.
Bug 1730146 - subscription-manager fails: HTTP error (422 - Unknown): Please unregister or remove hosts which match this host before registering: <hostname>
Summary: subscription-manager fails: HTTP error (422 - Unknown): Please unregister or ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Registration
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.6.0
Assignee: Jonathon Turel
QA Contact: Stephen Wadeley
URL:
Whiteboard:
: 1717006 1730145 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-16 01:39 UTC by Jonathon Turel
Modified: 2023-10-06 18:25 UTC (History)
17 users (show)

Fixed In Version: tfm-rubygem-katello-3.12.0.12-1
Doc Type: If docs needed, set a value
Doc Text:
Attempting to re-register hosts that have been previously registered may result in an error. These hosts' records may need to be deleted via the UI or hammer before being able to be re-registered.
Clone Of:
: 1732891 1757096 (view as bug list)
Environment:
Last Closed: 2019-10-22 19:49:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27251 0 Normal Closed subscription-manager fails: HTTP error (422 - Unknown): Please unregister or remove hosts which match this host before r... 2021-01-22 14:40:08 UTC
Red Hat Knowledge Base (Solution) 4419651 0 None None None 2019-10-10 08:54:15 UTC

Description Jonathon Turel 2019-07-16 01:39:38 UTC
Foreman: 1.22.0
Katello: 3.12.0

While I've been working towards migrating from Spacewalk/RHSat5, I've been rebuilding hosts left & right.  I've been making changes to the host records in TFM/Katello, triggering a host build, downloading a boot ISO, and rebuilding in place.  The redhat-register provisioning template has been able to re-register and connect the host record.

Now, I'm finding that this registration is failing.  Adding a --force option doesn't seem to make a difference:

root@<host> ~]# subscription-manager register --force --name="<FQhostname>" --org='Organization' --activationkey='dev-centos7,dev-mondorescue-el7'
HTTP error (422 - Unknown): Please unregister or remove hosts which match this host before registering: <FQhostname>
[root@<hostname> ~]# subscription-manager unregister
This system is currently not registered.
[root@<hostname> ~]# subscription-manager register --force --name="<FQhostname>" --org='Land_O_Lakes' --activationkey='dev-centos7,dev-mondorescue-el7'
HTTP error (422 - Unknown): Please unregister or remove hosts which match this host before registering: <FQhostname>

jturel suggested running "hammer host subscription unregister host <FQhostname>" on the TFM/Katello host prior to the rebuild.  This work-around now lets me successfully register the host in place.

What other data or logs can I supply?  /var/log/rhsm/* doesn't seem to supply much detail beyond the above.

Comment 1 Jonathon Turel 2019-07-16 01:39:41 UTC
Created from redmine issue https://projects.theforeman.org/issues/27251

Comment 2 Jonathon Turel 2019-07-16 01:39:43 UTC
Upstream bug assigned to None

Comment 3 Jonathon Turel 2019-07-16 01:41:29 UTC
The same error can also be seen in the logs when the host is being rebuilt. The fix will likely involve triggering an unregister before the rebuild.

Comment 5 Bryan Kearney 2019-07-16 02:03:18 UTC
Upstream bug assigned to jturel

Comment 6 Brad Buckingham 2019-07-16 17:26:04 UTC
*** Bug 1730145 has been marked as a duplicate of this bug. ***

Comment 7 Brad Buckingham 2019-07-22 21:05:58 UTC
*** Bug 1717006 has been marked as a duplicate of this bug. ***

Comment 8 Brad Buckingham 2019-07-22 21:07:05 UTC
Please refer to associated duplicates for more instances of this error and additional details.

- bug 1717006
- bug 1730883

Comment 9 Jonathon Turel 2019-07-24 16:12:33 UTC
The upstream PR has the testing steps outlined: https://github.com/Katello/katello/pull/8232

Let me know if I can clarify on anything and I can update the PR to serve as the authoritative test plan for this change.

Comment 10 Bryan Kearney 2019-07-29 14:03:15 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27251 has been resolved.

Comment 14 Jonathon Turel 2019-08-16 17:07:10 UTC
Hi Hradayesh,

I will need to understand more about the specific issue you're looking into. The reason is that the error message mentioned in the bug title is 100% absolutely valid. The problem was that it was shown in some undesired circumstances. Without knowing more about the case you are working on it's hard to say whether it's expected behavior or a bug. It's also possible that you're running into https://bugzilla.redhat.com/show_bug.cgi?id=1739367

Do you have a link to a case or other supporting information on exactly the reproduction steps in your/customer's case?

Comment 19 Stephen Wadeley 2019-08-27 11:57:40 UTC
Hello

 Assignee: Jonathon Turel put test steps here:

https://github.com/Katello/katello/pull/8232#issue-300732659

Comment 27 Bryan Kearney 2019-10-22 19:49:22 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.

https://access.redhat.com/errata/RHSA-2019:3172


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