Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
98 stars 27 forks source link

Firmware update for nk3 device failing: "Serial: device reports readiness" #397

Closed johanneskastl closed 1 year ago

johanneskastl commented 1 year ago

Trying to update the firmware on my nitrokey 3A using nitropy. Not siure if this is a general error or an error in my packaging (I have packaged this for openSUSE, which was straight forward).

$ nitropy nk3 update firmware-nk3-v1.4.0.zip 
Command line tool to interact with Nitrokey devices 0.4.36
Current firmware version:  v1.3.1
Updated firmware version:  v1.4.0

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

Please press the touch button to reboot the device into bootloader mode ...

Perform firmware update:   0%|                                                                                                                                    | 0.00/441k [00:05<?, ?B/s]
Critical error:
Failed to perform firmware update
        Exception encountered: SerialException('device reports readiness to read but returned no data (device disconnected or multiple access on port?)')

--------------------------------------------------------------------------------
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.y92o_7s4' with any support/help request!
- Please check if you have udev rules installed: https://docs.nitrokey.com/nitrokey3/linux/firmware-update.html#troubleshooting

nitropy.log.y92o_7s4.txt

johanneskastl commented 1 year ago

Restarting the update afterwards, where the device was already in bootloader mode, seems to have worked:

$ nitropy nk3 update firmware-nk3-v1.4.0.zip 
Command line tool to interact with Nitrokey devices 0.4.36
Current firmware version:  [unknown]
Updated firmware version:  v1.4.0

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

During this update process the internal filesystem will be migrated!
- Migration will only work, if your internal filesystem does not contain more than 45 Resident Keys. If you have more please remove some.
- After the update it might take up to 3minutes for the first boot.
Never unplug the device while the LED is active!
Have you read these information? Do you want to continue? [y/N]: y
Perform firmware update: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 441k/441k [00:24<00:00, 17.7kB/s]
Finalize upgrade: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:19<00:00,  5.26%/s]
szszszsz commented 1 year ago

Hi! Is it possible in your environment that other program blocks access to the /dev/ttyACM1 device? Like ModemManager?

daringer commented 1 year ago

closing this as it cannot be reproduced by us - @johanneskastl if you still encounter this issue, please re-open and try to provide a way to reproduce.

johanneskastl commented 1 year ago

Sorry, @szszszsz 's first comment went unnoticed. I'll try this again and see, if I can reproduce this (if so, I'll ask to reopen this).

And yes, I have ModemManager running on my machine...