Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geth suddenly lost account information from Ledger Nano S #15639

Closed
op9 opened this issue Dec 9, 2017 · 6 comments
Closed

Geth suddenly lost account information from Ledger Nano S #15639

op9 opened this issue Dec 9, 2017 · 6 comments
Assignees

Comments

@op9
Copy link

op9 commented Dec 9, 2017

Hi there,

I was about to transfer my out mined ETH-s to a Ledger Nano S (FW: 1.3.1).
Geth was able to see the accounts on the Ledger, so I used it.
Because this was my very first transaction, I started with a small amount of 0.05ETH.

eth.sendTransaction({from:eth.coinbase, to:eth.accounts[1], value: web3.toWei(0.05, "ether")})

It worked as I expected.
So I wanted to send all my ETHs:

eth.sendTransaction({from:eth.coinbase, to:eth.accounts[1], value: web3.toWei(12.95, "ether")})
Error: insufficient funds for gas * price + value
at web3.js:3143:20
at web3.js:6347:15
at web3.js:5081:36
at :1:1

So I have reduced the amount:

eth.sendTransaction({from:eth.coinbase, to:eth.accounts[1], value: web3.toWei(12.92, "ether")})
"0x0d0c739f63274585282640f69fc1167fbb2acf229e9e54caff3433e52fe00131"

Then I checked on etherscan:
https://etherscan.io/tx/0x0d0c739f63274585282640f69fc1167fbb2acf229e9e54caff3433e52fe00131

And I could see, that something bad is happening, because at the "to" field wasn't my address, instead it was about to create a contract.

Between these 2 transactions was 12 minutes, but I pressed buttons on Ledger to not go into "sleep" mode (vires in numeris) and I stayed inside the Ethereum app (1.0.21), as you can see also on the log I attached.
I even tried now to wait till this message, and geth was able to see the adresses.

Bonus question: how can I get my ETHs back?

System information

Geth version: 1.7.3-stable-4bb3c89d
OS & Version: Windows 10

Expected behaviour

able to see the connected ledger as 12 minutes earlier and get a valid address from "eth.accounts[1]"

Actual behaviour

without any warning it couldn't read the address from Ledger, that lead to an "undefined" value, and that created a contract

Steps to reproduce the behaviour

I tried to make a new transaction again with a higher value to cause this error message:
"Error: insufficient funds for gas * price + value"
But the accounts was still there, so I don't know how to reproduce again.

Backtrace

geth-attach.txt
geth-cmd.txt

@holiman
Copy link
Contributor

holiman commented Dec 10, 2017

First of all, the ether is lost. I'm sorry for your loss.

Secondly, judging from the logs, it looks strange that the eth.accounts[1] suddenly disappeared, since there's no mention of the USB getting dropped. When the first tx is made, the wallet 'discovered' two new accounts (which are ledger accounts 1 and 2). Could there be a bug there, @karalabe? I'll assign this to you to look into.

For anyone else reading this; it would have been avoidable if the to-address had been saved in a variable, instead of relying on eth.accounts[1]. This would also have been avoided if we have 'sign-what-you-see', instead of 'submit-then-sign'.

@op9
Copy link
Author

op9 commented Dec 10, 2017

Thank you for your comment!

I also thought, that maybe the new discovered accounts, or the change at the balance field caused something.

I noticed another interesting line.
Please look at the geth-attach.txt line: 17.
It does not return anything. I still have the console open, and checked again, and there is no return value.

I don't get this yet:

This would also have been avoided if we have 'sign-what-you-see', instead of 'submit-then-sign'.

First: the last quote is not 'sign-then-submit'? Because we unlock the account (sign) and make the sendTransaction (submit).
Second: geth is able to 'sign-what-you-see', and I should have been using it? Or geth can only 'sign-then-submit', and it would be good to change to 'sign-what-you-see'.

FYI: there is a chance to get the ETHs back, if they will implement the EIP 156, I just got an answer for my question on another forum (https://ethereum.stackexchange.com/questions/32815/transaction-sent-to-null)
FYI2: I'm Hungarian too as karalabe :)

@stale
Copy link

stale bot commented Dec 11, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@op9
Copy link
Author

op9 commented Dec 15, 2018

Any update on this one?
Or I was the only one who faced this issue?

@holiman
Copy link
Contributor

holiman commented Aug 27, 2019

We added a check for the underlying error: https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L1390
Fixed two years ago: #16108

@karalabe
Copy link
Member

Sorry again for this loss, but unfortunately there's nothing else we can do. There are no known issues with accounts disappearing temporarily that might explain what happened to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants