Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1636654

Summary: [abrt] subscription-manager: read(): identity.py:147:reload:AttributeError: module 'os' has no attribute 'errno'
Product: [Fedora] Fedora Reporter: Stanislav Graf <sgraf>
Component: subscription-managerAssignee: Chris Snyder <csnyder>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: alikins, awood, bkearney, csnyder, erich, khowell
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/7375fd9c0d1014ba914854088acba3180562e73b
Whiteboard: abrt_hash:dc6ef03ab9dbb4e5d925c1d8d2a01fd5164865ad;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-15 14:49:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description Stanislav Graf 2018-10-06 09:19:41 UTC
Description of problem:
I tried to run:
~~~
$ sudo subscription-manager register
~~~

Version-Release number of selected component:
subscription-manager-1.23.3-1.fc29

Additional info:
reporter:       libreport-2.9.5
cmdline:        /usr/bin/python3 /usr/sbin/subscription-manager register
crash_function: read
exception_type: FileNotFoundError
executable:     /usr/sbin/subscription-manager
interpreter:    python3-3.7.0-9.fc29.x86_64
kernel:         4.18.11-300.fc29.x86_64
runlevel:       N 5
type:           Python3
uid:            0

Truncated backtrace:
identity.py:147:reload:AttributeError: module 'os' has no attribute 'errno'

Traceback (most recent call last):
  File "/usr/lib64/python3.7/site-packages/subscription_manager/identity.py", line 140, in reload
    self.consumer = self._get_consumer_identity()
  File "/usr/lib64/python3.7/site-packages/subscription_manager/identity.py", line 164, in _get_consumer_identity
    return ConsumerIdentity.read()
  File "/usr/lib64/python3.7/site-packages/subscription_manager/identity.py", line 53, in read
    with open(cls.keypath()) as key_file:
FileNotFoundError: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 11, in <module>
    load_entry_point('subscription-manager==1.23.3', 'console_scripts', 'subscription-manager')()
  File "/usr/lib64/python3.7/site-packages/subscription_manager/scripts/subscription_manager.py", line 85, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib64/python3.7/site-packages/subscription_manager/managercli.py", line 2838, in __init__
    CLI.__init__(self, command_classes=commands)
  File "/usr/lib64/python3.7/site-packages/subscription_manager/cli.py", line 101, in __init__
    cmd = clazz()
  File "/usr/lib64/python3.7/site-packages/subscription_manager/managercli.py", line 1056, in __init__
    super(RegisterCommand, self).__init__("register", shortdesc, True)
  File "/usr/lib64/python3.7/site-packages/subscription_manager/managercli.py", line 529, in __init__
    super(UserPassCommand, self).__init__(name, shortdesc, primary)
  File "/usr/lib64/python3.7/site-packages/subscription_manager/managercli.py", line 257, in __init__
    self.identity = inj.require(inj.IDENTITY)
  File "/usr/lib64/python3.7/site-packages/subscription_manager/injection.py", line 106, in require
    return FEATURES.require(feature, *args, **kwargs)
  File "/usr/lib64/python3.7/site-packages/subscription_manager/injection.py", line 80, in require
    self.providers[feature] = provider(*args, **kwargs)
  File "/usr/lib64/python3.7/site-packages/subscription_manager/identity.py", line 133, in __init__
    self.reload()
  File "/usr/lib64/python3.7/site-packages/subscription_manager/identity.py", line 147, in reload
    if isinstance(err, IOError) and err.errno == os.errno.ENOENT:
AttributeError: module 'os' has no attribute 'errno'

Local variables in innermost frame:
self: <subscription_manager.identity.Identity object at 0x7fef1efbea20>
msg: "Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'"

Comment 1 Stanislav Graf 2018-10-06 09:19:49 UTC
Created attachment 1490996 [details]
File: backtrace

Comment 2 Stanislav Graf 2018-10-06 09:19:51 UTC
Created attachment 1490997 [details]
File: cgroup

Comment 3 Stanislav Graf 2018-10-06 09:19:52 UTC
Created attachment 1490998 [details]
File: cpuinfo

Comment 4 Stanislav Graf 2018-10-06 09:19:54 UTC
Created attachment 1490999 [details]
File: environ

Comment 5 Stanislav Graf 2018-10-06 09:19:56 UTC
Created attachment 1491000 [details]
File: mountinfo

Comment 6 Stanislav Graf 2018-10-06 09:19:58 UTC
Created attachment 1491001 [details]
File: namespaces

Comment 7 Stanislav Graf 2018-10-06 09:20:00 UTC
Created attachment 1491002 [details]
File: open_fds

Comment 9 Kevin Howell 2018-10-15 14:49:25 UTC

*** This bug has been marked as a duplicate of bug 1631339 ***