RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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:
Embargoed:


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 --password=****** --profilename=jsefler-r63-server --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-r63-server ~]# rhn-migrate-classic-to-rhsm 
RHN Username: qa
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>
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 --password=redhatqa --profilename=bigisis --force --norhnsd --nohardware --nopackages --novirtinfo
[root@bigisis ~]# rhn-migrate-classic-to-rhsm
RHN Username: qa
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.