Go-ethereum: geth account import will not recognize keyfile as argument

Created on 29 Apr 2016  Â·  9Comments  Â·  Source: ethereum/go-ethereum

System information

Geth version: 1.5.0
OS & Version: Linux, Ubuntu 14.04.4 LTS Server x64

Expected behaviour

Import account successfully from keyfile using geth account import <keyfile>

Actual behaviour

Geth states:

Fatal: Keyfile must be given as argument

Even though I have defined the keyfile, I also tried using the entire path to the keyfile /home/username/key.txt for example. I have checked permissions and it is owned by the user and I even gave it 777 permission just to ensure there is no possible permissions issue.

Steps to reproduce the behaviour

  1. Take keyfile from other virtual machine running geth in /home/username/.ethereum/keystore
  2. Put it in my second virtual machines users home directory, and renamed it to key.txt
  3. geth account import /home/username/key.txt
  4. Get message: Fatal: Keyfile must be given as argument

Most helpful comment

This issue is also happening for me...I have a private key in file named keyfile.prv:

geth --datadir /Users/me/path/to/datadir account import ./keyfile.prv 
Fatal: keyfile must be given as argument

I am using geth 1.4.10 (downloaded last night), but I have also tested with geth 1.4.6 and the same issue happens.

All 9 comments

If your key file was not modified you can simply copy it over to the keystore folder of the other system, you do not need to import it using the import sub-command.

However I agree, that error message is incorrect.

I'll keep this issue open so we can reference it when we've changed the error message.

The new error message is merged, the issue can now be closed :)

This issue is also happening for me...I have a private key in file named keyfile.prv:

geth --datadir /Users/me/path/to/datadir account import ./keyfile.prv 
Fatal: keyfile must be given as argument

I am using geth 1.4.10 (downloaded last night), but I have also tested with geth 1.4.6 and the same issue happens.

I had the same problem..

But I remove the leading "0x" from my private key, and then it works.

Both in geth console using "personal.importRawKey" and in command line "geth account import" work when I remove the leading "0x" ...

FYI..

_leaving comment here as this is the top result in google_

Just had the same issue for the first time in a long time while testing 31 and 30 byte keys.

  1. File must be .txt aka plain text
  2. File must not have any extra characters, spaces, or lines.
  3. Key must be 32 bytes (64 characters).

If you're a person having this issue, you may want to verify that you are at 64 characters. If you are at 62 or 60, add 0 to the beginning to increase it to the required 64. Attached is example key. If you are unfamiliar working with text files outside of Microsoft Word, you may want to download this and replace the key with your key to ensure it's in the proper format. Open in notepad or TextEdit.

000081c29e8142bb6a81bef5a92bda7a8328a5c85bb2f9542e76f9b0f94fc018.txt


Version: 1.4.18-stable-c72f5459
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.7.3
OS: darwin

Fix released in 1.5.0.

i am getting fatal error saying unexpected eof .I have created keystore.txt file above block chain directory and tried importing it with geth account import ../keystore.txt.I ma getting above error

Me too.
I have tried padding with leading 0's as previously suggested.
I'm trying to use my Exodus wallet to receive eth.

Hey nithin
Please store your key file in blockchain/geth folder .Also edit the
keystore json file in vim edit .Let me know if this doesn't work out .Will
help you remotely .
Thanks
Regards
Kiran
9920146576

On Sat, Sep 2, 2017 at 8:25 AM, carrolltondatago notifications@github.com
wrote:

Me too.
I have tried padding with leading 0's as previously suggested.
I'm trying to use my Exodus wallet to receive eth.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ethereum/go-ethereum/issues/2503#issuecomment-326717692,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AM8DrpUz6LuT6dRYnrCknCupEVxoys8vks5seMOsgaJpZM4IShb2
.

--
Danavath kiran
Engineering physics
Indian Institute of Technology
Bombay

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bgrieder picture bgrieder  Â·  3Comments

phpsamsb picture phpsamsb  Â·  3Comments

AdrianScott picture AdrianScott  Â·  3Comments

carver picture carver  Â·  3Comments

VenusHu picture VenusHu  Â·  3Comments