Bug 830767

Summary: Got Traceback while using “/” with –serverurl register
Product: Red Hat Enterprise Linux 5 Reporter: spandey
Component: python-rhsmAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.9CC: awood, fsharath, jmolet, jsefler, kbanerje, skallesh, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: An unimplemented method in an error class. Consequence: A traceback was being printed to the console obscuring the actual error message. Fix: Implementing the missing method on the error class. Result: The error message is now reported successfully.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 07:17:07 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: 771748    

Description spandey 2012-06-11 11:26:29 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
2/2

steps to repro : 
Login to client console and execute following command 
subscription-manager register --serverurl / --u testuser1 --password password --org admin

Expected Result : 
Proper message should display for invalid server url.

Actual Result : 

[root@dhcp193-122 ~]# subscription-manager register --serverurl / --u testuser1 --password password --org admin
Traceback (most recent call last):
  File "/usr/lib64/python2.4/logging/handlers.py", line 71, in emit
    if self.shouldRollover(record):
  File "/usr/lib64/python2.4/logging/handlers.py", line 149, in shouldRollover
    msg = "%s\n" % self.format(record)
  File "/usr/lib64/python2.4/logging/__init__.py", line 617, in format
    return fmt.format(record)
  File "/usr/lib64/python2.4/logging/__init__.py", line 405, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.4/logging/__init__.py", line 272, in getMessage
    msg = str(self.msg)
AttributeError: RemoteServerException instance has no attribute 'args'
Unable to reach the server at subscription.rhn.redhat.com:443/

Comment 1 spandey 2012-06-11 11:33:37 UTC
Got this by using following setup 

Rhel5.9 with following subscription-manager rpm .
subscription-manager-gui-1.0.3-1.git.30.db0f648.el5
subscription-manager-migration-1.0.3-1.git.30.db0f648.el5
subscription-manager-migration-data-1.11.1.1-1.git.2.c7fbafe.el5
subscription-manager-firstboot-1.0.3-1.git.30.db0f648.el5
subscription-manager-1.0.3-1.git.30.db0f648.el5

Comment 2 Alex Wood 2012-07-30 16:55:13 UTC
The error is not actually getting thrown because the input is a "/".  The error is occurring because the "/" is being interpreted as a prefix and the host is getting assigned the default host of "subscription.rhn.redhat.com".  The call to subscription.rhn.redhat.com:443/ results in a RemoteServerException (404) being thrown and the logging package is choking on logging the exception.  Adding a __str__ method to the RemoteServerException class solves the problem.

Comment 3 Alex Wood 2012-07-31 14:26:56 UTC
commit 47e511294532b577d369a77535520694ab0a1ef7
Refs: python-rhsm-1.0.4-1-7-g47e5112
Author:     Alex Wood <awood>
AuthorDate: Mon Jul 30 12:51:36 2012 -0400
Commit:     Alex Wood <awood>
CommitDate: Mon Jul 30 12:57:30 2012 -0400

    830767: Add __str__ method to RemoteServerException.

Available in python-rhsm-1.0.5+

Comment 4 Adrian Likins 2012-08-01 20:14:57 UTC
*** Bug 842885 has been marked as a duplicate of this bug. ***

Comment 5 Sharath Dwaral 2012-08-03 15:13:59 UTC
Version:

# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-migration-1.0.12-1.git.6.1cb2247.el5
subscription-manager-1.0.12-1.git.6.1cb2247.el5
subscription-manager-firstboot-1.0.12-1.git.6.1cb2247.el5
python-rhsm-1.0.4-1.git.7.47e5112.el5
subscription-manager-migration-data-1.11.2.2-1.git.2.c3c8e22.el5
subscription-manager-gui-1.0.12-1.git.6.1cb2247.el5


Verification:

# subscription-manager register --serverurl /  --u testuser1 --password password --org admin
Unable to reach the server at subscription.rhn.redhat.com:443/

Moving bug to VERIFIED

Comment 6 RHEL Program Management 2012-08-09 14:37:27 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 8 errata-xmlrpc 2013-01-08 07:17:07 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.

http://rhn.redhat.com/errata/RHBA-2013-0039.html