TransWikia.com

geth: Failed to unlock account

Ethereum Asked on January 16, 2021

I exported the private key from Metamask and wants to import it into geth. geth is running on Windows 10.

geth is started using

geth –rinkeby –rpc –rpcapi=”personal,eth,network,net,web3″ –rpcport 8545 –rpcaddr 127.0.0.1 –unlock “0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6” console

this prompts me to enter the password

Unlocking account 0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6 | Attempt 1/3
Passphrase:
Fatal: Failed to unlock account 0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6 (no key for given address or file)

Why is it failing to unlock the account even though the password I entered into geth is the same password that was used to export the private key from Metamask?

2 Answers

What you can do is to create a new text file in the directory where the chain is stored and save the password in a text file called password.txt.

Example if password = '1234' and stored in a directory called 'chain'

echo '1234' > chain/password.txt

then run your code with the additional --password method

geth --rinkeby --rpc --rpcapi="personal,eth,network,net,web3" --rpcport 8545 --rpcaddr 127.0.0.1 --unlock "0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6" --password chain/password.txt console

Answered by Yanzal on January 16, 2021

I was having the same problem. strangely i seem to have gotten past it by first entering a blank password and then entering the real password on attempt 2/3. That worked for some reason...

Answered by okwme on January 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP