Bug 835081

Summary: Migration from RHN to RHSM with valid credentials throws an "invalid exception" in rhsm.log
Product: Red Hat Enterprise Linux 5 Reporter: Sharath Dwaral <fsharath>
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.9CC: awood, bkearney, jgalipea, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 03:55:57 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 Sharath Dwaral 2012-06-25 13:43:12 UTC
Description of problem:
Migration from RHN to RHSM with valid credentials throws an "invalid exception" in rhsm.log

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

RHEL 5.9
# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-migration-1.0.4-1.git.1.b28337e.el5
subscription-manager-migration-data-1.11.1.1-1.git.2.c7fbafe.el5
python-rhsm-1.0.2-1.git.2.d5c3d05.el5
subscription-manager-firstboot-1.0.4-1.git.1.b28337e.el5
subscription-manager-1.0.4-1.git.1.b28337e.el5
subscription-manager-gui-1.0.4-1.git.1.b28337e.el5

How reproducible:
Always

Steps to Reproduce:
1. Resister the box to subscribe using RHN classic
2. run # rhn-migrate-classic-to-rhsm
   against standalone candlepin server (With valid credentials)
3. # rhn-migrate-classic-to-rhsm
   RHN Username: testuser1
   Password: 
   Unable to authenticate to RHN Classic.  See /var/log/rhsm/rhsm.log for more details.
   
   Enter valid candlepin server credentials

The log contains an unhandled exception.

# cat /var/log/rhsm/rhsm.log
2012-06-25 09:38:21,224 [INFO]  @connection.py:476 - Using basic authentication as: testuser1
2012-06-25 09:38:21,225 [INFO]  @connection.py:497 - Connection Built: host: 10.16.120.125, port: 8443, handler: /candlepin
2012-06-25 09:38:21,226 [DEBUG]  @connection.py:330 - Making request: GET /candlepin/users/testuser1/owners
2012-06-25 09:38:21,243 [DEBUG]  @connection.py:343 - Response status: 200
2012-06-25 09:38:21,619 [ERROR]  @rhn-migrate-classic-to-rhsm:285 - Traceback (most recent call last):
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 282, in connectToRhn
    sk = sc.auth.login(username, password)
  File "/usr/lib64/python2.4/xmlrpclib.py", line 1096, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.4/xmlrpclib.py", line 1383, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.4/xmlrpclib.py", line 1147, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.4/xmlrpclib.py", line 1286, in _parse_response
    return u.close()
  File "/usr/lib64/python2.4/xmlrpclib.py", line 744, in close
    raise Fault(**self._stack[0])
> Fault: <Fault -2: 'unhandled internal exception: null'>
  

Actual results:
As show above

Expected results:
There should be no exception

Additional info:

Comment 1 RHEL Program Management 2012-06-25 13:58:30 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 2 Alex Wood 2012-08-03 19:50:55 UTC
At the time this bug was filed, the migration script did not offer the ability to migrate to a standalone Candlepin server.  That ability has since been added with the feature of collecting different credentials for both RHN and the standalone server.

That being said, if you provide RHN credentials that are incorrect, you will still see this exception in the log.  Unfortunately, there is not much that we can do about the message that the XMLRPC call is returning.

The best I think we can do is add a log message above the stack trace saying something like, "Communication to RHN failed.  Check password?"  But I feel like the message that gets displayed on the terminal is already pretty explicit about what happened: "Unable to authenticate to RHN Classic."  I'm marking this NEEDINFO until a decision is reached.

Comment 3 Alex Wood 2012-08-17 18:50:55 UTC
The migration script now works against standalone Candlepin instances as of commit 4340a7af08b07a23093ac75880274655f520364c.

Available in subscription-manager-1.0.13+

Comment 5 spandey 2012-08-22 11:05:40 UTC
As per Alex Comment 2 , verifying defect using following rpm 
subscription-manager-1.0.14-1.git.10.4cd750a.el5
subscription-manager-migration-data-1.11.2.3-1.git.0.861f9ba.el5
subscription-manager-firstboot-1.0.14-1.git.10.4cd750a.el5
subscription-manager-migration-1.0.14-1.git.10.4cd750a.el5
subscription-manager-gui-1.0.14-1.git.10.4cd750a.el5
 

[root@dhcp193-75 product]# rhn-migrate-classic-to-rhsm --serverurl https://10.65.193.76:8443/candlepin
Red Hat account: testuser1
Password: 
System Engine Username: testuser1
Password: 
Unable to authenticate to RHN Classic.  See /var/log/rhsm/rhsm.log for more details.


As per comment 2 , working fine resolving defect as verified

Comment 7 errata-xmlrpc 2013-01-08 03:55:57 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-0033.html