Bug 1129480
| Summary: | subscription-manager register --activationkey fails to provide authentication to /owner/$id/environments | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Tom McKay <tomckay> |
| Component: | subscription-manager | Assignee: | Bryan Kearney <bkearney> |
| Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.6 | CC: | bkearney, jesusr, jsherril, omaciel, tlavigne |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause:
subscription-manager inspecting environments url when activation key given
Consequence:
subscription-manager fails to provide authentication to environments.
Fix:
Do not inspect environments when activation key is given.
Result:
Using activation key with subscription-manager will properly execute the activation key sequence.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-10-14 07:48:18 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1014343, 1129454 | ||
|
Description
Tom McKay
2014-08-12 21:02:06 UTC
note that sub-man should not even hit /owner/$id/environments when using an activation key commit 55bce8772ec6917d9174f50687ccc817953c4e75
Author: ckozak <ckozak>
Date: Tue Aug 12 10:48:08 2014 -0400
1129480: don't query envs when actkey is given
Reproducing the failure with version (and rhsm.conf properly configured to connect to a Satellite 6 server)....
[root@jsefler-6 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 1.5.0-30.el6sat-Katello
subscription management rules: 5.11
subscription-manager: 1.12.10-1.el6
python-rhsm: 1.12.5-1.el6
[root@jsefler-6 ~]# subscription-manager register --org="Default_Organization" --activationkey="ak-rhel-6-x86_64"
[root@jsefler-6 ~]#
^^ FAILURE: expected feedback stating a successful registration and attached subscriptions from the valid org and activationkey
[root@jsefler-6 ~]# tail -f /var/log/rhsm/rhsm.log
2014-09-09 11:42:12,218 [DEBUG] subscription-manager @connection.py:414 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-stage.pem, redhat-uep.pem, candlepin-local.pem, katello-server-ca.pem, jsefler-f14-candlepin.pem
2014-09-09 11:42:12,219 [DEBUG] subscription-manager @connection.py:446 - Making request: GET /rhsm/owners/Default_Organization/environments
2014-09-09 11:42:12,328 [DEBUG] subscription-manager @connection.py:469 - Response: status=401
2014-09-09 11:42:12,332 [ERROR] subscription-manager @managercli.py:1049 -
Traceback (most recent call last):
File "/usr/share/rhsm/subscription_manager/managercli.py", line 1038, in _do_command
self.options.environment)
File "/usr/share/rhsm/subscription_manager/managercli.py", line 1133, in _get_environment_id
env_list = cp.getEnvironmentList(owner_key)
File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 1095, in getEnvironmentList
results = self.conn.request_get(method)
File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 550, in request_get
return self._request("GET", method)
File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 478, in _request
self.validateResponse(result, request_type, handler)
File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 520, in validateResponse
raise RestlibException(response['status'], error_msg)
RestlibException
CONFIRMED: The original failure is reproducable
Now let's verify the fix in the next comment with a corrected version of subscription-manager package...
Verifying Version... [root@jsefler-6 ~]# subscription-manager version server type: This system is currently not registered. subscription management server: 1.5.0-30.el6sat-Katello subscription management rules: 5.11 subscription-manager: 1.12.14-5.el6 python-rhsm: 1.12.5-1.el6 [root@jsefler-6 ~]# subscription-manager register --org="Default_Organization" --activationkey="ak-rhel-6-x86_64" The system has been registered with ID: ed20d688-9f31-42f0-8c97-2424ebb1b259 Installed Product Current Status: Product Name: Red Hat Enterprise Linux Server Status: Subscribed [root@jsefler-6 ~]# subscription-manager identity system identity: ed20d688-9f31-42f0-8c97-2424ebb1b259 name: jsefler-6.usersys.redhat.com org name: Default_Organization org ID: Default_Organization environment name: DEV/RHEL_6_x86_64 [root@jsefler-6 ~]# subscription-manager list --consumed | grep "Subscription Name:" Subscription Name: Red Hat Employee Subscription Subscription Name: Agent Subscription Name: Forge NOTE: The three subscriptions attached came from the activationkey that was created during the setup of the Satellite 6 server (details not shown). VERIFIED: register with activationkey successfully attaches expected subscription from the activation key and registers to the expected org and environment. Additional Sanity Testing....
Let's also verify that we can still register to the org and environment without the activationkey...
[root@jsefler-6 ~]# subscription-manager unregister
System has been unregistered.
[root@jsefler-6 ~]# subscription-manager register
Username: admin
Password:
Environment: DEV/RHEL_6_x86_64
The system has been registered with ID: 6824827c-8e7b-441b-b7d9-7e50094c8de6
[root@jsefler-6 ~]#
[root@jsefler-6 ~]# subscription-manager identity
system identity: 6824827c-8e7b-441b-b7d9-7e50094c8de6
name: jsefler-6.usersys.redhat.com
org name: Default_Organization
org ID: Default_Organization
environment name: DEV/RHEL_6_x86_64
[root@jsefler-6 ~]#
VERIFIED: Notice that we were not prompted for an org (because there is only one) while we were prompted for an environment (because there are more than one).
[root@jsefler-6 ~]# subscription-manager orgs
Username: admin
Password:
+-------------------------------------------+
admin Organizations
+-------------------------------------------+
Name: Default_Organization
Key: Default_Organization
[root@jsefler-6 ~]# subscription-manager environments
Username: admin
Password:
Organization: Default_Organization
+-------------------------------------------+
Environments
+-------------------------------------------+
Name: DEV/RHEL_7_x86_64
Description:
Name: Library/RHEL_7_x86_64
Description:
Name: DEV/RHEL_6_i386
Description:
Name: Library/RHEL_6_i386
Description:
Name: DEV/RHEL_6_x86_64
Description:
Name: Library/RHEL_6_x86_64
Description:
Name: Library
Description:
[root@jsefler-6 ~]#
*** Bug 1129454 has been marked as a duplicate of this bug. *** 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. http://rhn.redhat.com/errata/RHBA-2014-1384.html |