# Cant update to 1.3.1

**URL:** <https://support.nitrokey.com/t/cant-update-to-1-3-1/4962>\
**Category:** Nitrokeys\
**Created:** [April 6, 2023, 8:09pm UTC](https://support.nitrokey.com/t/cant-update-to-1-3-1/4962 "2023-04-06T20:09:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tealk](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/t/bbe5ce/32.png) [@Tealk](https://support.nitrokey.com/u/Tealk)\
**Post date:** [April 6, 2023, 8:09pm UTC](https://support.nitrokey.com/t/cant-update-to-1-3-1/4962/1 "2023-04-06T20:09:11Z")

</div>

Hello,

I tried to update my Nitrokey3 but unfortunately it didn’t work, since the first failed attempt I don’t see any version at “current firmware version” anymore.

in troubleshooting I have already read that I should restart the pc, but this brings no improvement.

Nitrokey 3A NFC  
Linux Arch  
Gnome 43.4

```auto
nitropy nk3 update
Command line tool to interact with Nitrokey devices 0.4.36
Do you want to download the firmware version v1.3.1? [Y/n]: 
Download v1.3.1: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 625k/625k [00:00<00:00, 7.16MB/s]
Current firmware version: [unknown]
Updated firmware version: v1.3.1

Please do not remove the Nitrokey 3 or insert any other Nitrokey 3 devices during the update. Doing so may damage the Nitrokey 3.
Do you want to perform the firmware update now? [y/N]: y
Critical error:
An unhandled exception occurred
	Exception encountered: McuBootConnectionError()

```

```auto
355 INFO pynitrokey.cli Timestamp: 2023-04-06 22:03:45.442311
355 INFO pynitrokey.cli OS: uname_result(system='Linux', node='tealk-tuxedoaura15gen1', release='6.2.9-arch1-1', version='#1 SMP PREEMPT_DYNAMIC Thu, 30 Mar 2023 14:51:14 +0000', machine='x86_64')
355 INFO pynitrokey.cli Python version: 3.10.10
374 INFO pynitrokey.cli pynitrokey version: 0.4.36
375 INFO pynitrokey.cli cryptography version: 36.0.2
376 INFO pynitrokey.cli ecdsa version: 0.18.0
377 INFO pynitrokey.cli fido2 version: 1.1.0
377 INFO pynitrokey.cli pyusb version: 1.2.1
378 INFO pynitrokey.cli spsdk version: 1.7.1
817 INFO libusbsio Loading SIO library: /home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/bin/linux_x86_64/libusbsio.so
822 INFO libusbsio HID enumeration[94371136625216]: initialized
822 DEBUG libusbsio HID enumeration[94371136625216]: device #0: MCU HID GENERIC DEVICE
823 DEBUG libusbsio HID enumeration[94371136625216]: device #1: PlaylistControl
823 DEBUG libusbsio HID enumeration[94371136625216]: device #2: Tealk-Magic Trackpad 2
823 DEBUG libusbsio HID enumeration[94371136625216]: device #3: MX Keys
823 INFO libusbsio HID enumeration[94371136625216]: finished, total 4 devices
833 DEBUG fido2.hid.linux Failed opening device /dev/hidraw4
Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw4'
834 DEBUG fido2.hid.linux Failed opening device /dev/hidraw3
Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw3'
834 DEBUG fido2.hid.linux Failed opening device /dev/hidraw2
Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw2'
834 DEBUG fido2.hid.linux Failed opening device /dev/hidraw1
Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw1'
834 DEBUG fido2.hid.linux Failed opening device /dev/hidraw0
Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw0'
834 INFO spsdk.mboot.mcuboot Connect: MCU HID GENERIC DEVICE (0x20A0, 0x42DD)
834 DEBUG spsdk.mboot.interfaces.usb Open Interface
834 INFO libusbsio.hidapi.dev Opening HID device at path: 'b'/dev/hidraw1''
834 ERROR libusbsio.hidapi.dev HID device 'b'/dev/hidraw1'' opening failed.
835 INFO pynitrokey.nk3.updates Firmware version before update: 
837 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): api.github.com:443
1118 DEBUG urllib3.connectionpool https://api.github.com:443 "GET /repos/Nitrokey/nitrokey-3-firmware/releases/latest HTTP/1.1" 200 2543
1121 INFO pynitrokey.nk3.updates Latest firmware version: v1.3.1
1121 INFO pynitrokey.nk3.updates Current firmware version: None
1121 INFO pynitrokey.nk3.updates Updated firmware version: v1.3.1
1643 INFO pynitrokey.nk3.updates Trying to download firmware update from URL: https://github.com/Nitrokey/nitrokey-3-firmware/releases/download/v1.3.1/firmware-nk3-v1.3.1.zip
1645 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): github.com:443
1975 DEBUG urllib3.connectionpool https://github.com:443 "GET /Nitrokey/nitrokey-3-firmware/releases/download/v1.3.1/firmware-nk3-v1.3.1.zip HTTP/1.1" 302 0
1978 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): objects.githubusercontent.com:443
2175 DEBUG urllib3.connectionpool https://objects.githubusercontent.com:443 "GET /github-production-release-asset-2e65be/366410832/ee226f9f-1277-4227-8ff3-cf63c1d88cf8?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230406%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230406T200346Z&X-Amz-Expires=300&X-Amz-Signature=a9752ca5b6a2bc73898b430000a27d66b0f12c3be333428b9444084670c74710&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=366410832&response-content-disposition=attachment%3B%20filename%3Dfirmware-nk3-v1.3.1.zip&response-content-type=application%2Foctet-stream HTTP/1.1" 200 625121
2270 DEBUG root print: Current firmware version: [unknown]
2270 DEBUG root print: Updated firmware version: v1.3.1
2270 DEBUG root print: Please do not remove the Nitrokey 3 or insert any other Nitrokey 3 devices during the update. Doing so may damage the Nitrokey 3.
5826 DEBUG pynitrokey.nk3.updates Starting firmware update
5826 INFO spsdk.mboot.mcuboot CMD: ReceiveSBfile(data_length=316496)
5826 INFO spsdk.mboot.mcuboot CMD: GetProperty('MaxPacketSize', index=0)
5826 DEBUG spsdk.mboot.mcuboot TX-PACKET: Tag=GetProperty, Flags=0x00, P[0]=0x0000000B, P[1]=0x00000000
5826 DEBUG spsdk.mboot.interfaces.usb OUT[16]: 01, 00, 0C, 00, 07, 00, 00, 02, 0B, 00, 00, 00, 00, 00, 00, 00
5826 WARNING spsdk.mboot.mcuboot CMD: Unable to get MAX PACKET SIZE, using: 32
5826 INFO spsdk.mboot.mcuboot CMD: Max Packet Size = 32
5828 DEBUG spsdk.mboot.mcuboot TX-PACKET: Tag=ReceiveSBFile, Flags=0x01, P[0]=0x0004D450
5828 DEBUG spsdk.mboot.interfaces.usb OUT[12]: 01, 00, 08, 00, 08, 01, 00, 01, 50, D4, 04, 00
5828 INFO spsdk.mboot.mcuboot Closing: MCU HID GENERIC DEVICE (0x20A0, 0x42DD)
5828 DEBUG spsdk.mboot.interfaces.usb Close Interface
5829 WARNING pynitrokey.cli An unhandled exception occurred
Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 214, in write
    _bytes_written = self.device.Write(raw_data, timeout_ms=self.timeout)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 362, in _perform_update
    device.update(image, callback=callback)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 106, in update
    success = self.device.receive_sb_file(
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 655, in receive_sb_file
    cmd_response = self._process_cmd(cmd_packet)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 117, in _process_cmd
    self._device.write(cmd_packet)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 217, in write
    raise McuBootConnectionError(str(e)) from e
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/update.py", line 140, in update
    return updater.update(device, image, version, ignore_pynitrokey_version)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 215, in update
    self._perform_update(bootloader, container)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 364, in _perform_update
    raise self.ui.error("Failed to perform firmware update", e)
pynitrokey.cli.exceptions.CliException: Failed to perform firmware update
MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 170, in close
    self.device.Close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/ __init__.py", line 129, in main
    nitropy()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/ __init__.py", line 447, in update
    exec_update(ctx, image, version, ignore_pynitrokey_version)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/update.py", line 138, in update
    with ctx.connect() as device:
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/base.py", line 25, in __exit__
    self.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 73, in close
    self.device.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 276, in close
    self._device.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 173, in close
    raise McuBootConnectionError(
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> Unable to close device 'b'/dev/hidraw1'' VID=8352 PID=17117 SN=''
5831 DEBUG root print: Critical error:
5831 DEBUG root print: An unhandled exception occurred
5831 ERROR root MBoot: Connection issue -> Unable to close device 'b'/dev/hidraw1'' VID=8352 PID=17117 SN=''
Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 214, in write
    _bytes_written = self.device.Write(raw_data, timeout_ms=self.timeout)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 362, in _perform_update
    device.update(image, callback=callback)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 106, in update
    success = self.device.receive_sb_file(
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 655, in receive_sb_file
    cmd_response = self._process_cmd(cmd_packet)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 117, in _process_cmd
    self._device.write(cmd_packet)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 217, in write
    raise McuBootConnectionError(str(e)) from e
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/update.py", line 140, in update
    return updater.update(device, image, version, ignore_pynitrokey_version)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 215, in update
    self._perform_update(bootloader, container)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 364, in _perform_update
    raise self.ui.error("Failed to perform firmware update", e)
pynitrokey.cli.exceptions.CliException: Failed to perform firmware update
MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 170, in close
    self.device.Close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/ __init__.py", line 129, in main
    nitropy()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/ __init__.py", line 447, in update
    exec_update(ctx, image, version, ignore_pynitrokey_version)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/update.py", line 138, in update
    with ctx.connect() as device:
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/base.py", line 25, in __exit__
    self.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 73, in close
    self.device.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 276, in close
    self._device.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 173, in close
    raise McuBootConnectionError(
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> Unable to close device 'b'/dev/hidraw1'' VID=8352 PID=17117 SN=''
5832 DEBUG root listing all connected devices:
5832 DEBUG root :: 'Nitrokey FIDO2' keys
5832 DEBUG root :: 'Nitrokey Start' keys:
5859 DEBUG root :: 'Nitrokey 3' keys
5863 INFO libusbsio HID enumeration[94371135680384]: initialized
5863 DEBUG libusbsio HID enumeration[94371135680384]: device #0: MCU HID GENERIC DEVICE
5864 DEBUG libusbsio HID enumeration[94371135680384]: device #1: PlaylistControl
5864 DEBUG libusbsio HID enumeration[94371135680384]: device #2: Tealk-Magic Trackpad 2
5864 DEBUG libusbsio HID enumeration[94371135680384]: device #3: MX Keys
5864 INFO libusbsio HID enumeration[94371135680384]: finished, total 4 devices
5873 INFO spsdk.mboot.mcuboot Connect: MCU HID GENERIC DEVICE (0x20A0, 0x42DD)
5873 DEBUG spsdk.mboot.interfaces.usb Open Interface
5873 INFO libusbsio.hidapi.dev Opening HID device at path: 'b'/dev/hidraw1''
5874 ERROR libusbsio.hidapi.dev HID device 'b'/dev/hidraw1'' opening failed.
5874 INFO spsdk.mboot.mcuboot CMD: GetProperty('UniqueDeviceIdent', index=0)
5874 DEBUG spsdk.mboot.mcuboot TX-PACKET: Tag=GetProperty, Flags=0x00, P[0]=0x00000012, P[1]=0x00000000
5874 DEBUG spsdk.mboot.interfaces.usb OUT[16]: 01, 00, 0C, 00, 07, 00, 00, 02, 12, 00, 00, 00, 00, 00, 00, 00
5874 INFO spsdk.mboot.mcuboot Closing: MCU HID GENERIC DEVICE (0x20A0, 0x42DD)
5874 DEBUG spsdk.mboot.interfaces.usb Close Interface
5874 DEBUG root Unable to list devices. See log for the details.
5874 ERROR root Unable to list devices
Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 214, in write
    _bytes_written = self.device.Write(raw_data, timeout_ms=self.timeout)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 362, in _perform_update
    device.update(image, callback=callback)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 106, in update
    success = self.device.receive_sb_file(
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 655, in receive_sb_file
    cmd_response = self._process_cmd(cmd_packet)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 117, in _process_cmd
    self._device.write(cmd_packet)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 217, in write
    raise McuBootConnectionError(str(e)) from e
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/update.py", line 140, in update
    return updater.update(device, image, version, ignore_pynitrokey_version)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 215, in update
    self._perform_update(bootloader, container)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 364, in _perform_update
    raise self.ui.error("Failed to perform firmware update", e)
pynitrokey.cli.exceptions.CliException: Failed to perform firmware update
MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 170, in close
    self.device.Close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/ __init__.py", line 129, in main
    nitropy()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/ __init__.py", line 447, in update
    exec_update(ctx, image, version, ignore_pynitrokey_version)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/update.py", line 138, in update
    with ctx.connect() as device:
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/base.py", line 25, in __exit__
    self.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 73, in close
    self.device.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 276, in close
    self._device.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 173, in close
    raise McuBootConnectionError(
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> Unable to close device 'b'/dev/hidraw1'' VID=8352 PID=17117 SN=''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 214, in write
    _bytes_written = self.device.Write(raw_data, timeout_ms=self.timeout)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/ __init__.py", line 140, in list
    uuid = device.uuid()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 85, in uuid
    uuid = self.device.get_property(PropertyTag.UNIQUE_DEVICE_IDENT) # type: ignore[arg-type]
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 616, in get_property
    cmd_response = self._process_cmd(cmd_packet)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 117, in _process_cmd
    self._device.write(cmd_packet)
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 217, in write
    raise McuBootConnectionError(str(e)) from e
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 170, in close
    self.device.Close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/helpers.py", line 209, in local_critical
    nitropy.commands["list"].callback()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/ __init__.py", line 113, in list
    _list()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/ __init__.py", line 106, in _list
    nk3.commands["list"].callback()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/cli/nk3/ __init__.py", line 139, in list
    with device as device:
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/base.py", line 25, in __exit__
    self.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 73, in close
    self.device.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 276, in close
    self._device.close()
  File "/home/tealk/.local/pipx/venvs/pynitrokey/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 173, in close
    raise McuBootConnectionError(
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> Unable to close device 'b'/dev/hidraw1'' VID=8352 PID=17117 SN=''
5875 DEBUG root print: --------------------------------------------------------------------------------
5875 DEBUG root print: Critical error occurred, exiting now
5875 DEBUG root print: Unexpected? Is this a bug? Would you like to get support/help?
5875 DEBUG root print: - You can report issues at: https://support.nitrokey.com/
5875 DEBUG root print: - Writing an e-mail to support@nitrokey.com is also possible
5875 DEBUG root print: - Please attach the log: '/tmp/nitropy.log.p98xobh8' with any support/help request!
5875 DEBUG root print: - Please check if you have udev rules installed: https://docs.nitrokey.com/nitrokey3/linux/firmware-update.html#troubleshooting

```

---

<div class="post-metadata">

**Author:** ![simon](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@simon](https://support.nitrokey.com/u/simon)\
**Post date:** [April 11, 2023, 7:17pm UTC](https://support.nitrokey.com/t/cant-update-to-1-3-1/4962/2 "2023-04-11T19:17:28Z")

</div>

Hi,

this seems to be a udev rules issue. It is documented here [Troubleshooting - Nitrokey Documentation](https://docs.nitrokey.com/nitrokey3/linux/troubleshooting#nitrokey-is-not-detected-on-linux)

Best regards  
Simon

---

<div class="post-metadata">

**Author:** ![Tealk](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/t/bbe5ce/32.png) [@Tealk](https://support.nitrokey.com/u/Tealk)\
**Post date:** [April 11, 2023, 10:08pm UTC](https://support.nitrokey.com/t/cant-update-to-1-3-1/4962/3 "2023-04-11T22:08:11Z")

</div>

I have already tried that, as well as trying the restart. Error remains.

---

<div class="post-metadata">

**Author:** ![daringer](https://support.nitrokey.com/user_avatar/support.nitrokey.com/daringer/32/684_2.png) [@daringer](https://support.nitrokey.com/u/daringer)\
**Post date:** [April 12, 2023, 8:59am UTC](https://support.nitrokey.com/t/cant-update-to-1-3-1/4962/4 "2023-04-12T08:59:39Z")

</div>

Can you please try it as `root`, if this works we are likely seeing a permission issue…

---

<div class="post-metadata">

**Author:** ![Tealk](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/t/bbe5ce/32.png) [@Tealk](https://support.nitrokey.com/u/Tealk)\
**Post date:** [April 12, 2023, 3:36pm UTC](https://support.nitrokey.com/t/cant-update-to-1-3-1/4962/5 "2023-04-12T15:36:10Z")

</div>

`sudo nitropy nk3 update`

so that works, thank you

---

<div class="post-metadata">

**Author:** ![mepi0011](https://support.nitrokey.com/user_avatar/support.nitrokey.com/mepi0011/32/1416_2.png) [@mepi0011](https://support.nitrokey.com/u/mepi0011)\
**Post date:** [May 7, 2023, 4:41pm UTC](https://support.nitrokey.com/t/cant-update-to-1-3-1/4962/6 "2023-05-07T16:41:01Z")

</div>

Hi, I had the same problem on Manjaro Linux.

On [ArchWiki for udev](https://wiki.archlinux.org/title/udev) Chapter 4.2 I found some information about the tag T_AG+=“uaccess”_ which is used for user access.

To solve the problem, I changed the last line in the file 41-nitrokey.rules from

`KERNEL=="sd?1", ATTRS{idVendor}=="20a0", ATTRS{idProduct}=="4109", SYMLINK+="nitrospace"`

to  
`KERNEL=="sd?1", ATTRS{idVendor}=="20a0", ATTRS{idProduct}=="4109", SYMLINK+="nitrospace", TAG+="uaccess"`

Do not forge to reboot you system or run `sudo udevadm control --reload-rules && udevadm trigger`!

Before I change the file 41-nitrokey.rules I get following error (log file):

```auto
151 INFO pynitrokey.cli Timestamp: 2023-05-07 18:02:36.802267
151 INFO pynitrokey.cli OS: uname_result(system='Linux', node='pc', release='6.1.26-1-MANJARO', version='#1 SMP PREEMPT_DYNAMIC Wed Apr 26 22:07:35 UTC 2023', machine='x86_64')
151 INFO pynitrokey.cli Python version: 3.10.10
155 INFO pynitrokey.cli pynitrokey version: 0.4.35
155 INFO pynitrokey.cli cryptography version: 40.0.1
155 INFO pynitrokey.cli ecdsa version: 0.18.0
155 INFO pynitrokey.cli fido2 version: 1.1.0
156 INFO pynitrokey.cli pyusb version: 1.2.1
156 INFO pynitrokey.cli spsdk version: 1.8.0
362 INFO libusbsio Loading SIO library: /usr/lib/python3.10/site-packages/libusbsio/bin/linux_x86_64/libusbsio.so
364 INFO libusbsio HID enumeration[93841724220944]: initialized
364 DEBUG libusbsio HID enumeration[93841724220944]: device #0: USB Receiver
365 DEBUG libusbsio HID enumeration[93841724220944]: device #1: USB Receiver
365 DEBUG libusbsio HID enumeration[93841724220944]: device #2: USB Receiver
365 DEBUG libusbsio HID enumeration[93841724220944]: device #3: USB Receiver
365 DEBUG libusbsio HID enumeration[93841724220944]: device #4: Nitrokey 3
365 DEBUG libusbsio HID enumeration[93841724220944]: device #5: AURA LED Controller
365 DEBUG libusbsio HID enumeration[93841724220944]: device #6: Keyboard
365 DEBUG libusbsio HID enumeration[93841724220944]: device #7: System Control
365 INFO libusbsio HID enumeration[93841724220944]: finished, total 8 devices
424 DEBUG fido2.hid.linux Failed opening device /dev/hidraw6
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw6'
424 DEBUG fido2.hid.linux Failed opening device /dev/hidraw5
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw5'
425 DEBUG fido2.hid.linux Failed opening device /dev/hidraw4
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw4'
425 DEBUG fido2.hid.linux Failed opening device /dev/hidraw2
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw2'
425 DEBUG fido2.hid.linux Failed opening device /dev/hidraw1
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw1'
425 DEBUG fido2.hid.linux Failed opening device /dev/hidraw3
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw3'
425 DEBUG fido2.hid.linux Failed opening device /dev/hidraw0
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw0'
502 INFO pynitrokey.nk3.updates Firmware version before update: v1.2.2
503 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): api.github.com:443
779 DEBUG urllib3.connectionpool https://api.github.com:443 "GET /repos/Nitrokey/nitrokey-3-firmware/releases/latest HTTP/1.1" 200 None
781 INFO pynitrokey.nk3.updates Latest firmware version: v1.3.1
781 INFO pynitrokey.nk3.updates Current firmware version: v1.2.2
781 INFO pynitrokey.nk3.updates Updated firmware version: v1.3.1
2722 INFO pynitrokey.nk3.updates Trying to download firmware update from URL: https://github.com/Nitrokey/nitrokey-3-firmware/releases/download/v1.3.1/firmware-nk3-v1.3.1.zip
2723 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): github.com:443
2875 DEBUG urllib3.connectionpool https://github.com:443 "GET /Nitrokey/nitrokey-3-firmware/releases/download/v1.3.1/firmware-nk3-v1.3.1.zip HTTP/1.1" 302 0
2876 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): objects.githubusercontent.com:443
3093 DEBUG urllib3.connectionpool https://objects.githubusercontent.com:443 "GET /github-production-release-asset-2e65be/366410832/ee226f9f-1277-4227-8ff3-cf63c1d88cf8?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230507%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230507T160203Z&X-Amz-Expires=300&X-Amz-Signature=4f0435a8a9dfa26c71a0b5279042fc3c8b4b866de3763f01b1eea6243a6cec84&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=366410832&response-content-disposition=attachment%3B%20filename%3Dfirmware-nk3-v1.3.1.zip&response-content-type=application%2Foctet-stream HTTP/1.1" 200 625121
3410 DEBUG root print: Current firmware version: v1.2.2
3410 DEBUG root print: Updated firmware version: v1.3.1
3410 DEBUG root print: Please do not remove the Nitrokey 3 or insert any other Nitrokey 3 devices during the update. Doing so may damage the Nitrokey 3.
5041 DEBUG root print: Please press the touch button to reboot the device into bootloader mode ...
7168 DEBUG pynitrokey.nk3.device./dev/hidraw7 ignoring OSError after reboot
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/device.py", line 92, in reboot
    self._call(Command.UPDATE)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/device.py", line 133, in _call
    response = self.device.call(command.value, data=data)
  File "/usr/lib/python3.10/site-packages/fido2/hid/ __init__.py", line 189, in call
    recv = self._connection.read_packet()
  File "/usr/lib/python3.10/site-packages/fido2/hid/base.py", line 80, in read_packet
    return os.read(self.handle, self.descriptor.report_size_in)
OSError: [Errno 5] Input/output error
7169 DEBUG pynitrokey.nk3.updates Trying to connect to bootloader (try 1 of 3)
7169 DEBUG pynitrokey.cli.nk3 Searching Nitrokey 3 bootloader device (try 1 of 30)
7172 INFO libusbsio HID enumeration[93841728351968]: initialized
7172 DEBUG libusbsio HID enumeration[93841728351968]: device #0: USB Receiver
7172 DEBUG libusbsio HID enumeration[93841728351968]: device #1: USB Receiver
7172 DEBUG libusbsio HID enumeration[93841728351968]: device #2: USB Receiver
7172 DEBUG libusbsio HID enumeration[93841728351968]: device #3: USB Receiver
7172 DEBUG libusbsio HID enumeration[93841728351968]: device #4: AURA LED Controller
7172 DEBUG libusbsio HID enumeration[93841728351968]: device #5: Keyboard
7172 DEBUG libusbsio HID enumeration[93841728351968]: device #6: System Control
7172 INFO libusbsio HID enumeration[93841728351968]: finished, total 7 devices
7176 DEBUG pynitrokey.cli.nk3 No Nitrokey 3 bootloader device found, continuing
7677 DEBUG pynitrokey.cli.nk3 Searching Nitrokey 3 bootloader device (try 2 of 30)
7679 INFO libusbsio HID enumeration[93841718053600]: initialized
7679 DEBUG libusbsio HID enumeration[93841718053600]: device #0: USB Receiver
7679 DEBUG libusbsio HID enumeration[93841718053600]: device #1: USB Receiver
7679 DEBUG libusbsio HID enumeration[93841718053600]: device #2: USB Receiver
7679 DEBUG libusbsio HID enumeration[93841718053600]: device #3: USB Receiver
7679 DEBUG libusbsio HID enumeration[93841718053600]: device #4: MCU HID GENERIC DEVICE
7679 DEBUG libusbsio HID enumeration[93841718053600]: device #5: AURA LED Controller
7679 DEBUG libusbsio HID enumeration[93841718053600]: device #6: Keyboard
7680 DEBUG libusbsio HID enumeration[93841718053600]: device #7: System Control
7680 INFO libusbsio HID enumeration[93841718053600]: finished, total 8 devices
7682 DEBUG fido2.hid.linux Failed opening device /dev/hidraw8
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/usr/lib/python3.10/site-packages/fido2/hid/linux.py", line 55, in get_descriptor
    with open(path, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw8'
7682 INFO spsdk.mboot.mcuboot Connect: MCU HID GENERIC DEVICE (0x20A0, 0x42DD) path=b'/dev/hidraw8'
7682 DEBUG spsdk.mboot.interfaces.usb Open Interface
7682 INFO libusbsio.hidapi.dev Opening HID device at path: 'b'/dev/hidraw8''
7682 ERROR libusbsio.hidapi.dev HID device 'b'/dev/hidraw8'' opening failed.
8147 DEBUG pynitrokey.nk3.updates Starting firmware update
8147 INFO spsdk.mboot.mcuboot CMD: ReceiveSBfile(data_length=316496)
8147 INFO spsdk.mboot.mcuboot CMD: GetProperty('MaxPacketSize', index=0)
8147 DEBUG spsdk.mboot.mcuboot TX-PACKET: Tag=GetProperty, Flags=0x00, P[0]=0x0000000B, P[1]=0x00000000
8147 DEBUG spsdk.mboot.interfaces.usb OUT[16]: 01, 00, 0C, 00, 07, 00, 00, 02, 0B, 00, 00, 00, 00, 00, 00, 00
8147 WARNING spsdk.mboot.mcuboot CMD: Unable to get MAX PACKET SIZE, using: 32
8147 INFO spsdk.mboot.mcuboot CMD: Max Packet Size = 32
8148 DEBUG spsdk.mboot.mcuboot TX-PACKET: Tag=ReceiveSBFile, Flags=0x01, P[0]=0x0004D450
8148 DEBUG spsdk.mboot.interfaces.usb OUT[12]: 01, 00, 08, 00, 08, 01, 00, 01, 50, D4, 04, 00
8148 INFO spsdk.mboot.mcuboot Closing: MCU HID GENERIC DEVICE (0x20A0, 0x42DD) path=b'/dev/hidraw8'
8148 DEBUG spsdk.mboot.interfaces.usb Close Interface
8148 DEBUG pynitrokey.nk3.updates Received connection error
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 214, in write
    _bytes_written = self.device.Write(raw_data, timeout_ms=self.timeout)
  File "/usr/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/usr/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 362, in _perform_update
    device.update(image, callback=callback)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 106, in update
    success = self.device.receive_sb_file(
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 655, in receive_sb_file
    cmd_response = self._process_cmd(cmd_packet)
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 117, in _process_cmd
    self._device.write(cmd_packet)
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 217, in write
    raise McuBootConnectionError(str(e)) from e
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 340, in _get_bootloader
    yield bootloader
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 215, in update
    self._perform_update(bootloader, container)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 364, in _perform_update
    raise self.ui.error("Failed to perform firmware update", e)
pynitrokey.cli.exceptions.CliException: Failed to perform firmware update
MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 170, in close
    self.device.Close()
  File "/usr/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/usr/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 337, in _get_bootloader
    with self.await_bootloader() as bootloader:
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/base.py", line 25, in __exit__
    self.close()
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 73, in close
    self.device.close()
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 276, in close
    self._device.close()
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 173, in close
    raise McuBootConnectionError(
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> Unable to close device 'b'/dev/hidraw8'' VID=8352 PID=17117 SN=''
8649 DEBUG pynitrokey.nk3.updates Trying to connect to bootloader (try 2 of 3)
8649 DEBUG pynitrokey.cli.nk3 Searching Nitrokey 3 bootloader device (try 1 of 30)
8652 INFO libusbsio HID enumeration[93841726636928]: initialized
8652 DEBUG libusbsio HID enumeration[93841726636928]: device #0: USB Receiver
8652 DEBUG libusbsio HID enumeration[93841726636928]: device #1: USB Receiver
8652 DEBUG libusbsio HID enumeration[93841726636928]: device #2: USB Receiver
8652 DEBUG libusbsio HID enumeration[93841726636928]: device #3: USB Receiver
8652 DEBUG libusbsio HID enumeration[93841726636928]: device #4: MCU HID GENERIC DEVICE
8652 DEBUG libusbsio HID enumeration[93841726636928]: device #5: AURA LED Controller
8652 DEBUG libusbsio HID enumeration[93841726636928]: device #6: Keyboard
8652 DEBUG libusbsio HID enumeration[93841726636928]: device #7: System Control
8652 INFO libusbsio HID enumeration[93841726636928]: finished, total 8 devices
8712 INFO spsdk.mboot.mcuboot Connect: MCU HID GENERIC DEVICE (0x20A0, 0x42DD) path=b'/dev/hidraw8'
8712 DEBUG spsdk.mboot.interfaces.usb Open Interface
8712 INFO libusbsio.hidapi.dev Opening HID device at path: 'b'/dev/hidraw8''
8767 INFO libusbsio.hidapi.dev HID device 93841728341872 is now open
8768 WARNING pynitrokey.cli An unhandled exception occurred
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 214, in write
    _bytes_written = self.device.Write(raw_data, timeout_ms=self.timeout)
  File "/usr/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/usr/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 362, in _perform_update
    device.update(image, callback=callback)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 106, in update
    success = self.device.receive_sb_file(
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 655, in receive_sb_file
    cmd_response = self._process_cmd(cmd_packet)
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 117, in _process_cmd
    self._device.write(cmd_packet)
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 217, in write
    raise McuBootConnectionError(str(e)) from e
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 340, in _get_bootloader
    yield bootloader
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 215, in update
    self._perform_update(bootloader, container)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 364, in _perform_update
    raise self.ui.error("Failed to perform firmware update", e)
pynitrokey.cli.exceptions.CliException: Failed to perform firmware update
MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/cli/ __init__.py", line 129, in main
    nitropy()
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pynitrokey/cli/nk3/ __init__.py", line 447, in update
    exec_update(ctx, image, version, ignore_pynitrokey_version)
  File "/usr/lib/python3.10/site-packages/pynitrokey/cli/nk3/update.py", line 140, in update
    return updater.update(device, image, version, ignore_pynitrokey_version)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 194, in update
    with self._get_bootloader(device) as bootloader:
  File "/usr/lib/python3.10/contextlib.py", line 185, in __exit__
    raise RuntimeError("generator didn't stop after throw()")
RuntimeError: generator didn't stop after throw()
8769 DEBUG root print: Critical error:
8769 DEBUG root print: An unhandled exception occurred
8769 ERROR root generator didn't stop after throw()
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 214, in write
    _bytes_written = self.device.Write(raw_data, timeout_ms=self.timeout)
  File "/usr/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1357, in wrapper
    self._check_device_open()
  File "/usr/lib/python3.10/site-packages/libusbsio/libusbsio.py", line 1342, in _check_device_open
    raise LIBUSBSIO_Exception("HID DEVICE is not open.")
libusbsio.libusbsio.LIBUSBSIO_Exception: LIBUSBSIO: HID DEVICE is not open.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 362, in _perform_update
    device.update(image, callback=callback)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/bootloader/lpc55.py", line 106, in update
    success = self.device.receive_sb_file(
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 655, in receive_sb_file
    cmd_response = self._process_cmd(cmd_packet)
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/mcuboot.py", line 117, in _process_cmd
    self._device.write(cmd_packet)
  File "/usr/lib/python3.10/site-packages/spsdk/mboot/interfaces/usb.py", line 217, in write
    raise McuBootConnectionError(str(e)) from e
spsdk.mboot.exceptions.McuBootConnectionError: MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 340, in _get_bootloader
    yield bootloader
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 215, in update
    self._perform_update(bootloader, container)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 364, in _perform_update
    raise self.ui.error("Failed to perform firmware update", e)
pynitrokey.cli.exceptions.CliException: Failed to perform firmware update
MBoot: Connection issue -> LIBUSBSIO: HID DEVICE is not open.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pynitrokey/cli/ __init__.py", line 129, in main
    nitropy()
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pynitrokey/cli/nk3/ __init__.py", line 447, in update
    exec_update(ctx, image, version, ignore_pynitrokey_version)
  File "/usr/lib/python3.10/site-packages/pynitrokey/cli/nk3/update.py", line 140, in update
    return updater.update(device, image, version, ignore_pynitrokey_version)
  File "/usr/lib/python3.10/site-packages/pynitrokey/nk3/updates.py", line 194, in update
    with self._get_bootloader(device) as bootloader:
  File "/usr/lib/python3.10/contextlib.py", line 185, in __exit__
    raise RuntimeError("generator didn't stop after throw()")
RuntimeError: generator didn't stop after throw()
8769 DEBUG root listing all connected devices:
8769 DEBUG root :: 'Nitrokey FIDO2' keys
8769 DEBUG root :: 'Nitrokey Start' keys:
8781 DEBUG root :: 'Nitrokey 3' keys
8784 INFO libusbsio HID enumeration[93841727118480]: initialized
8784 DEBUG libusbsio HID enumeration[93841727118480]: device #0: USB Receiver
8785 DEBUG libusbsio HID enumeration[93841727118480]: device #1: USB Receiver
8785 DEBUG libusbsio HID enumeration[93841727118480]: device #2: USB Receiver
8785 DEBUG libusbsio HID enumeration[93841727118480]: device #3: USB Receiver
8785 DEBUG libusbsio HID enumeration[93841727118480]: device #4: MCU HID GENERIC DEVICE
8785 DEBUG libusbsio HID enumeration[93841727118480]: device #5: AURA LED Controller
8785 DEBUG libusbsio HID enumeration[93841727118480]: device #6: Keyboard
8785 DEBUG libusbsio HID enumeration[93841727118480]: device #7: System Control
8785 INFO libusbsio HID enumeration[93841727118480]: finished, total 8 devices
8789 INFO spsdk.mboot.mcuboot Connect: MCU HID GENERIC DEVICE (0x20A0, 0x42DD) path=b'/dev/hidraw8'
8789 DEBUG spsdk.mboot.interfaces.usb Open Interface
8789 INFO libusbsio.hidapi.dev Opening HID device at path: 'b'/dev/hidraw8''
8789 INFO libusbsio.hidapi.dev HID device 93841727282464 is now open
8789 INFO spsdk.mboot.mcuboot CMD: GetProperty('UniqueDeviceIdent', index=0)
8789 DEBUG spsdk.mboot.mcuboot TX-PACKET: Tag=GetProperty, Flags=0x00, P[0]=0x00000012, P[1]=0x00000000
8789 DEBUG spsdk.mboot.interfaces.usb OUT[16]: 01, 00, 0C, 00, 07, 00, 00, 02, 12, 00, 00, 00, 00, 00, 00, 00
8789 DEBUG libusbsio.hidapi.dev HID device 93841727282464 writing[16]: 0x01000c00070000021200000000000000
8790 DEBUG libusbsio.hidapi.dev HID device 93841727282464 wrote 59 bytes
8791 DEBUG libusbsio.hidapi.dev HID device 93841727282464 read[60]: 0x03001800a70000050000000085948c75299530519a10a7c1ddb273e00000000000000000000000000000000000000000000000000000000000000000
8791 DEBUG spsdk.mboot.interfaces.usb IN [60]: 03, 00, 18, 00, A7, 00, 00, 05, 00, 00, 00, 00, 85, 94, 8C, 75, 29, 95, 30, 51, 9A, 10, A7, C1, DD, B2, 73, E0, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
8791 DEBUG spsdk.mboot.mcuboot RX-PACKET: Tag=GetPropertyResponse, Status=Success, v0=0x758C9485, v1=0x51309529, v2=0xC1A7109A, v3=0xE073B2DD
8791 DEBUG root /dev/hidraw8: Nitrokey 3 Bootloader (LPC55) 85948C75299530519A10A7C1DDB273E0
8791 INFO spsdk.mboot.mcuboot Closing: MCU HID GENERIC DEVICE (0x20A0, 0x42DD) path=b'/dev/hidraw8'
8791 DEBUG spsdk.mboot.interfaces.usb Close Interface
8791 INFO libusbsio.hidapi.dev HID device 93841727282464 closed
8791 DEBUG root print: --------------------------------------------------------------------------------
8791 DEBUG root print: Critical error occurred, exiting now
8791 DEBUG root print: Unexpected? Is this a bug? Would you like to get support/help?
8791 DEBUG root print: - You can report issues at: https://support.nitrokey.com/
8791 DEBUG root print: - Writing an e-mail to support@nitrokey.com is also possible
8791 DEBUG root print: - Please attach the log: '/tmp/nitropy.log.dzexcly7' with any support/help request!
8791 DEBUG root print: - Please check if you have udev rules installed: https://docs.nitrokey.com/nitrokey3/linux/firmware-update.html#troubleshooting
8791 INFO spsdk.mboot.mcuboot Closing: MCU HID GENERIC DEVICE (0x20A0, 0x42DD) path=b'/dev/hidraw8'
8791 DEBUG spsdk.mboot.interfaces.usb Close Interface
8792 INFO libusbsio.hidapi.dev HID device 93841728341872 closed

```

---

<div class="post-metadata">

**Author:** ![mepi0011](https://support.nitrokey.com/user_avatar/support.nitrokey.com/mepi0011/32/1416_2.png) [@mepi0011](https://support.nitrokey.com/u/mepi0011)\
**Post date:** [May 7, 2023, 6:12pm UTC](https://support.nitrokey.com/t/cant-update-to-1-3-1/4962/7 "2023-05-07T18:12:26Z")

</div>

Now I wanted to update to the test firmware v1.3.1-test.20230417 and now have the same error behavior. The file _41-nitrokey.rules_ is adjusted as previously described as a solution.

After short reflection, I realized that I had possibly executed the command  
`sudo udevadm control --reload-rules && udevadm trigger` with the Nitrokey plugged in.

For verification, I plugged in the Nitrokey and executed the command  
`sudo udevadm control --reload-rules && udevadm trigger` again.

After that, the update to the version ran without problems.

This means with the file 41-nitrokey.rules or at the permissions on Arch Linux must be adjusted something. Maybe the professionals can take over here!
