Bug 1329588

Summary: Error when regenerating identity cert
Product: Red Hat Satellite Reporter: qianzhan
Component: APIAssignee: David Davis <daviddavis>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, lpramuk, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-3.0.0.48-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:11:43 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 qianzhan 2016-04-22 09:59:13 UTC
Description of problem:
Error when regenerating identity cert

Version-Release number of selected component (if applicable):
Satellite-6.2.0-RHEL-6-20160420.1
subscription-manager: 1.16.8-8.el6
python-rhsm: 1.16.6-1.el6

How reproducible:
always

Steps to Reproduce:
1. Register to Satellite.

[root@dhcp-128-71 ~]# subscription-manager register
Registering to: satellite6.redhat.com:443/rhsm
Username: admin
Password: 
Organization: Default_Organization
The system has been registered with ID: 95db5c30-4cc4-40b0-9591-46308165ae26 

[root@dhcp-128-71 ~]# subscription-manager identity
system identity: 95db5c30-4cc4-40b0-9591-46308165ae26
name: dhcp-128-71.nay.redhat.com
org name: Default Organization
org ID: Default_Organization
environment name: Library

[root@dhcp-128-71 ~]# ll /etc/pki/consumer/
total 8
-rw-r-----. 1 root root 1598 Apr 22 02:39 cert.pem
-rw-r-----. 1 root root 1679 Apr 22 02:39 key.pem


2. Regenerate identity.

[root@dhcp-128-71 ~]# subscription-manager identity --regenerate --username=admin --password=admin --force
Runtime Error Cannot consume content type at org.jboss.resteasy.core.registry.Segment.match:117


Actual results: As step 2.


Expected results: Identity certificate should be regenerated successfully.


Additional info: Please see attachment 'rhsm.log'.

Comment 1 qianzhan 2016-04-22 10:00:38 UTC
Created attachment 1149709 [details]
'rhsm.log'

Comment 2 Barnaby Court 2016-04-25 18:34:18 UTC
Looking in the log file I see "RestlibException: undefined method `[]=' for nil:NilClass" which is indicative of an error in the API proxy.

Comment 3 qianzhan 2016-06-01 06:06:03 UTC
Still happens on Satellite-6.2.0-RHEL-7-20160531.0:

[root@hp-z800-01 ~]# subscription-manager identity --regenerate --username=admin --password=admin --force
Runtime Error RESTEASY001055: Cannot consume content type at org.jboss.resteasy.core.registry.Segment.match:118

Comment 5 Partha Aji 2016-06-09 18:16:16 UTC
Created redmine issue http://projects.theforeman.org/issues/15367 from this bug

Comment 6 David Davis 2016-06-10 13:11:23 UTC
Upstream PR:

https://github.com/Katello/katello/pull/6112

Comment 7 qianzhan 2016-06-20 05:44:17 UTC
Moving this bug to VERIFIED:

Version-Release number of selected component (if applicable):
Satellite-6.2.0-RHEL-6-20160616.0
subscription-manager: 1.16.8-8.el6
python-rhsm: 1.16.6-1.el6

[root@dell-per720xd-01 ~]# subscription-manager identity
system identity: c41d1f93-c211-4d06-a923-d52c1fa75afd
name: dell-per720xd-01.rhts.eng.bos.redhat.com
org name: Default Organization
org ID: Default_Organization
environment name: Library

[root@dell-per720xd-01 ~]# ll /etc/pki/consumer/
total 8
-rw-r-----. 1 root root 1700 Jun 20 01:38 cert.pem
-rw-r-----. 1 root root 1675 Jun 20 01:38 key.pem

[root@dell-per720xd-01 ~]# subscription-manager identity --regenerate --username=admin --password=admin --force
Identity certificate has been regenerated.

[root@dell-per720xd-01 ~]# tail -f /var/log/rhsm/rhsm.log2016-06-20 01:41:35,554 [INFO] subscription-manager:22934 @connection.py:815 - Connection built: host=satellite-158ae8768bca4f3da15a61092ac2d0e2.novalocal port=443 handler=/rhsm auth=identity_cert ca_dir=/etc/rhsm/ca/ verify=False
2016-06-20 01:41:35,555 [INFO] subscription-manager:22934 @connection.py:815 - Connection built: host=satellite-158ae8768bca4f3da15a61092ac2d0e2.novalocal port=443 handler=/rhsm auth=none
2016-06-20 01:41:35,585 [INFO] subscription-manager:22934 @managercli.py:342 - Consumer Identity name=dell-per720xd-01.rhts.eng.bos.redhat.com uuid=c41d1f93-c211-4d06-a923-d52c1fa75afd
2016-06-20 01:41:35,585 [INFO] subscription-manager:22934 @connection.py:815 - Connection built: host=satellite-158ae8768bca4f3da15a61092ac2d0e2.novalocal port=443 handler=/rhsm auth=basic username=admin
2016-06-20 01:41:35,588 [DEBUG] subscription-manager:22934 @connection.py:509 - Loaded CA certificates from /etc/rhsm/ca/: katello-server-ca.pem, redhat-uep.pem, katello-default-ca.pem
2016-06-20 01:41:35,589 [DEBUG] subscription-manager:22934 @connection.py:557 - Making request: POST /rhsm/consumers/c41d1f93-c211-4d06-a923-d52c1fa75afd
2016-06-20 01:41:36,310 [DEBUG] subscription-manager:22934 @connection.py:589 - Response: status=200
2016-06-20 01:41:36,321 [INFO] subscription-manager:22934 @managerlib.py:77 - Consumer created: {'consumer_name': 'dell-per720xd-01.rhts.eng.bos.redhat.com', 'uuid': 'c41d1f93-c211-4d06-a923-d52c1fa75afd'}
2016-06-20 01:41:36,331 [DEBUG] subscription-manager:22934 @identity.py:131 - Loading consumer info from identity certificates.
2016-06-20 01:41:36,332 [INFO] subscription-manager:22934 @managercli.py:702 - Successfully generated a new identity from server.

Comment 8 Bryan Kearney 2016-07-27 11:11:43 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/RHBA-2016:1501