Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 2046516

Summary: subscription-manager unable to register RHEL9 host with activation key - Unauthorized
Product: Red Hat Enterprise Linux 9 Reporter: Roman Plevka <rplevka>
Component: subscription-managerAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.0CC: arpandey, csnyder, jhnidek, jsefler, redakkan, swadeley
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 9.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.29.25-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 15:58:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
rhsm.log none

Description Roman Plevka 2022-01-26 20:54:47 UTC
Created attachment 1855633 [details]
rhsm.log

Description of problem:
Host registration with activation-key does not work with


# subscription-manager register --activationkey vZfbLVti --org ezgMZbwwbkl
Unauthorized: Invalid credentials for request.

RHSM issues a GET request to rhsm/owners/ezgMZbwwbkl/environments 
and gets 401.

Registration with user and password seems to work fine.



Version-Release number of selected component (if applicable):
Sat7.0 snap 7.0
subscription-manager-1.29.23-1.el9.x86_64
RHEL-9.0.0-20220118.1

How reproducible:
always

Additional info:
the full traceback from rhsm.log is uploaded as attachment

Comment 1 Pino Toscano 2022-01-28 10:21:15 UTC
Thanks Roman for the bug report.

This is indeed a subscription-manager regression, so I'm reassigning it to the right product/component; we'll try to get to it soon.

Comment 3 Archana Pandey 2022-02-16 07:06:19 UTC
Pre-verifying on jenkins build

Reproducer:
[root@kvm-04-guest05 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.12-1
subscription management rules: 5.41
subscription-manager: 1.29.23-1.el9
[root@kvm-04-guest05 ~]# 

Register to a candlepin server with 'environments' variable-
[root@kvm-04-guest05 ~]# subscription-manager register --activationkey act_key_test --org ****
Invalid credentials. (HTTP error code 401: Unauthorized)


===============================================================

Steps to verify:

upgrading build to latest jenkins sub-man build-

[root@kvm-04-guest05 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.22-1
subscription management rules: 5.41
subscription-manager: 1.29.25-1.git.0.307da3b.el9


[root@kvm-04-guest05 ~]# 
[root@kvm-04-guest05 ~]# subscription-manager register --activationkey act_key_test --org *****
The system has been registered with ID: d3d03ddd-f948-4e07-b621-c71cdd517ca8
The registered system name is: kvm-04-guest05.hv2.lab.eng.bos.redhat.com                   <<<<<<<<<<<< Successfully registered the system using activation key
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Not Subscribed                                                    

Unable to find available subscriptions for all your installed products.


Verification : Passed

Comment 6 Archana Pandey 2022-02-21 15:46:20 UTC
verifying on nightly build with sub-man subscription-manager-1.29.26-1.el9.x86_64


steps to verify-

register the system to server with  'environments' resources using activation key and org 

[root@kvm-02-guest09 ~]# 
[root@kvm-02-guest09 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.22-1
subscription management rules: 5.41
subscription-manager: 1.29.26-1.el9
[root@kvm-02-guest09 ~]# 
[root@kvm-02-guest09 ~]# rpm -qa --changelog subscription-manager | grep 2046516
- 2046516: register: do not check environments w/ activation keys
[root@kvm-02-guest09 ~]# 
[root@kvm-02-guest09 ~]# subscription-manager register --activationkey test_act_key --org snowwhite
The system has been registered with ID: 8ee2e8e6-d090-4b09-ae9a-f076a8bfdd40
The registered system name is: kvm-02-guest09.lab.eng.rdu2.redhat.com                        <<<<<<<<<< successfully register system using activation key
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Not Subscribed

Unable to find available subscriptions for all your installed products.              
[root@kvm-02-guest09 ~]# 

verification : PASSED

Comment 8 errata-xmlrpc 2022-05-17 15:58:31 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 (new packages: subscription-manager), 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-2022:3984