Using json-rpc eth_unlockAccount() method I can unlock everyone of my node accounts except coinbase. When trying to unlock coinbase account, geth responds with the message:

no key for given address or file.

I've bee reading Ethereum Wallet: error of no key for given address or file but I am not using Ethereum Wallet, but just json-rpc calls to geth node. Nevertheless I have restarted geth node, as recommended in the answer, but still the same error.

How can I unlock coinbase account? Why the error:

no key for given address or file.

P.S.: Trying to unlock the coinbase account directly with command line, same result:

$ geth --testnet --unlock 0x47978a69f410d0f61850c92acdb0d4c464d70937

Fatal: Failed to unlock account 0x47978a69f410d0f61850c92acdb0d4c464d70937 (no key for given address or file)

  • 1
    Are you sure you actually own the key to your coinbase account? The coinbase defaults to your first address, but it can also be set manually to whatever you want. – Tjaden Hess Sep 16 '16 at 1:35
  • Yes. I have reset the password using command geth account update , but still same error. – Juan Ignacio Pérez Sacristán Sep 16 '16 at 8:10
  • My coinbase account is 47978a69f410d0f61850c92acdb0d4c464d70937 and there exist a file .ethereum/keystore/UTC--2016-08-12T16-23-07.956658700Z--47978a69f410d0f61850c92acdb0d4c464d70937 . The thing is there are 6 more accounts defined on geth, but they have not any associated file at folder .ethereum/keystore/ . Quite strange! Has it something to do with the problem I am reporting? The only account I cannot unlock has an associate file on .ethereum/keystore/ ... – Juan Ignacio Pérez Sacristán Sep 16 '16 at 8:43
  • 1
    Before you try to unlock via json-rpc, how about you unlock directly from the geth console? Does this work? – Xavier Leprêtre B9lab Sep 16 '16 at 11:27
  • 5
    Yes, it keeps a separate keystore for the testnet accounts. You can copy the keys in .ethereum/keystore to ethereum/testnet/keystore and you should be all set. – Tjaden Hess Sep 16 '16 at 13:02

We were getting the same error and it turned out that there were two conflicting keyfiles. One in the default (~/.ethereum) and one in a custom location that we had specified using --datadir.

In the end it was just a case of cleaning up the scripts we were using to deploy the geth node to make sure that we consistently only used one or the other keystore (we went with the default in our case)

Once we had done that, the problem was solved.

| improve this answer | |

in geth console issue

web3.personal.importRawKey("private key", "password")

After that I was able to unlock

| improve this answer | |

Or you could just specify location of --keystore ( https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options ).

| improve this answer | |

Check if Key is present in ".ethereum/testnet/keystore" for testnet and ".ethereum/keystore" for mainnet.

Key file name will have the public key included in it

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.