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 1212515 - [Errno 2] No such file or directory: '/etc/sysconfig/rhn/systemid' when running rhn-migrate-classic-to-rhsm
Summary: [Errno 2] No such file or directory: '/etc/sysconfig/rhn/systemid' when runni...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.7
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Alex Wood
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel67
TreeView+ depends on / blocked
 
Reported: 2015-04-16 14:37 UTC by John Sefler
Modified: 2015-07-22 06:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-22 06:53:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1345 0 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2015-07-20 17:59:53 UTC

Description John Sefler 2015-04-16 14:37:22 UTC
Description of problem:
Technically the error message "[Errno 2] No such file or directory: '/etc/sysconfig/rhn/systemid'" encountered when attempting to run rhn-migrate-classic-to-rhsm that has not been registered classically is correct.  However it is not as graceful as it has been in the past.  Hence, some friendly error handling seems to have recently regressed.  I suspect commit 5df7aaaa69a22b9e3f771971f1aa4e58657c8377

Version-Release number of selected component (if applicable):
[root@jsefler-os6 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.14.5-1.el6.x86_64


How reproducible:


Steps to Reproduce:
Make sure we are not registered classically and attempt to run rhn-migrate-classic-to-rhsm...
[root@jsefler-os6 ~]# rm -rf /etc/sysconfig/rhn/systemid
[root@jsefler-os6 ~]# rhn-migrate-classic-to-rhsm
[Errno 2] No such file or directory: '/etc/sysconfig/rhn/systemid'


Actual results:
[Errno 2] No such file or directory: '/etc/sysconfig/rhn/systemid'

Expected results:
Problem encountered getting the list of subscribed channels.  See /var/log/rhsm/rhsm.log for more details.



Additional info:

[root@jsefler-os6 ~]# tail -f /var/log/rhsm/rhsm.log

2015-04-16 10:30:12,548 [ERROR] rhn-migrate-classic-to-rhsm:5306 @managercli.py:160 - Exception caught in rhm-migrate-classic-to-rhsm
2015-04-16 10:30:12,549 [ERROR] rhn-migrate-classic-to-rhsm:5306 @managercli.py:161 - [Errno 2] No such file or directory: '/etc/sysconfig/rhn/systemid'
Traceback (most recent call last):
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 78, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 69, in main
    return migrate.main()
  File "/usr/share/rhsm/subscription_manager/migrate/migrate.py", line 904, in main
    MigrationEngine(options).main()
  File "/usr/share/rhsm/subscription_manager/migrate/migrate.py", line 144, in __init__
    self.system_id_contents = open(self.rhncfg["systemIdPath"], 'r').read()
IOError: [Errno 2] No such file or directory: '/etc/sysconfig/rhn/systemid'

Comment 2 John Sefler 2015-04-27 20:39:16 UTC
The same error is thrown when attempting to run rhn-migrate-classic-to-rhsm while already registered to rhsm (but not rhn-classic)...

[root@jsefler-os6 ~]# ls /etc/sysconfig/rhn/
allowed-actions  clientCaps.d  rhnsd  systemid.save  up2date
[root@jsefler-os6 ~]# subscription-manager identity
system identity: bbfe7910-ce27-46ae-85cc-5771b5834384
name: jsefler-os6
org name: Admin Owner
org ID: admin
[root@jsefler-os6 ~]# rhn-migrate-classic-to-rhsm
[Errno 2] No such file or directory: '/etc/sysconfig/rhn/systemid'


Formerly, this test more gracefully reported...
This system appears to already be registered to Red Hat Subscription Management.
Please visit https://access.redhat.com/management/consumers/bbfe7910-ce27-46ae-85cc-5771b5834384 to view the profile details."

Comment 3 John Sefler 2015-05-11 16:38:24 UTC
Marking Severity High due to the Regression keyword.

Comment 4 Alex Wood 2015-05-15 17:15:39 UTC
commit 49db2c8b60d552837527974150bff77fcf5d51fa
Author: Alex Wood <awood>
Date:   Thu May 14 15:56:41 2015 -0400

    1212515: Print error message for missing systemid file.

Comment 6 John Sefler 2015-05-27 20:22:22 UTC
Verifying Version...
[root@jsefler-os6 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.14.8-1.el6.x86_64


[root@jsefler-os6 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=*REDACTED* --profilename=rhsm-automation.jsefler-os6 --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-os6 ~]# rm -rf /etc/sysconfig/rhn/systemid
[root@jsefler-os6 ~]# rhn-migrate-classic-to-rhsm
Could not read legacy systemid at /etc/sysconfig/rhn/systemid

VERIFIED use case in comment 0




[root@jsefler-os6 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=*REDACTED* --profilename=rhsm-automation.jsefler-os6 --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-os6 ~]# rm -rf /etc/sysconfig/rhn/systemid
[root@jsefler-os6 ~]# rhn-migrate-classic-to-rhsm
Could not read legacy systemid at /etc/sysconfig/rhn/systemid
[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# subscription-manager register --serverurl=subscription.rhn.stage.redhat.com:443/subscription
Username: stage_rhsmqe
Password: 
The system has been registered with ID: 1dfb8a6f-7608-4431-9871-a3d8d3343348 
[root@jsefler-os6 ~]# ls /etc/sysconfig/rhn/
allowed-actions  clientCaps.d  rhnsd  systemid.save  up2date
[root@jsefler-os6 ~]# subscription-manager identity
system identity: 1dfb8a6f-7608-4431-9871-a3d8d3343348
name: jsefler-os6
org name: 7621792
org ID: 7621792
[root@jsefler-os6 ~]# rhn-migrate-classic-to-rhsm
Could not read legacy systemid at /etc/sysconfig/rhn/systemid

VERIFIED use case in comment 2




Notice that the user is now stopped immediately when attempting to run rhn-migrate-classic-to-rhsm without first being registered classically.  This is better than the initial behavior since there is no point in running rhn-migrate-classic-to-rhsm if you are not first registered classically.

Comment 7 errata-xmlrpc 2015-07-22 06:53:53 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.

https://rhn.redhat.com/errata/RHBA-2015-1345.html


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