Bug 1484862 - python-yubico crashes in Python 3 when searching for devices
Summary: python-yubico crashes in Python 3 when searching for devices
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python-yubico
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nathaniel McCallum
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-24 12:30 UTC by Standa Laznicka
Modified: 2019-11-27 23:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 23:00:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Standa Laznicka 2017-08-24 12:30:42 UTC
Description of problem:
Trying to search for a Yubikey device crashes when run in Python 3.

Version-Release number of selected component (if applicable):
python-yubico-1.3.2-6.fc27

How reproducible:
100%

Steps to Reproduce:
1. Connect your Yubikey to your computer
2. # python3 -c "import yubico; yubico.find_yubikey()"

Actual results:
"""
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/yubico/yubikey.py", line 61, in find_key
    return YubiKey4_USBHID(debug, skip, hid_device)
  File "/usr/lib/python3.6/site-packages/yubico/yubikey_4_usb_hid.py", line 98, in __init__
    data = yubico_util.tlv_parse(self._read_capabilities())
  File "/usr/lib/python3.6/site-packages/yubico/yubikey_4_usb_hid.py", line 107, in _read_capabilities
    r_len = ord(response[0])
TypeError: ord() expected string of length 1, but int found
Exception ignored in: <bound method YubiKeyHIDDevice.__del__ of <yubico.yubikey_usb_hid.YubiKeyHIDDevice object at 0x7f14cc69d9e8>>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/yubico/yubikey_usb_hid.py", line 138, in __del__
    self._close()
  File "/usr/lib/python3.6/site-packages/yubico/yubikey_usb_hid.py", line 345, in _close
    self._usb_handle.releaseInterface()
  File "/usr/lib/python3.6/site-packages/usb/legacy.py", line 235, in releaseInterface
    util.release_interface(self.dev, self.__claimed_interface)
  File "/usr/lib/python3.6/site-packages/usb/util.py", line 217, in release_interface
    device._ctx.managed_release_interface(device, interface)
AttributeError: 'NoneType' object has no attribute '_ctx'
"""

Expected results:
No traceback shown.

Additional info:
This breaks FreeIPA when trying to add a Yubikey OTP token.

Fixed upstream in python-yubico: https://github.com/Yubico/python-yubico/commit/7e6e424ed579c53a0767ba71eb47345ae1e472ca

Comment 1 Fedora Update System 2017-08-24 15:07:34 UTC
python-yubico-1.3.2-7.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-63975ea815

Comment 2 Fedora Update System 2017-08-24 15:07:43 UTC
python-yubico-1.3.2-7.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-504924ee4f

Comment 3 Fedora Update System 2017-08-26 22:31:20 UTC
python-yubico-1.3.2-7.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-504924ee4f

Comment 4 Fedora Update System 2017-08-26 22:33:43 UTC
python-yubico-1.3.2-7.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-63975ea815

Comment 5 Fedora Update System 2017-08-28 16:20:02 UTC
python-yubico-1.3.2-7.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2017-11-15 22:28:35 UTC
python-yubico-1.3.2-7.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Ben Cotton 2018-11-27 18:14:42 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Standa Laznicka 2018-11-28 07:54:06 UTC
Why wasn't this closed and is still in status ON_QA? The package python-yubico-1.3.2-7 which possibly fixes the issue was pushed even to Fedora 25. If this needs an input from QA, were they not able to run a single command in a shell for 4 stable Fedora releases?

Comment 9 Francisco de la Peña 2019-07-09 00:20:43 UTC
I can't reproduce the issue mentioned above in Fedora 30, as superuser, python3 -c "import yubico; yubico.find_yubikey()" quits without issues.

however, there is some breakage yet with Python 3. This seems to affect the Fedora Yubikey burn utility with any argument, even with --version:

# /usr/sbin/fedora-burn-yubikey --version
0.1
Exception ignored in: <function YubiKeyHIDDevice.__del__ at 0x7fb4cbf57400>
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/yubico/yubikey_usb_hid.py", line 138, in __del__
  File "/usr/lib/python3.7/site-packages/yubico/yubikey_usb_hid.py", line 345, in _close
  File "/usr/lib/python3.7/site-packages/usb/legacy.py", line 235, in releaseInterface
  File "/usr/lib/python3.7/site-packages/usb/util.py", line 217, in release_interface
AttributeError: 'NoneType' object has no attribute '_ctx'

python-yubico 1.3.3 was released on 2019-02-28 and might fix this issue. Current F30 release for the python3-yubico subpackage is 1.3.2(-13).

Comment 10 Ben Cotton 2019-10-31 19:04:14 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Ben Cotton 2019-11-27 23:00:04 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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