8

I'm downloading the chain and I've processed more than 2 million blocks so far. I'm trying to attach to the geth console to view the syncing status, but I've tried typing geth console in another terminal (on Mac) and I get an error:

Fatal: Error starting protocol stack: listen udp :30303: bind: address already in use 

If I've understood correctly I should type geth console and then eth.syncing.

2 Answers 2

8

The error is most likely because the geth is already running and when you are trying to start another geth process using the same 30303 default port. If you know the datadir of the geth process which is downloading the chain, find a geth.ipc file in that datadir and use geth attach ipc:<geth.ipc path> to connect to the existing process.

3
  • Apparently there is no ipc file in the datadir... It's full of Idb though. Commented Jun 2, 2017 at 7:56
  • ldb files should be present in the chaindata folder. Try doing cd ../.. and geth.ipc file should be present there. Commented Jun 2, 2017 at 8:03
  • this doesn't work for me: $ geth attach ipc:~/.ethereum/geth.ipc │······················································· Fatal: Unable to attach to remote geth: dial unix ~/.ethereum/geth.ipc: connect: no such fi│······················································· le or directory Commented Sep 3, 2021 at 0:49
0

If you are using linux then go to terminal and run the following commands:

 $ netstat -p || grep 30303 $ kill -9 `process id` 
1
  • 3
    I think you mean | (pipe) rather than || (or). Also, please don't use kill with -9. It equates to a SIGKILL, which means "kill the process immediately". If your Geth instance is currently writing to disk, you're asking for a corrupt database... Use a signal that can be caught by Geth's signal handlers (e.g. SIGINT using kill -INT <pid>). Commented May 26, 2018 at 12:26

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.