Bug 830767 - Got Traceback while using “/” with –serverurl register
Got Traceback while using “/” with –serverurl register
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python-rhsm (Show other bugs)
5.9
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Alex Wood
Entitlement Bugs
:
Depends On:
Blocks: 771748
  Show dependency treegraph
 
Reported: 2012-06-11 07:26 EDT by spandey
Modified: 2015-04-23 19:57 EDT (History)
7 users (show)

See Also:
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 02:17:07 EST
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)

  None (edit)
Description spandey 2012-06-11 07:26:29 EDT
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 07:33:37 EDT
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 12:55:13 EDT
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 10:26:56 EDT
commit 47e511294532b577d369a77535520694ab0a1ef7
Refs: python-rhsm-1.0.4-1-7-g47e5112
Author:     Alex Wood <awood@redhat.com>
AuthorDate: Mon Jul 30 12:51:36 2012 -0400
Commit:     Alex Wood <awood@redhat.com>
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 16:14:57 EDT
*** Bug 842885 has been marked as a duplicate of this bug. ***
Comment 5 Sharath Dwaral 2012-08-03 11:13:59 EDT
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 Product and Program Management 2012-08-09 10:37:27 EDT
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 02:17:07 EST
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

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