Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geth attach does not work. #1908

jtremback opened this issue Oct 16, 2015 · 24 comments

geth attach does not work. #1908

jtremback opened this issue Oct 16, 2015 · 24 comments


Copy link

@jtremback jtremback commented Oct 16, 2015

Fails with this error:

$ geth attach
Fatal: Unable to attach to geth node - dial unix /Users/jehan/Library/Ethereum/geth.ipc: connect: connection refused
Copy link

@obscuren obscuren commented Oct 16, 2015

Just to be sure; you have a node running, correct?

Copy link

@jtremback jtremback commented Oct 16, 2015

Yes, started geth with geth console

Copy link

@paulmorriss paulmorriss commented Oct 17, 2015

Is the node using the default data directory? I got this error when I was
running one with a non default data directory and I forgot to specify it on
the geth attach command line too.

On Friday, October 16, 2015, Jehan wrote:

Yes, started geth with geth console

Reply to this email directly or view it on GitHub
#1908 (comment)

Paul Morriss

Copy link

@obscuren obscuren commented Oct 19, 2015

@jtremback if you supplied a --datadir /tmp/something make sure that you attach using geth attach ipc://tmp/something

Copy link

@karalabe karalabe commented Nov 23, 2015

I figure this is solved. We should probably clean up the CLI args further, but that's on our long term todo list already.

@karalabe karalabe closed this Nov 23, 2015
Copy link

@hitchcott hitchcott commented Feb 7, 2016

In case anyone had a similar issue, I was starting with --datadir /tmp/something and had to use geth attach ipc://tmp/something/geth.ipc (including geth.ipc)

Copy link

@realAkhmed realAkhmed commented May 24, 2016

Had a similar issue when starting in developer mode with geth --dev console. This is what worked:

$ geth attach ipc://tmp/ethereum_dev_mode/geth.ipc
Copy link

@ogurcan ogurcan commented Feb 12, 2017

I have a similar problem. I initialize my private local network as:

geth --identity="Node01" --datadir="./Node01" -verbosity 6 --ipcdisable --port 30301 --rpcport 8101 --networkid="12345" init ./CustomGenesis.json 2>> ./Node01.log

And then running the console as:

geth --identity="Node01" --datadir="./Node01" -verbosity 6 --ipcdisable --port 30301 --rpcport 8101 --networkid="12345" console 2>> ./Node01.log

Normally the console here work fine, but when I open another terminal window and try to attach, I am having this error message:

onders-macbook-pro:local_private_network ogurcan$ geth attach
Fatal: Unable to attach to remote geth: dial unix /Users/ogurcan/Library/Ethereum/geth.ipc: connect: no such file or directory

I also realized that geth is not creating a geth.ipc under the custom data directory I am giving, i.e. /Users/ogurcan/ethereum_test_networks/local_private_network/Node01/. As a result, I am unable to say geth attach ipc//something, like you guys above did.

Any ideas?

Copy link

@jmahhh jmahhh commented Mar 14, 2017

geth attach

Copy link

@fjl fjl commented Mar 14, 2017

@ogurcan You are using the --ipcdisable option, which disables creation of geth.ipc.

Copy link

@fanxiong fanxiong commented Mar 17, 2017

didn't need use --datadir, just geth attach ipc://somePath/geth.ipc

Copy link

@ronaldpetty ronaldpetty commented Sep 24, 2017

Just curious why this is closed? While ipc://.. worked, it is not in the help menu and so far (as of latest release today), this issue is the only place I have found evidence of how to do this (I might have missed something).

Why doesn't datadir have it default to geth.ipc like other subcommands? Is there a tracker for these type issues, I be happy to jump in.

Copy link

@denispeplin denispeplin commented Oct 18, 2017

I started geth with --testnet option:

geth --testnet --cache 2048 --rpc

To attach I used following command (on Linux):

geth attach ipc:/home/den/.ethereum/testnet/geth.ipc
Copy link

@ekotysh ekotysh commented Nov 5, 2017

On MacOS (for testnet):

geth attach ipc:/Users/ed/Library/Ethereum/testnet/geth.ipc

Copy link

@AntoniosHadji AntoniosHadji commented Nov 23, 2017

I'm running geth under a system user and the ipc socket only has permissions 600, owner can rw. I get the following error when try geth attach
Fatal: Unable to attach to remote geth: dial unix /home/antonios/.ethereum/geth.ipc: connect: permission denied
I can connect fine if using sudo geth attach

Is it possible to change permissions on ipc socket to 660?

Copy link

@lmars lmars commented Nov 23, 2017


Is it possible to change permissions on ipc socket to 660?

Run sudo chmod 660 /home/antonios/.ethereum/geth.ipc.

Copy link

@AntoniosHadji AntoniosHadji commented Nov 24, 2017

Copy link

@base-p base-p commented Dec 19, 2017

you can use crontab -e. then add this to to set permission.
* * * * * chmod 660 /path/to/geth.ipc

Copy link

@dmaksimovic dmaksimovic commented Jan 20, 2018

It's important to specify the ABSOLUTE path in the ipc:/ address. For example:

geth --datadir ~/eth-priv attach ipc:/home/myuser/eth-priv/geth.ipc

Copy link

@mallapurbharat mallapurbharat commented Jan 22, 2018

One way to find out the exact path to the IPC endpoint is to stop the geth node instance by pressing CTRL+C.

At the end of the console output, you should see something like
INFO [01-23|02:45:01] IPC endpoint closed: /home/path/to/myfolder/geth.ipc

Just copy-paste this path prepended with ipc:// to get the path to the ipc file. Just make sure that there are only two backslashes (/) in the ipc://home path beginning.
so you'd basically be doing

geth attach ipc://home/path/to/myfolder/geth.ipc


Copy link

@pellet pellet commented Feb 10, 2018

I had issues with this due to using a symbolic link on macOS, I had to specify the real location of the ipc file.
geth attach ipc:/Volumes/storage/Ethereum/testnet/geth.ipc

Copy link

@jbarros35 jbarros35 commented Apr 6, 2018

geth attach

that one works for me ok

Copy link

@ShanghaiTimes ShanghaiTimes commented Jun 18, 2018

found a solution.
geth --unlock 0x2Dc6f1E4c8D2fDD46A6b6b11b2037F577bB1f4Cd --datadir=/Users/robert/Library/Ethereum —mine

Then in another Terminal run
zeus:~ robert$ geth attach
Welcome to the Geth JavaScript console!

instance: Geth/v1.8.11-stable/darwin-amd64/go1.10.3
coinbase: 0xc9b74488b8e699b54803464a33d57cfff7eb052c
at block: 0 (Thu, 01 Jan 1970 01:00:00 BST)
datadir: /Users/robert/Library/Ethereum
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

Copy link

@jayantrane jayantrane commented Jan 20, 2019

For windows following worked for me!!

After opening geth instance, something like following will be on console
IPC endpoint opened. . . . . . url=\\\\.\\pipe\\geth.ipc

For attach, copy above url, replace '\\' with '/' and type following on other console
geth attach "//./pipe/geth.ipc"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.