Nitrokey Start bricked by nitropy

Hello!

I tried to update my Nitrokey Start via nitropy on a Gentoo Linux, which failed. Now even dmesg does not mention it when plugged in.

I (later) read some mentions of udev-rules which I don’t had at that time. Probably nitropy should check and recommend the udev-rules before starting to flash?

Can I unbrick the Nitrokey somehow?

here is my cli output:

Command line tool to interact with Nitrokey devices 0.4.27
Nitrokey Start firmware update tool
Platform: Linux-5.19.3-gentoo-x86_64-AMD_Ryzen_7_3700X_8-Core_Processor-with-glibc2.35
System: Linux, is_linux: True
Python: 3.10.6
Saving run log to: /tmp/nitropy.log.1le271nh
Admin password:
Firmware data to be used:

  • regnual.bin: 4408
  • gnuk.bin: 129024
    Currently connected device strings:
    Device:
    Vendor: Nitrokey
    Product: Nitrokey Start
    Serial: FSIJ-1.2.15-67081020
    Revision: RTM.10
    Config: NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=yes:factory_reset=yes
    Sys: 3.0
    initial device strings: [{‘name’: ‘’, ‘Vendor’: ‘Nitrokey’, ‘Product’: ‘Nitrokey Start’, ‘Serial’: ‘FSIJ-1.2.15-67081020’, ‘Revision’: ‘RTM.10’, ‘Config’: ‘NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=yes:factory_reset=yes’, ‘Sys’: ‘3.0’, ‘Board’: None}]
    Please note:
  • Latest firmware available is:
    RTM.13-RC2 (published: 2022-07-07T17:30:21Z)
  • provided firmware: gnuk.bin
  • all data will be removed from the device!
  • do not interrupt update process - the device may not run properly!
  • the process should not take more than 1 minute
    Do you want to continue? [yes/no]: Do you want to continue? [yes/no]: yes

    Starting bootloader upload procedure
    error while running update
    Exception encountered: ValueError(‘No ICC present’)
    Could not connect to the device. Attempting to close scdaemon.
    Running: gpgconf --kill all
    Running: sudo systemctl stop pcscd pcscd.socket
    Passwort:
    sudo: systemctl: Befehl nicht gefunden
    Error while running command
    Exception encountered: CalledProcessError(1, [‘sudo’, ‘systemctl’, ‘stop’, ‘pcscd’, ‘pcscd.socket’])
    retrying…

    Starting bootloader upload procedure
    Device: Nitrokey Start FSIJ-1.2.15-67081020
    Connected to the device
    Running update!
    Do NOT remove the device from the USB slot, until further notice
    Downloading flash upgrade program…
    Executing flash upgrade…
    Waiting for device to appear:
    Wait 20 seconds…failed - trying again - retry: 1
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 2
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 3
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 4
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 5
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 6
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 7
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 8
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 9
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 10
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 11
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 12
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 13
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 14
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 15
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 16
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 17
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 18
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 19
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)
    .failed - trying again - retry: 20
    Exception encountered: USBError(13, ‘Access denied (insufficient permissions)’)

Critical error:
unexpected error
Exception encountered: RuntimeWarning(‘device not found - exiting’)


Critical error occurred, exiting now
Unexpected? Is this a bug? Would you like to get support/help?

  • You can report issues at: https://support.nitrokey.com/
  • Writing an e-mail to support@nitrokey.com is also possible
  • Please attach the log: ‘/tmp/nitropy.log.1le271nh’ with any support/help request!
  • Please check if you have udev rules installed: [link to nitrokey3 faq]

systemctl stop failed because Gentoo Linux by default uses openrc, but pcscd wasn’t running anyway.

And here is the log file:

1268      DEBUG       root print: Nitrokey Start firmware update tool
1268      DEBUG       root Start session 2022-08-23 11:25:16.421723
1268      DEBUG       root print: Platform: Linux-5.19.3-gentoo-x86_64-AMD_Ryzen_7_3700X_8-Core_Processor-with-glibc2.35
1268      DEBUG       root print: System: Linux, is_linux: True
1268      DEBUG       root print: Python: 3.10.6
1268      DEBUG       root print: Saving run log to: /tmp/nitropy.log.1le271nh
1268      DEBUG       root Arguments: regnual= 'regnual.bin', gnuk= 'gnuk.bin', default_password= 'False', password= '<hidden>', wait_e= '20', keyno= '0', verbose= '0', yes= 'False', skip_bootloader= 'False', green_led= 'False'
3911      DEBUG       root print: Firmware data to be used:
3912      DEBUG       root print: - regnual.bin: 4408
3912      DEBUG       root print: - gnuk.bin: 129024
3951      DEBUG       root print: Currently connected device strings:
3951      DEBUG       root print: initial device strings: [{'name': '', 'Vendor': 'Nitrokey', 'Product': 'Nitrokey Start', 'Serial': 'FSIJ-1.2.15-67081020', 'Revision': 'RTM.10', 'Config': 'NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=yes:factory_reset=yes', 'Sys': '3.0', 'Board': None}]
3954      DEBUG urllib3.connectionpool Starting new HTTPS connection (1): api.github.com:443
4355      DEBUG urllib3.connectionpool https://api.github.com:443 "GET /repos/Nitrokey/nitrokey-start-firmware/releases HTTP/1.1" 200 None
4358      DEBUG       root print: Please note:
4358      DEBUG       root print: - Latest firmware available is:
4358      DEBUG       root print: RTM.13-RC2 (published: 2022-07-07T17:30:21Z)
4358      DEBUG       root print: - provided firmware: gnuk.bin
4358      DEBUG       root print: - all data will be removed from the device!
4358      DEBUG       root print: - do not interrupt update process - the device may not run properly!
4358      DEBUG       root print: - the process should not take more than 1 minute
5960      DEBUG       root print: .
6972      DEBUG       root print: .
7985      DEBUG       root print: .
8997      DEBUG       root print: Starting bootloader upload procedure
9008      DEBUG       root print: error while running update
9008      ERROR       root No ICC present
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 148, in main
    gnuk = get_gnuk_device(logger=logger)
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/gnuk_token.py", line 731, in get_gnuk_device
    raise ValueError("No ICC present")
ValueError: No ICC present
9009      DEBUG       root print: Could not connect to the device. Attempting to close scdaemon.
9009      DEBUG       root print: Running: gpgconf --kill all
9019      DEBUG       root print: Running: sudo systemctl stop pcscd pcscd.socket
22656     DEBUG       root print: Error while running command
22656     ERROR       root Command '['sudo', 'systemctl', 'stop', 'pcscd', 'pcscd.socket']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 148, in main
    gnuk = get_gnuk_device(logger=logger)
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/gnuk_token.py", line 731, in get_gnuk_device
    raise ValueError("No ICC present")
ValueError: No ICC present

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 358, in kill_smartcard_services
    check_output(command)
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['sudo', 'systemctl', 'stop', 'pcscd', 'pcscd.socket']' returned non-zero exit status 1.
25662     DEBUG       root print: retrying...
25663     DEBUG       root print: .
26675     DEBUG       root print: .
27688     DEBUG       root print: .
28699     DEBUG       root print: Starting bootloader upload procedure
28707     DEBUG       root  1 0
28735     DEBUG       root print: Connected to the device
28914     DEBUG       root print: Running update!
28914     DEBUG       root print: Do NOT remove the device from the USB slot, until further notice
28914     DEBUG       root print: Downloading flash upgrade program...
28914     DEBUG gnuk_token print: start 20002a00
28914     DEBUG gnuk_token print: end   20003b00
28914     DEBUG       root print: Progress: 0%
28914     DEBUG       root print: Progress: 0.0%
28914     DEBUG gnuk_token print: # 20002a00: 42 : 256
28920     DEBUG gnuk_token print: # 20002b00: 43 : 256
28926     DEBUG       root print: Progress: 11.76%
28926     DEBUG gnuk_token print: # 20002c00: 44 : 256
28932     DEBUG gnuk_token print: # 20002d00: 45 : 256
28938     DEBUG       root print: Progress: 23.53%
28938     DEBUG gnuk_token print: # 20002e00: 46 : 256
28944     DEBUG gnuk_token print: # 20002f00: 47 : 256
28950     DEBUG       root print: Progress: 35.29%
28950     DEBUG gnuk_token print: # 20003000: 48 : 256
28956     DEBUG       root print: Progress: 41.18%
28956     DEBUG gnuk_token print: # 20003100: 49 : 256
28962     DEBUG gnuk_token print: # 20003200: 50 : 256
28968     DEBUG       root print: Progress: 52.94%
28968     DEBUG gnuk_token print: # 20003300: 51 : 256
28974     DEBUG gnuk_token print: # 20003400: 52 : 256
28980     DEBUG       root print: Progress: 64.71%
28980     DEBUG gnuk_token print: # 20003500: 53 : 256
28986     DEBUG       root print: Progress: 70.59%
28986     DEBUG gnuk_token print: # 20003600: 54 : 256
28992     DEBUG gnuk_token print: # 20003700: 55 : 256
28998     DEBUG       root print: Progress: 82.35%
28998     DEBUG gnuk_token print: # 20003800: 56 : 256
29004     DEBUG gnuk_token print: # 20003900: 57 : 256
29010     DEBUG       root print: Progress: 94.12%
29010     DEBUG gnuk_token print: # 20003a00: 58 : 256
29016     DEBUG gnuk_token print: # 20003b00: 59 : 60
29019     DEBUG       root print: Executing flash upgrade...
30523     DEBUG      dmesg b'[  476.174017] usb 1-8: USB disconnect, device number 5'
33526     DEBUG       root print: Waiting for device to appear:
33526     DEBUG       root print: Wait 20 seconds...
33526     DEBUG       root print: .
33530     DEBUG      dmesg b'[  479.180014] usb 1-8: new full-speed USB device number 6 using xhci_hcd'
33818     DEBUG      dmesg b'[  479.469115] usb 1-8: New USB device found, idVendor=20a0, idProduct=4211, bcdDevice= 2.00'
33818     DEBUG      dmesg b'[  479.469122] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3'
33818     DEBUG      dmesg b'[  479.469124] usb 1-8: Product: Nitrokey Start'
33819     DEBUG      dmesg b'[  479.469127] usb 1-8: Manufacturer: Nitrokey'
33819     DEBUG      dmesg b'[  479.469129] usb 1-8: SerialNumber: FSIJ-0.0'
34530     DEBUG       root print: failed - trying again - retry: 1
34530     ERROR       root [Errno 13] Access denied (insufficient permissions)
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 238, in main
    reg = regnual(dev)
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/gnuk_token.py", line 540, in __init__
    self.__devhandle.claimInterface(intf)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/legacy.py", line 232, in claimInterface
    util.claim_interface(self.dev, interface)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/util.py", line 207, in claim_interface
    device._ctx.managed_claim_interface(device, interface)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/core.py", line 170, in managed_claim_interface
    self.managed_open()
  File "/home/tux/.local/lib/python3.10/site-packages/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/core.py", line 131, in managed_open
    self.handle = self.backend.open_device(self.dev)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/backend/libusb1.py", line 804, in open_device
    return _DeviceHandle(dev)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/backend/libusb1.py", line 652, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "/home/tux/.local/lib/python3.10/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
34540     DEBUG       root print: .
35544     DEBUG       root print: failed - trying again - retry: 2
35544     ERROR       root [Errno 13] Access denied (insufficient permissions)
[ same ERROR 20 times, therefore stripped here ]
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 238, in main
    reg = regnual(dev)
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/gnuk_token.py", line 540, in __init__
    self.__devhandle.claimInterface(intf)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/legacy.py", line 232, in claimInterface
    util.claim_interface(self.dev, interface)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/util.py", line 207, in claim_interface
    device._ctx.managed_claim_interface(device, interface)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/core.py", line 170, in managed_claim_interface
    self.managed_open()
  File "/home/tux/.local/lib/python3.10/site-packages/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/core.py", line 131, in managed_open
    self.handle = self.backend.open_device(self.dev)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/backend/libusb1.py", line 804, in open_device
    return _DeviceHandle(dev)
  File "/home/tux/.local/lib/python3.10/site-packages/usb/backend/libusb1.py", line 652, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "/home/tux/.local/lib/python3.10/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
53780     DEBUG       root print: Critical error:
53780     DEBUG       root print: unexpected error
53780     ERROR       root device not found - exiting
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting
53781     DEBUG       root listing all connected devices:
53781     DEBUG fido2.hid.linux Failed opening device /dev/hidraw10
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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/hidraw10'
53782     DEBUG fido2.hid.linux Failed opening device /dev/hidraw9
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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/hidraw9'
53782     DEBUG fido2.hid.linux Failed opening device /dev/hidraw8
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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'
53782     DEBUG fido2.hid.linux Failed opening device /dev/hidraw7
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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/hidraw7'
53782     DEBUG fido2.hid.linux Failed opening device /dev/hidraw6
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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'
53783     DEBUG fido2.hid.linux Failed opening device /dev/hidraw5
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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'
53783     DEBUG fido2.hid.linux Failed opening device /dev/hidraw4
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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'
53783     DEBUG fido2.hid.linux Failed opening device /dev/hidraw3
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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'
53783     DEBUG fido2.hid.linux Failed opening device /dev/hidraw2
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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'
53783     DEBUG fido2.hid.linux Failed opening device /dev/hidraw1
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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'
53784     DEBUG fido2.hid.linux Failed opening device /dev/hidraw0
Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 605, in start_update
    main(
  File "/home/tux/.local/lib/python3.10/site-packages/pynitrokey/start/upgrade_by_passwd.py", line 249, in main
    raise RuntimeWarning("device not found - exiting")
RuntimeWarning: device not found - exiting

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tux/.local/lib/python3.10/site-packages/fido2/hid/linux.py", line 98, in list_descriptors
    devices.append(get_descriptor(hidraw))
  File "/home/tux/.local/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'
53784     DEBUG       root :: 'Nitrokey FIDO2' keys
53784     DEBUG       root :: 'Nitrokey Start' keys:
53795     DEBUG       root None: None None (None)
53795     DEBUG       root :: 'Nitrokey 3' keys
54040      INFO  libusbsio Loading SIO library: /home/tux/.local/lib/python3.10/site-packages/libusbsio/bin/linux_x86_64/libusbsio.so
54044      INFO  libusbsio HID enumeration[94011103142992]: initialized
54044     DEBUG  libusbsio HID enumeration[94011103142992]: device #0: None
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #1: None
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #2: None
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #3: RODE NT-USB
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #4: Steam Controller
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #5: Steam Controller
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #6: Steam Controller
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #7: Steam Controller
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #8: Steam Controller
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #9: Logitech BRIO
54045     DEBUG  libusbsio HID enumeration[94011103142992]: device #10: Logitech BRIO
54045      INFO  libusbsio HID enumeration[94011103142992]: finished, total 11 devices
54048     DEBUG       root print: --------------------------------------------------------------------------------
54048     DEBUG       root print: Critical error occurred, exiting now
54048     DEBUG       root print: Unexpected? Is this a bug? Would you like to get support/help?
54048     DEBUG       root print: - You can report issues at: https://support.nitrokey.com/
54048     DEBUG       root print: - Writing an e-mail to support@nitrokey.com is also possible
54048     DEBUG       root print: - Please attach the log: '/tmp/nitropy.log.1le271nh' with any support/help request!
54048     DEBUG       root print: - Please check if you have udev rules installed: https://docs.nitrokey.com/nitrokey3/linux/firmware-update.html#troubleshooting
54048     DEBUG      dmesg Finishing
54048     DEBUG      dmesg Finished

Even if it is an old thread. You may find it useful, or anyoune who search for a bricked Nitrokey.

If you forget the udev rules, try to flash the device and power cycle or unplug the Nitrokey, it can only be flashed via SWD (or on older devices maybe via DFU). I have gone the SWD way. For that you have to open the device to access the SWD ports and a ST-LINK/V2 in-circuit debugger/programmer. I had a STM32 Dev Board with ST-LINK laying around and a Pogo Pin Adapter. It is also possible to solder cables to the SWD port. There are some cheap options you can buy.

See the Flashing Instructions for Nitrokey Pro. Note: newer Nitrokey Starts share the same PCB for older devices see the README of the Nitrokey Start Hardware repoistory

What I had done:

  • Power via USB (there will be no device detected by Linux)
  • Connect SWD ports
  • Checked with stlink-gui
  • Unprotect the flash via opencd
    $ openocd -f interface/stlink.cfg -f target/stm32f1x.cfg \
              -c init -c "reset halt" -c "stm32f1x unlock 0" -c reset -c exit
    
  • Flash the extracted gnuk.hex.gz via stlink-gui (See the Nitrokey/nitrokey-start-firmware on GitHub, I can only add two Links)
    You could also use openocd to flash the device
  • Protect the device again
    $ openocd -f interface/stlink.cfg -f target/stm32f1x.cfg \
             -c init -c "reset halt" -c "stm32f1x lock 0" -c reset -c exit
    
1 Like