Bug 807360 - repos --list throws [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
repos --list throws [Errno 2] No such file or directory: '/etc/pki/consumer/k...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Bryan Kearney
Entitlement Bugs
: Regression
Depends On:
Blocks: 738066
  Show dependency treegraph
 
Reported: 2012-03-27 11:27 EDT by John Sefler
Modified: 2012-06-25 14:35 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 09:08:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Sefler 2012-03-27 11:27:55 EDT
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 07:47:55 EDT
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 09:08:26 EDT
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 14:35:28 EDT
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.