LedgerHQ / app-monero

Monero wallet application for Ledger Nano S & X
Apache License 2.0
273 stars 101 forks source link

Error: failed to load wallet: Wrong sequence_idx - Intermittent Issue #42

Closed johnalanwoods closed 4 years ago

johnalanwoods commented 5 years ago

When using my Nano X with the Monero Core CLI Wallet

CLI Wallet: v0_14_1_0 Nano X FW: v1_2_4-1 Monero Client App on X: v1_3_1

I intermittently get this message

Error: failed to load wallet: Wrong sequence_idx

It occurs about 50%-70% of the time.

I generated the wallet files using this command.

--generate-from-device <new-wallet-name> --subaddress-lookahead 3:200 

When it works I can see my balance and all looks correct.

Is this a Nano X issue?

johnalanwoods commented 5 years ago

Happens with my NanoS too on v1_3_1

johnalanwoods commented 5 years ago

Reoccurrence of https://github.com/monero-project/monero/pull/4643?

selsta commented 5 years ago

Did you make sure that Ledger Live is closed while trying? It can interfere.

johnalanwoods commented 5 years ago

It was closed but previously open in the same boot session. I will reboot and retest.

johnalanwoods commented 5 years ago

Nah issue persists even after a clean boot. It's intermittent though, i.e. 50-70% of the time.

johnalanwoods commented 5 years ago

@cslashm Are you seeing this at all in your testing? By the way I'm on macOS Mojave 10.14.5 (18F203).

tficharmers commented 5 years ago

I can also confirm I have experienced this twice on macOS Mojave. Ledger Live was closed.

selsta commented 5 years ago

@tficharmers Also with v0.14.1.0 ?

tficharmers commented 5 years ago

@selsta yes. 0.14.1.0 CLI on Nano S. MacOS 10.14.5 (18F132).

1) The first time I entered the password once and had this error. Tried again without unplugging and it happened again. Unplugged, replugged and it worked.

2) The second time, I entered the password and saw the error. I tried again without unplugging and it worked.

I will do more testing.

johnalanwoods commented 5 years ago

I wonder if this might delay the public launch. It’s been solved before so probably straightforward.

selsta commented 5 years ago

I can reproduce this now, it only happens with the reproducible build version of v0.14.1.0, if I compile myself it’s working fine. I guess it has something to do with the hidapi version used for reproducible builds?

Edit: Reproducible builds use hidapi v0.8.0 which has a bug on macOS. https://github.com/signal11/hidapi/commit/59a076705b1bc5316fb4513fc28033b662a23675

cslashm commented 5 years ago

Thank you @selsta for investigating the bug.

But I don't understand why only deterministic build trigger the pb? It use the same hid-api version as for non deterministic build, no?

And the 0.8-rc1 was already the one used in 0.14.0.2

selsta commented 5 years ago

@cslashm We installed master on the macOS build server.

cslashm commented 5 years ago

ouch. I guess it will be fixed on next build

is a 0.14.1.1 on the road?

selsta commented 5 years ago

@cslashm Yes, I think so. Luckily this bug isn’t too bad because you just have to try again a few times for it to work.

cslashm commented 5 years ago

Ok, nice.

I also inform our support about this issue and workaround.

johnalanwoods commented 5 years ago

@selsta @cslashm - so in the mean time between now and 0.14.1.1, you think it's safe to use Ledger with Monero core, just by retrying until you 'get in'?

@selsta should I create a bug on the Monero codebase?

@selsta - I guess compiling myself is something I could do to avoid this issue.

johnalanwoods commented 5 years ago

I complied myself and still have the issue.

hidapi: stable 0.8.0-rc1 (bottled), HEAD Library for communicating with USB and Bluetooth HID devices https://github.com/signal11/hidapi /usr/local/Cellar/hidapi/0.8.0-rc1 (17 files, 131.1KB) * Poured from bottle on 2019-06-25 at 14:02:38

johnalanwoods commented 5 years ago

Ok, can confirm using head on hidapi works. This just needs an update on the Monero end.

hidapi/HEAD-a6a622f with Monero 0.14.1 fixes the issue.

TheCharlatan commented 5 years ago

The next release of monero will be built with version 0.9.0 of https://github.com/libusb/hidapi , pull request to change this in the reproducible build system is open: https://github.com/monero-project/monero/pull/5703