1

I tried using the following command

geth --testnet account import <path_to_key_file>

I am getting the following error:

Fatal: Failed to load the private key: unexpected EOF

Note that my key is the actual key I used while creating the account. Am I doing something wrong? If yes, how to do it correctly.

  • 1
    Is your keyfile encrypted, or is it an unencrypted JSON file? (Where is it from?) – Richard Horrocks Mar 3 '17 at 8:21
  • keyfile is not encrypted. I opened a notepad, typed my private key and saved it. Note that this is the private key I use in transactions. – serial007 Mar 3 '17 at 8:24
  • 1
    this problem occures maybe you are loading a file from linux to windows isn't it? – Badr Bellaj Mar 3 '17 at 10:43
  • Related: ethereum.stackexchange.com/questions/465/… – jeff Mar 3 '17 at 21:43
1

Fatal: Failed to load the private key: unexpected EOF

If you are getting that error from my experience it could be a couple of things:

Operating system end of line conflict:

Like Badr suggested, this problem sounds like it could be an operating system conflict. Sometimes if a file was created in Linux and opened in Windows, Windows can freak out that it isn't structured in the Windows format.

If this is the case, open your favourite text editor in the operating system you are using to import the key and copy the key from the original file into the text editor, then save. This will ensure your key file is saved in a format your OS won't panic about.

Error in private key:

I notice you say:

I opened a notepad, typed my private key and saved it.

Are you certain you've correctly typed your private key? Have you used this same key for other things since? There aren't any unexpected characters in the string?

  • file created in ubuntu and used in uduntu. Checked the private key, it is correct. – serial007 Mar 6 '17 at 8:00

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.