I noticed that geth
stopped running on my system, so I tried restarting it but got the following error:
Fatal: Error starting protocol stack: datadir already used by another process
I checked whether there is another active instance of geth
by running ps aux
but found nothing. So I'm not sure how the directory can possibly be used by another process. Any ideas for debugging this situation?
Best Answer
If you're sure that geth is not already running, check for the presence of a
LOCK
file in the geth subdirectory of your data directory. Under Ubuntu this will be~/.ethereum/geth
.I have experienced a rogue
LOCK
that caused this issue - I'm not sure why, possibly the normal shutdown of the previous geth session was distured.Remove the Lockfile Debian/Ubuntu
Remove (or rename)
~/.ethereum/geth/LOCK
and restart geth.Now try to start geth.