#4693 ipa otptoken-add-yubikey command dumps a traceback if user has no access to the USB device
Closed: Fixed None Opened 9 years ago by ctria.

The following traceback is raised, normally the error should be handled.

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ipalib/backend.py", line 129, in execute
    result = self.Command[_name](*args, **options)
  File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 439, in __call__
    ret = self.run(*args, **options)
  File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 755, in run
    return self.forward(*args, **options)
  File "/usr/lib/python2.7/site-packages/ipalib/plugins/otptoken_yubikey.py", line 83, in forward
    yk = yubico.find_yubikey()
  File "/usr/lib/python2.7/site-packages/yubico/yubikey.py", line 229, in find_key
    YK = YubiKeyUSBHID(debug=debug, skip=skip)
  File "/usr/lib/python2.7/site-packages/yubico/yubikey_usb_hid.py", line 141, in __init__
    if not self._open(skip):
  File "/usr/lib/python2.7/site-packages/yubico/yubikey_usb_hid.py", line 440, in _open
    self._usb_handle.setConfiguration(1)
  File "/usr/lib/python2.7/site-packages/usb/legacy.py", line 257, in setConfiguration
    self.dev.set_configuration(configuration)
  File "/usr/lib/python2.7/site-packages/usb/core.py", line 559, in set_configuration
    self._ctx.managed_set_configuration(self, configuration)
  File "/usr/lib/python2.7/site-packages/usb/core.py", line 91, in managed_set_configuration
    self.managed_open()
  File "/usr/lib/python2.7/site-packages/usb/core.py", line 70, in managed_open
    self.handle = self.backend.open_device(self.dev)
  File "/usr/lib/python2.7/site-packages/usb/backend/libusb1.py", line 733, in open_device
    return _DeviceHandle(dev)
  File "/usr/lib/python2.7/site-packages/usb/backend/libusb1.py", line 618, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "/usr/lib/python2.7/site-packages/usb/backend/libusb1.py", line 571, in _check
    raise USBError(_str_error[ret], ret, _libusb_errno[ret])
USBError: [Errno 13] Access denied (insufficient permissions)
ipa: ERROR: an internal error has occurred

master:

  • b3a6701 Catch USBError during YubiKey location

ipa-4-1:

  • a7a7e96 Catch USBError during YubiKey location

Metadata Update from @ctria:
- Issue assigned to npmccallum
- Issue set to the milestone: FreeIPA 4.1.3

7 years ago

Log in to comment on this ticket.

Metadata