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

Docker geth : Cannot unlock account : "Fatal: Failed to unlock account" #2138

Closed
gregbkr opened this Issue Jan 20, 2016 · 2 comments

Comments

Projects
None yet
1 participant
@gregbkr

gregbkr commented Jan 20, 2016

Hello Ethereum team!

I got issues to unlock account in Docker, impossible via --unlock in cmd or js (only possible while sending a transaction).

My environnement:

  • Ubuntu 14.04.2 LTS
  • docker version: 1.9.1
  • Geth 1.4 image: ethereum/client-go

My steps:

DATA container (for blockchain, wallet, password)

docker run --name=geth-data -v /root/.ethereum busybox chown 1000:1000 /root/.ethereum

Import wallet

docker cp ./keystore geth-data:/root/.ethereum/keystore
echo -n 'test' > pw
docker cp ./pw geth-data:/root/.ethereum/pw

Run geth while unlocking wallet: I tried all these commands with no luck:

docker run --name geth -it -p 8545:8545 -p 30303:30303 --volumes-from=geth-data ethereum/client-go  --password /root/.ethereum/pw --unlock 0
Fatal: Failed to unlock account: 0

docker run --name geth -it -p 8545:8545 -p 30303:30303 --volumes-from=geth-data ethereum/client-go  --password /root/.ethereum/pw --unlock 0xb16711ee4a2b5b229729bd33d73c39c7527acb11

Fatal: Failed to unlock account: 0xb16711ee4a2b5b229729bd33d73c39c7527acb11

docker run --name geth -it -p 8545:8545 -p 30303:30303 --volumes-from=geth-data ethereum/client-go  --password <(echo -n 'test') --unlock 0
Fatal: Failed to read password file: open /dev/fd/63: no such file or directory

I tried:

With js, unlocking doesn't work too:

docker run --name geth -d -p 8545:8545 -p 30303:30303 --volumes-from=geth-data ethereum/client-go
docker exec -it geth geth attach
> personal.unlockAccount(web3.eth.accounts[0])
> Please enter your password..
> test
> false  :-(

But it is working when you send a transaction, it ask you to unlock, for some reason it accepts the password here...

web3.eth.sendTransaction({from: "0xb16711ee4a2b5b229729bd33d73c39c7527acb11", to: "0x4efc6fc02f27960584be19df02567950931f0e7a", value: 1000000000000, gas:21000, gasPrice:web3.toWei(60, 'gwei')})
> Please enter your password..
> test
> ... transaction_id ... nice :-) !   

I can't see another option to try, hopefully I am missing something obvious.
I need that option because I would like to automate the deployment of geth, while getting the password from a vault.

Thank you for your help!! And good week! :-)
Greg.

@gregbkr

This comment has been minimized.

Show comment
Hide comment
@gregbkr

gregbkr Jan 25, 2016

Hello, seems like my problem is due of the alteration of my wallet password, when I create a new account via :
docker exec -it geth geth account new

If you see in docker "Unsupported terminal, password will be echoed.", thing will probably not work.
Seems like the prompt is acting strange and geth will not accept the same password I just set seconds ago.

A workaround I found is to create the wallet from a non-docker geth, or be in the container while creating the password:
docker run --rm -it --entrypoint /bin/bash ethereum/client-go

Then unlocking the account work with a local file:
... geth --password /root/.ethereum/pw --unlock 0
But it still doesn't work (through docker) with an echo :
... geth --password <(echo -n 'mypass') --unlock 0

Thank you!
Greg.

gregbkr commented Jan 25, 2016

Hello, seems like my problem is due of the alteration of my wallet password, when I create a new account via :
docker exec -it geth geth account new

If you see in docker "Unsupported terminal, password will be echoed.", thing will probably not work.
Seems like the prompt is acting strange and geth will not accept the same password I just set seconds ago.

A workaround I found is to create the wallet from a non-docker geth, or be in the container while creating the password:
docker run --rm -it --entrypoint /bin/bash ethereum/client-go

Then unlocking the account work with a local file:
... geth --password /root/.ethereum/pw --unlock 0
But it still doesn't work (through docker) with an echo :
... geth --password <(echo -n 'mypass') --unlock 0

Thank you!
Greg.

@stale

This comment has been minimized.

Show comment
Hide comment
@stale

stale bot Mar 5, 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.

stale bot commented Mar 5, 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.

@stale stale bot added the stale label Mar 5, 2018

@stale stale bot closed this Apr 16, 2018

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