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 807360 - repos --list throws [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
Summary: repos --list throws [Errno 2] No such file or directory: '/etc/pki/consumer/k...
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
medium
Target Milestone: rc
: ---
Assignee: Bryan Kearney
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 738066
TreeView+ depends on / blocked
 
Reported: 2012-03-27 15:27 UTC by John Sefler
Modified: 2012-06-25 18:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 13:08:26 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-03-27 15:27:55 UTC
Description of problem:
Without being registered, subscription-manager repos --list throws an error.  This error is a regression from prior behavior which was more graceful.


Version-Release number of selected component (if applicable):
[root@jsefler-r63-server ~]# rpm -q subscription-manager
subscription-manager-0.99.12-1.git.1.2b349d3.el6.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-r63-server ~]# subscription-manager clean
All local data removed
[root@jsefler-r63-server ~]# subscription-manager repos --list
[Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
[root@jsefler-r63-server ~]# 

  
Actual results:
Stdout:
Stderr: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
ExitCode: 255

Expected results:
Stdout: The system is not entitled to use any repositories.
Stderr:
ExitCode: 0

Additional info:


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

2012-03-27 11:09:58,937 [INFO]  @connection.py:488 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2012-03-27 11:09:58,937 [INFO]  @connection.py:499 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2012-03-27 11:09:58,938 [ERROR]  @managercli.py:100 - exception caught in subscription-manager
2012-03-27 11:09:58,938 [ERROR]  @managercli.py:101 - [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 79, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 70, in main
    return managercli.CLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1815, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 277, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1405, in _do_command
    repos = rl.get_repos()
  File "/usr/share/rhsm/subscription_manager/repolib.py", line 46, in get_repos
    action = UpdateAction(uep=self.uep)
  File "/usr/share/rhsm/subscription_manager/repolib.py", line 95, in __init__
    self.consumer = ConsumerIdentity.read()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 327, in read
    f = open(cls.keypath())
IOError: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'

Comment 3 Shwetha Kallesh 2012-03-28 11:47:55 UTC
Verified..

RPM used:
[root@skallesh pki]# rpm -qa | grep subscription-manager
subscription-manager-debuginfo-0.99.12-1.el6.x86_64
subscription-manager-migration-0.99.12-1.git.2.7747155.el6.x86_64
subscription-manager-migration-data-1.12.1.2-1.git.0.9e244c8.el6.noarch
subscription-manager-0.99.12-1.git.2.7747155.el6.x86_64
subscription-manager-firstboot-0.99.12-1.git.2.7747155.el6.x86_64
subscription-manager-gnome-0.99.12-1.git.2.7747155.el6.x86_64

[root@skallesh pki]# subscription-manager clean
All local data removed

[root@skallesh pki]# subscription-manager repos --list
The system is not entitled to use any repositories.


[root@skallesh pki]# echo $?
0

Comment 5 errata-xmlrpc 2012-06-20 13:08:26 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

Comment 6 Matt Reid 2012-06-25 18:35:28 UTC
I wanted to see the message on my vm, so I tried repos --list, and got the error message instead of the string. Not sure if this is worth trying to chase down, but wanted to let you know for some reason it didn't work for me.

[root@localhost test]# subscription-manager clean
All local data removed
[root@localhost test]# subscription-manager repos --list

[Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'

Looking at my pki directory, I do not have a consumer folder.


[root@localhost test]# rpm -qa | grep subscription-manager
subscription-manager-1.0.4-1.git.33.0c3355f.el6.x86_64
subscription-manager-firstboot-1.0.4-1.git.33.0c3355f.el6.x86_64
subscription-manager-migration-1.0.4-1.git.33.0c3355f.el6.x86_64
subscription-manager-debuginfo-1.0.4-1.git.33.0c3355f.el6.x86_64
subscription-manager-gui-1.0.4-1.git.33.0c3355f.el6.x86_64

This was freshly cloned from git, built and installed with tito on a RHEL 6.2 Server vm.

The strange part is that if I look in the po file, it shows the proper message, and when I did the same command on a 6.3 vm, everything was fine.


RHSM.log has this to say:
2012-06-25 13:59:00,062 [ERROR]  @certlib.py:261 - [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
2012-06-25 13:59:00,063 [ERROR]  @managercli.py:113 - exception caught in subscription-manager
2012-06-25 13:59:00,063 [ERROR]  @managercli.py:114 - [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 78, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 69, in main
    return managercli.CLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1948, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 399, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1484, in _do_command
    certmgr.update()
  File "/usr/share/rhsm/subscription_manager/certmgr.py", line 85, in update
    updates += lib.update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 61, in update
    return self._do_update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 167, in _do_update
    idcert = ConsumerIdentity.read()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 350, in read
    f = open(cls.keypath())
IOError: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'


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