Open moneymanolis opened 1 year ago
have the same issue...
Related but seem to look different in the logs: #818 ( tried to fix in #1748)
I think this is issue is a special case of the overarching "USB devices are plugged-in while starting-up Specter"-issue. It is not HWI related but is related to the serial connection used by the Jade (which none of the other devices are using btw AFAIK).
This is a problem of any connected device that goes into the locked mode (Jade, Ledger, maybe Trezor). It is caused by this line: https://github.com/cryptoadvance/specter-desktop/blob/master/src/cryptoadvance/specter/hwi_rpc.py#L88
The reason for this line was that if we didn't run hwi.enumerate()
in the main thread HWI was failing to connect to the devices in the requests afterwards.
I don't know why exactly it happens, and if it was somehow fixed over the years. This hack was introduced in the very beginning when we just started implementing HWI - @kdmukai may remember.
It's worth trying to debug this issue in more detail now. Possible approaches:
hwi.enumerate
is required in the main thread, maybe it's enough listing serial and usb devices without opening them. Then instead hwi.enumerate()
we can do something simpler. We already have custom enumerate
that tries to take that into account (see https://github.com/cryptoadvance/specter-desktop/blob/master/src/cryptoadvance/specter/hwi_rpc.py#L110), but seems that it doesn't work.@moneymanolis I tried without enumerate
in __init__
, seems to work fine on Linux.
Can you test on Mac and Win?
PR: https://github.com/cryptoadvance/specter-desktop/pull/2371
The issue above still exists, if another app (e.g. a browser tab) is using Jade's serial port and one is trying to use the Jade in Specter.
This is the error in the UI:
When you try to, say, sign a transaction with a Jade, the above error does not lead to a direct crash of Specter. But, if you retry it (without closing the other app using the serial port of the Jade), Specter crashes, there is no stack trace really for this, just this in the UI:
Below is the stack trace. The error disappeared after running in the browser:
We'd need to implement a check for open ports and close them if there are any in Python. Sth. like this:
Stack trace: