Bug 816377 - rhn-migrate-classic-to-rhsm throws traceback when subscription-manager-migration-data is not installed
Summary: rhn-migrate-classic-to-rhsm throws traceback when subscription-manager-migrat...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 738066
TreeView+ depends on / blocked
 
Reported: 2012-04-25 22:24 UTC by John Sefler
Modified: 2012-06-20 12:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 12:56:51 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0804 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2012-06-19 19:51:31 UTC

Description John Sefler 2012-04-25 22:24:03 UTC
Description of problem:
Running rhn-migrate-classic-to-rhsm without subscription-manager-migration-data installed, a traceback is thrown.

Version-Release number of selected component (if applicable):
subscription-manager-migration-0.99.14-1.el6.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-r63-server ~]# rpm -q subscription-manager-migration-data
package subscription-manager-migration-data is not installed
[root@jsefler-r63-server ~]# 
[root@jsefler-r63-server ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa@redhat.com --password=****** --profilename=jsefler-r63-server --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-r63-server ~]# rhn-migrate-classic-to-rhsm 
RHN Username: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to:
+----------------------------------+
rhel-x86_64-server-6
Traceback (most recent call last):
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 477, in <module>
    main()
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 461, in main
    deployProdCertificates(subscribedChannels)
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 310, in deployProdCertificates
    dic_data = readChannelCertMapping()
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 253, in readChannelCertMapping
    f = open(mappingfile)
IOError: [Errno 2] No such file or directory: '/usr/share/rhsm/product/RHEL-6/channel-cert-mapping.txt'
[root@jsefler-r63-server ~]# echo $?
1
 
Expected a more graceful message to the user.  For example:
Could not find required '/usr/share/rhsm/product/RHEL-6/channel-cert-mapping.txt'.  Verify that the subscription-manager-migration-data package is installed.

Additional info:

Comment 2 Adrian Likins 2012-04-26 19:21:18 UTC
commit 8ad990501db2491e9031602cc8130522ebb29c09
Author: Adrian Likins <alikins@redhat.com>
Date:   Thu Apr 26 14:11:28 2012 -0400

    816377: handle cert migration data being missing

Comment 5 John Sefler 2012-05-03 22:22:43 UTC
Verifying Version...
[root@bigisis ~]# rpm -q subscription-manager-migration
subscription-manager-migration-0.99.16-1.el6.x86_64
[root@bigisis ~]# rpm -q subscription-manager-migration-data
package subscription-manager-migration-data is not installed


[root@bigisis ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa@redhat.com --password=redhatqa --profilename=bigisis --force --norhnsd --nohardware --nopackages --novirtinfo
[root@bigisis ~]# rhn-migrate-classic-to-rhsm
RHN Username: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to:
+----------------------------------+
rhel-x86_64-server-6
Unable to connect to certificate server: [Errno 2] No such file or directory: '/usr/share/rhsm/product/RHEL-6/channel-cert-mapping.txt'.  See /var/log/rhsm/rhsm.log for more details.
[root@bigisis ~]# echo $?
1



[root@bigisis ~]# tail /var/log/rhsm/rhsm.log
2012-05-03 17:39:31,492 [DEBUG]  @connection.py:329 - Making request: GET /subscription/users/qa%40redhat.com/owners
2012-05-03 17:39:35,522 [DEBUG]  @connection.py:343 - Response status: 200
2012-05-03 17:39:36,852 [INFO]  @rhn-migrate-classic-to-rhsm:252 - Using mapping file /usr/share/rhsm/product/RHEL-6/channel-cert-mapping.txt
2012-05-03 17:39:36,852 [ERROR]  @rhn-migrate-classic-to-rhsm:313 - [Errno 2] No such file or directory: '/usr/share/rhsm/product/RHEL-6/channel-cert-mapping.txt'
Traceback (most recent call last):
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 311, in deployProdCertificates
    dic_data = readChannelCertMapping()
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 253, in readChannelCertMapping
    f = open(mappingfile)
IOError: [Errno 2] No such file or directory: '/usr/share/rhsm/product/RHEL-6/channel-cert-mapping.txt'
[root@bigisis ~]# 


^^^ WELL... The original traceback is now caught and logged.  The user still doesn't know what to do.  I guess it's time for the user to read the man page. 

[root@bigisis ~]# man -P cat rhn-migrate-classic-to-rhsm | grep data
[root@bigisis ~]# 

Sorry, there is no reference to "data" in the man page for rhn-migrate-classic-to-rhsm

Moving this bug to VERIFIED and opening separate bug 818767 requesting additional info to the man page.

Comment 7 errata-xmlrpc 2012-06-20 12:56:51 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-2012-0804.html


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