[Ethereum] Not able to unlock account using GETH on testnet

go-ethereum

I am using GETH console to unlock the account but i have been consistently getting error "Error: no key for given address or file". I looked into "C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore" and see two files present. could you please guide me if i am doing anything wrong. below is result

of command I executed.


-------------------------------------------------------------------
**List of account on testnet using Geth**

C:\Data\geth-alltools>geth --testnet account list
INFO [07-27|14:05:40.873] Maximum peer count                       ETH=25 LES=0 total=25
Account #0: {407c9c2b699f2380561c2bb13a400e1ea9149930} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC--2018-07-27T16-37-59.248164300Z--407c9c2b699f2380561c2bb13a400e1ea9149930
Account #1: {2b45bdd81e75be0502469ac81b1089d39cf5c051} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC--2018-07-27T17-09-09.768503000Z--2b45bdd81e75be0502469ac81b1089d39cf5c051

-------------------------------------------------------------------
**Trying to Unlock the account**



C:\Data\geth-alltools>geth --testnet attach http://localhost:8545
Welcome to the Geth JavaScript console!

instance: Geth/node1/v1.8.12-stable-37685930/windows-amd64/go1.10.3
modules: admin:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0

personal.unlockAccount("2b45bdd81e75be0502469ac81b1089d39cf5c051")
Unlock account 2b45bdd81e75be0502469ac81b1089d39cf5c051
Passphrase:
Error: no key for given address or file

Update:

Created a new account by using GETH in testnet and searched for the key but still getting the same issue

C:\Data\geth-alltools>geth –testnet account new
INFO [07-27|15:31:13.992] Maximum peer count ETH=25 LES=0 total=25
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase:
Repeat passphrase:
Address: {04db25008887fb28e0b8562b9c27f7d6ba0c751f}

file got created in C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore

C:\Data\geth-alltools>Geth –testnet account list
INFO [07-27|15:33:20.217] Maximum peer count ETH=25 LES=0 total=25
Account #0: {407c9c2b699f2380561c2bb13a400e1ea9149930} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC–2018-07-27T16-37-59.248164300Z–407c9c2b699f2380561c2bb13a400e1ea9149930
Account #1: {2b45bdd81e75be0502469ac81b1089d39cf5c051} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC–2018-07-27T17-09-09.768503000Z–2b45bdd81e75be0502469ac81b1089d39cf5c051
Account #2: {04db25008887fb28e0b8562b9c27f7d6ba0c751f} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC–2018-07-27T19-31-23.029658500Z–04db25008887fb28e0b8562b9c27f7d6ba0c751f

Following Command was run on geth console

personal.unlockAccount("04db25008887fb28e0b8562b9c27f7d6ba0c751f", "Password",300)
Error: no key for given address or file

Best Answer

you don't define the account's password : it should be somthing like this :

personal.unlockAccount("2b45bdd81e75be0502469ac81b1089d39cf5c051", "mypassword")

check unlockAccount definition :

personal.unlockAccount(address, passphrase, duration)