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 2225406 - Can not re-register with --force after deleting consumer certs against satellite614
Summary: Can not re-register with --force after deleting consumer certs against satell...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts - Content
Version: 6.14.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 6.14.0
Assignee: Jeremy Lenz
QA Contact: qianzhan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-25 09:14 UTC by qianzhan
Modified: 2023-11-08 14:20 UTC (History)
7 users (show)

Fixed In Version: rubygem-katello-4.9.0.13-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 14:20:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36674 0 Normal New Can not re-register with --force after deleting consumer certs against satellite614 2023-08-11 14:53:58 UTC
Red Hat Issue Tracker CANDLEPIN-640 0 None None None 2023-07-31 15:25:31 UTC
Red Hat Issue Tracker SAT-19378 0 None None None 2023-08-03 13:27:06 UTC
Red Hat Product Errata RHSA-2023:6818 0 None None None 2023-11-08 14:20:21 UTC

Description qianzhan 2023-07-25 09:14:54 UTC
Description of problem:
Can not re-register with --force after deleting consumer certs against satellite614

Version-Release number of selected component (if applicable):
katello-4.9.0-1.el8sat.noarch
candlepin-4.3.1-1.el8sat.noarch

How reproducible:
always

Steps to Reproduce:
1. Register RHEL-8.9.0-20230718.23 against satellite6.14 snap 8.0:

[root@koza-3 ~]# subscription-manager register --username=admin --password=admin  --org=sca_org --environment=Library
Registering to: dell-per740-68-vm-07.lab.eng.pek2.redhat.com:443/rhsm
The system has been registered with ID: e6798835-4cf6-4472-a0f9-c4848bc6e5d8
The registered system name is: koza-3.4a2m.lab.eng.bos.redhat.com

[root@koza-3 ~]# ls /etc/pki/entitlement/
5262642170835786293-key.pem  5262642170835786293.pem

[root@koza-3 ~]# ls /etc/pki/consumer/
cert.pem  key.pem


2. Remove the consumer certs, and re-register with --force:

[root@koza-3 ~]# rm -rf /etc/pki/consumer/*

[root@koza-3 ~]# ls /etc/pki/consumer/

[root@koza-3 ~]# subscription-manager register --force --username=admin --password=admin  --org=sca_org --environment=Library
Registering to: dell-per740-68-vm-07.lab.eng.pek2.redhat.com:443/rhsm
Unit e6798835-4cf6-4472-a0f9-c4848bc6e5d8 has been deleted (HTTP error code 410: Gone)



3. Check the rhsm.log:
2023-07-25 05:03:55,584 [INFO] subscription-manager:76316:MainThread @managerlib.py:72 - Consumer created: koza-3.4a2m.lab.eng.bos.redhat.com (e6798835-4cf6-4472-a0f9-c4848bc6e5d8)
2023-07-25 05:04:01,131 [INFO] subscription-manager:76316:MainThread @entcertlib.py:132 - certs updated:
Total updates: 1
Found (local) serial# []
Expected (UEP) serial# [5262642170835786293]
Added (new)
  [sn:5262642170835786293 ( Content Access,) @ /etc/pki/entitlement/5262642170835786293.pem]
Deleted (rogue):
  <NONE>
2023-07-25 05:05:33,424 [ERROR] subscription-manager:76549:MainThread @managercli.py:2043 - HTTP error (410 - Gone): Unit e6798835-4cf6-4472-a0f9-c4848bc6e5d8 has been deleted
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2040, in _do_command
    service_level=self.options.service_level,
  File "/usr/lib64/python3.6/site-packages/rhsmlib/services/register.py", line 111, in register
    jwt_token=jwt_token
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 1211, in registerConsumer
    return self.conn.request_post(url, params, headers=headers)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 992, in request_post
    return self._request("POST", method, params, headers=headers)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 1022, in _request
    info=info, headers=headers, cert_key_pairs=cert_key_pairs)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 870, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 914, in validateResponse
    parsed['deletedId'])
rhsm.connection.GoneException: HTTP error (410 - Gone): Unit e6798835-4cf6-4472-a0f9-c4848bc6e5d8 has been deleted
[root@koza-3 ~]# 

Actual results:
As step 2, re-register failed.

Expected results:
Re-register should succeed.

Additional info:
It is successful to re-register rhel against satellite6.13:

(1)
katello-4.7.0-1.el8sat.noarch
candlepin-4.2.15-1.el8sat.noarch

(2)
[root@sweetpig-21 ~]# subscription-manager register --username=admin --password=admin  --org=sca_org --environment=Library
Registering to: dell-per740-68-vm-05.lab.eng.pek2.redhat.com:443/rhsm
The system has been registered with ID: 8aa64c47-a8ad-494a-8d7a-4301f0f1bde5
The registered system name is: sweetpig-21.4a2m.lab.eng.bos.redhat.com

[root@sweetpig-21 ~]# ls /etc/pki/consumer/
cert.pem  key.pem
[root@sweetpig-21 ~]# rm -rf /etc/pki/consumer/*

[root@sweetpig-21 ~]# subscription-manager register --force --username=admin --password=admin  --org=sca_org --environment=Library

Registering to: dell-per740-68-vm-05.lab.eng.pek2.redhat.com:443/rhsm
The system has been registered with ID: 23d75fed-3cf1-4432-bc45-ed4a08339f6b
The registered system name is: sweetpig-21.4a2m.lab.eng.bos.redhat.com
1 local certificate has been deleted.

[root@sweetpig-21 ~]# subscription-manager  identity
system identity: 23d75fed-3cf1-4432-bc45-ed4a08339f6b
name: sweetpig-21.4a2m.lab.eng.bos.redhat.com
org name: sca_org
org ID: sca_org
environment name: Library

Comment 2 Leos Stejskal 2023-08-01 05:54:25 UTC
I think it's a valid issue, if the user is re-registering the host we should not care about previous certificates.
Can you please upload logs from the Satellite?

Comment 3 qianzhan 2023-08-01 08:05:51 UTC
Hi Leos, please check attachment 'sosreport-satellite614-2023-08-01-smhixfx.tar.xz'

Comment 5 Leos Stejskal 2023-08-02 08:06:34 UTC
From a quick look the error is coming from Candlepin:
```
2023-08-01T03:47:13 [E|app|b2a936fe] RestClient::Gone: Katello::Resources::Candlepin::Consumer: 410 Gone {"displayMessage":"Unit e712063a-c5f6-47e4-a848-2fa8d7b8915f has been deleted","requestUuid":"c933aafd-6c6a-48cf-a700-5d0f09b8f1c1","deletedId":"e712063a-c5f6-47e4-a848-2fa8d7b8915f"} (PUT /candlepin/consumers/e712063a-c5f6-47e4-a848-2fa8d7b8915f)
 b2a936fe | Body: {"displayMessage":"Unit e712063a-c5f6-47e4-a848-2fa8d7b8915f has been deleted","requestUuid":"c933aafd-6c6a-48cf-a700-5d0f09b8f1c1","deletedId":"e712063a-c5f6-47e4-a848-2fa8d7b8915f"}
 b2a936fe | 
```

Comment 11 Jeremy Lenz 2023-08-11 14:53:57 UTC
Created redmine issue https://projects.theforeman.org/issues/36674 from this bug

Comment 12 Jeremy Lenz 2023-08-11 19:35:46 UTC
Workaround is to run the registration again. It will succeed the second time.

Comment 17 errata-xmlrpc 2023-11-08 14:20:07 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 (Important: Satellite 6.14 security and bug fix update), 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-2023:6818


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