Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1445511

Summary: 'NoneType' object has no attribute 'decode'
Product: Red Hat Enterprise Linux 7 Reporter: David Davis <daviddavis>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5-AltCC: bmbouter, csnyder, redakkan, skallesh
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-27 15:40:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Davis 2017-04-25 20:30:14 UTC
Looks like when F25 upgraded from python-rhsm 1.19.0 to 1.19.4, our tests started failing:

rhsm.https: DEBUG: Using standard libs to provide httplib and ssl
rhsm.certificate2: ERROR: 'NoneType' object has no attribute 'decode'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/rhsm/certificate2.py", line 99, in _read_x509
    return self._create_v1_cert(version, extensions, x509, path)
  File "/usr/lib64/python2.7/site-packages/rhsm/certificate2.py", line 114, in _create_v1_cert
    return self._create_identity_cert(version, extensions, x509, path)
  File "/usr/lib64/python2.7/site-packages/rhsm/certificate2.py", line 137, in _create_identity_cert
    alt_name=self._read_alt_name(x509),
  File "/usr/lib64/python2.7/site-packages/rhsm/certificate2.py", line 121, in _read_alt_name
    return x509.get_extension(name='subjectAltName').decode('utf-8')
AttributeError: 'NoneType' object has no attribute 'decode'


Looks like the following change was introduced in that timeframe:

https://github.com/candlepin/python-rhsm/commit/f3164e32a5aae288a1ef73f3c16f46f60d0cb1b1#diff-b89afd85b4d5ab2767749c609cab6374R118

Comment 3 Brian Bouterse 2017-04-26 16:34:49 UTC
This same code and environment using the previous python-rhsm version returns valid data from 509.get_extension(name='subjectAltName'). So receiving None is unexpected. Since it works with older versions in the F25 environment, I'm thinking it is a regression that affects either F25 as an environment or all environments.

Comment 4 David Davis 2017-04-27 12:43:57 UTC
I think this is a dupe of https://bugzilla.redhat.com/show_bug.cgi?id=1426343

Comment 5 Chris Snyder 2017-04-27 15:40:04 UTC

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