Bug 916362

Summary: Display appropriate message when we query for service-level of a machine when already registered to another
Product: Red Hat Enterprise Linux 7 Reporter: Sharath Dwaral <fsharath>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: alikins, bkearney, ckozak, jgalipea
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-17 21:28:04 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: 863175    

Description Sharath Dwaral 2013-02-27 22:36:13 UTC
Description of problem:

There should be an appropriate message diaplayed when we attempt to query service leve of another server when already register to another

Version-Release number of selected component (if applicable):
# rpm -qa | egrep "subscription-manager|python-rhsm"
python-rhsm-1.8.3-1.el7.x86_64
subscription-manager-gui-1.8.3-1.el7.x86_64
subscription-manager-migration-1.8.3-1.el7.x86_64
subscription-manager-debuginfo-1.8.3-1.el7.x86_64
subscription-manager-1.8.3-1.el7.x86_64
subscription-manager-firstboot-1.8.3-1.el7.x86_64
python-rhsm-debuginfo-1.8.3-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:

# cat /etc/rhsm/rhsm.conf | grep hostname
# Server hostname:
hostname=fsharath-candlepin.usersys.redhat.com
proxy_hostname =

# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.

# subscription-manager register
Username: testuser1
Password: 
Organization: snowwhite
The system has been registered with id: 30b164f5-1082-4fe3-bf41-dba6627c93c6 

# subscription-manager service-level --serverurl subscription.rhn.redhat.com:443/subscription
tlsv1 alert unknown ca

# subscription-manager service-level --serverurl subscription.rhn.redhat.com:443/subscription --list
tlsv1 alert unknown ca

Actual results:

AS shown above

Expected results:

Appropriate error message such as "You are already registered to a different system" should be displayed instead of cert error. 

Additional info:

Comment 1 William Poteat 2013-07-22 12:49:58 UTC
This needs to be handled at the point where the SSL error is first caught.

The suggested solution is not proper. It takes a known scenario, gets a generic error message, and wants to change it into a specific one. This error may be thrown for many reasons, not just the one in this bug.

Logging the stack and then producing an output message more like "There is a certificate credential issue between this unit and the entitlement server. Please view the log at /var/log/rhsm/rhsm.log for additional details."

Comment 3 Carter Kozak 2014-01-17 21:28:04 UTC
This is working as expected because the consumer cert is being used for verification.  You should have supplied a username and password for the serverurl supplied.