Bug 1309553 - Failed to register with consumer id against SAM1.4
Failed to register with consumer id against SAM1.4
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.8
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Chris Snyder
John Sefler
: Regression, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-18 00:53 EST by qianzhan
Modified: 2016-05-10 16:40 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 16:40:41 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)
katello-debug-20160218213327.tar.gz (283.26 KB, application/x-gzip)
2016-02-18 21:48 EST, qianzhan
no flags Details
rhsm.log (16.76 KB, text/plain)
2016-02-18 21:49 EST, qianzhan
no flags Details

  None (edit)
Description qianzhan 2016-02-18 00:53:41 EST
Description of problem:
Failed to register with consumer id against SAM1.4

Version-Release number of selected component (if applicable):
subscription-manager: 1.16.8-2.el6
python-rhsm: 1.16.6-1.el6


How reproducible:
Always

Steps to Reproduce:
1. Register system against SAM1.4.
[root@dhcp-129-73 ~]# subscription-manager identity
system identity: eb31655a-afa2-4613-bc2f-a3cdd4fba44f
name: dhcp-129-73.nay.redhat.com
org name: ACME_Corporation
org ID: ACME_Corporation


2. Clean consumer certs
[root@dhcp-129-73 ~]# rm -f /etc/pki/consumer/*

3. Re-register with consumer id:
[root@dhcp-129-73 ~]# subscription-manager register --consumerid=eb31655a-afa2-4613-bc2f-a3cdd4fba44f
Registering to: samserv.redhat.com:443/sam/api
Username: admin
Password: 
'type'

4. Re-register without consumer id:
[root@dhcp-129-73 ~]# subscription-manager register
Registering to: samserv.redhat.com:443/sam/api
Username: admin
Password: 
The system has been registered with ID: 55382f25-51b6-4902-a6dd-2406923f1f66 


Actual results:
As step 3.

Expected results:
Registration with consumer id should be successful.

Additional info:
Comment 2 Barnaby Court 2016-02-18 15:55:56 EST
Please attach the candlepin log file while this error occurred.
Comment 3 qianzhan 2016-02-18 21:48:06 EST
Please see katello-debug info from SAM server: katello-debug-20160218213327.tar.gz

And the rhsm.log from client: rhsm.log
Comment 4 qianzhan 2016-02-18 21:48 EST
Created attachment 1128401 [details]
katello-debug-20160218213327.tar.gz
Comment 5 qianzhan 2016-02-18 21:49 EST
Created attachment 1128402 [details]
rhsm.log
Comment 6 Barnaby Court 2016-02-22 13:20:24 EST
The relevant log entries from rhsm.log:

2016-02-18 19:36:46,614 [DEBUG] subscription-manager:32054 @connection.py:557 - Making request: GET /sam/api/consumers/3faa59c5-3bef-4fd0-ad34-1aaaff55fe06
2016-02-18 19:36:46,828 [DEBUG] subscription-manager:32054 @connection.py:589 - Response: status=200
2016-02-18 19:36:46,829 [WARNING] subscription-manager:32054 @connection.py:593 - Clock skew detected, please check your system time
2016-02-18 19:36:46,835 [ERROR] subscription-manager:32054 @managercli.py:174 - Error during registration: 'type'
2016-02-18 19:36:46,835 [ERROR] subscription-manager:32054 @managercli.py:175 - 'type'
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1084, in _do_command
    if consumer['type']['manifest']:
KeyError: 'type'
Comment 9 Chris Snyder 2016-02-25 17:41:39 EST
Upon further investigation it appears that Sam 1.4 is not returning the consumer type as part of the json returned from calls to /sam/api/consumers/<consumerid>.

The PR above will allow the command to succeed even in the case the json does not include the type but that is not desirable as it would allow users of the latest subman to register as distributors (reintroducing a bug that was previously fixed).

It appears that the version of candlepin included with sam 1.4 has the necessary information as part of its model.

Christine, is there any way that sam could be filtering out the consumer type for some reason?
Comment 10 Chris Snyder 2016-03-05 02:00:48 EST
Vritant and I have accepted the suggested fix for the time being after talking with Christine. I no longer require additional information from her for this issue.
Comment 13 qianzhan 2016-03-07 05:05:46 EST
I will verify it when next RHEL6.8 build comes.
Comment 14 John Sefler 2016-03-08 14:20:49 EST
(In reply to qianzhan from comment #13)
> I will verify it when next RHEL6.8 build comes.

Thank you qianzhan for verifying...  It is now available in build...

[root@jsefler-6 ~]# rpm -q subscription-manager
subscription-manager-1.16.8-4.el6.x86_64
[root@jsefler-6 ~]# rpm -q subscription-manager --changelog | grep 1309553
- 1309553: Do not fail on check for consumer["type"]["manifest"]
Comment 15 qianzhan 2016-03-08 22:27:29 EST
Thanks for John's reminder.

I installed RHEL-6.8-20160308.0, and it's subscription version:

[root@dhcp-128-75 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 1.4.3.28-1.el6sam_splice-Headpin
subscription management rules: Unknown
subscription-manager: 1.16.8-3.el6
python-rhsm: 1.16.6-1.el6

Failed in build RHEL-6.8-20160308.0:
[root@dhcp-128-75 ~]# subscription-manager register --consumerid=eb799120-448c-4350-b0ea-27c7f0ea5162
Registering to: samserv.redhat.com:443/sam/api
Username: admin
Password: 
'type'

So still need to wait for next new build.
Comment 16 John Sefler 2016-03-09 08:52:15 EST
My apologies to qianzhan.  The fixed package is in the nightly compose RHEL-6.8-20160308.n.0 but it is NOT in the rel-eng compose RHEL-6.8-20160308.0.  I agree that we should wait for verification in a rel-eng compose.  Thanks.
Comment 17 qianzhan 2016-03-16 23:17:40 EDT
Verified.

Version-Release number of selected component:
subscription-manager: 1.16.8-5.el6
python-rhsm: 1.16.6-1.el6

Verification:
[root@dhcp-128-48 ~]# subscription-manager register
Registering to: samserv.redhat.com:443/sam/api
Username: admin
Password: 
The system has been registered with ID: 19edb3d4-cffb-4a63-8eb4-df8858899af6 
[root@dhcp-128-48 ~]# rm -f /etc/pki/consumer/*
[root@dhcp-128-48 ~]# subscription-manager register --consumerid=19edb3d4-cffb-4a63-8eb4-df8858899af6
Registering to: samserv.redhat.com:443/sam/api
Username: admin
Password: 
The system has been registered with ID: 19edb3d4-cffb-4a63-8eb4-df8858899af6 


Moving this bug from ON_QA to VERIFIED.
Comment 19 errata-xmlrpc 2016-05-10 16:40:41 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://rhn.redhat.com/errata/RHBA-2016-0797.html

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