Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 966745

Summary: rhn-migrate-classic-to-rhsm tool fails with "coercing to Unicode: need string or buffer, NoneType found"
Product: Red Hat Enterprise Linux 5 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.10CC: fsharath, jesusr
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
No description necessary
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-30 23:10:02 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: 840995    

Description John Sefler 2013-05-23 20:22:57 UTC
Description of problem:

This appears to be a regression in the happy path behavior of rhn-migrate-classic-to-rhsm.  After a normal rhnreg_ks registration, a simple migration fails as follows....

[root@rhsm-compat-rhel59 ~]# rhn-migrate-classic-to-rhsm -n
Red Hat account: qa
Password:
System Engine Username: testuser1
Password:
Org: admin
 
Retrieving existing RHN Classic subscription information...
 
+-----------------------------------------------------+
System is currently subscribed to these RHN Classic Channels:
+-----------------------------------------------------+
rhel-x86_64-server-5
 
+-----------------------------------------------------+
Installing product certificates for these RHN Classic channels:
+-----------------------------------------------------+
rhel-x86_64-server-5
 
Product certificates installed successfully to /tmp/migratedProductCertDir.
coercing to Unicode: need string or buffer, NoneType found
[root@rhsm-compat-rhel59 ~]# echo $?
255


Did NOT expect "coercing to Unicode: need string or buffer, NoneType found"


Here's the stacktrace found in rhsm.log...
2013-05-23 07:10:36,443 [ERROR]  @managercli.py:150 - Exception caught in rhm-migrate-classic-to-rhsm
2013-05-23 07:10:36,443 [ERROR]  @managercli.py:151 - coercing to Unicode: need string or buffer, NoneType found
Traceback (most recent call last):
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 74, in ?
    sys.exit(abs(main() or 0))
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 65, in main
    return migrate.MigrationEngine().main()
  File "/usr/share/rhsm/subscription_manager/migrate/migrate.py", line 677, in main
    self.write_migration_facts()
  File "/usr/share/rhsm/subscription_manager/migrate/migrate.py", line 485, in write_migration_facts
    json.dump({"migration.classic_system_id": self.get_system_id(),
  File "/usr/share/rhsm/subscription_manager/migrate/migrate.py", line 476, in get_system_id
    p = libxml2.parseDoc(file(system_id_path).read())
TypeError: coercing to Unicode: need string or buffer, NoneType found


Version-Release number of selected component (if applicable):
[root@rhsm-compat-rhel59 ~]# rpm -q subscription-manager python-rhsm
subscription-manager-1.8.8-1.git.8.7625592.el5
python-rhsm-1.8.11-1.git.1.7236cc2.el5

Comment 2 Alex Wood 2013-05-29 15:30:58 UTC
commit 550db67cea32179be7da375e3e6a26ffd97c3377
Author: Alex Wood <awood>
Date:   Thu May 23 16:50:55 2013 -0400

    966745: Correct typo in name of configuration value.

Comment 5 Sharath Dwaral 2013-06-05 20:26:33 UTC
State of Subscription-Manager after migration 

# subscription-manager identity
Current identity is: fed049b6-09ea-41fd-baf1-e66606ffb39a
name: dhcp129-119.rdu.redhat.com
org name: Admin Owner
org ID: admin

Comment 6 Sharath Dwaral 2013-06-05 20:26:49 UTC
State of Subscription-Manager after migration 

# subscription-manager identity
Current identity is: fed049b6-09ea-41fd-baf1-e66606ffb39a
name: dhcp129-119.rdu.redhat.com
org name: Admin Owner
org ID: admin

Comment 8 errata-xmlrpc 2013-09-30 23:10:02 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-1332.html