Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store and its lock file has been locked by another process: /var/lib/neo4j/data/databases/graph.db/store_lock

Tags:

neo4j

what I did

neo4j console

(work fine)

ctrl-C

upon restarting I have message above.

I delete /var/lib/neo4j/data/databases/graph.db/store_lock

then I have

Externally locked: /var/lib/neo4j/data/databases/graph.db/neostore

Is there any way of cleaning lock ? (short of reinstalling)

like image 206
Archemar Avatar asked Jun 26 '17 09:06

Archemar


3 Answers

Killing the Java process and deleting the store_lock worked for me:

Found the lingering process,

ps aux | grep "org.neo4j.server"

killed it,

kill -9 <pid-of-neo4js-java-process>

and deleted

sudo rm /var/lib/neo4j/data/databases/graph.db/store_lock

Allegedly, just killing the lingering process may do the trick but I went ahead and deleted the lock anyway.

like image 91
Hendrik F Avatar answered Nov 08 '22 17:11

Hendrik F


You can kill the java process and delete the store_lock file. It doesn't seem to harm the database integrity.

like image 30
anarche Avatar answered Nov 08 '22 18:11

anarche


I found this question having same error message trying to import CSV using neo4j-admin tool.

In my case the problem was that I first launched neo4j server:

docker run -d --name testneo4j -p7474:7474 -p7687:7687 -v /path/to/neo4j/data:/data -v /path/to/neo4j/logs:/logs -v /path/to/neo4j/import:/var/lib/neo4j/import -v /path/to/neo4j/plugins:/plugins --env NEO4J_AUTH=neo4j/test neo4j:latest

and then tried to launch import (CSV data files see here):

docker exec -it testneo4j neo4j-admin import --nodes=Movies=import/movies.csv --nodes=Actors=import/actors.csv --relationships=ACTED_IN=import/roles.csv

This leads to lock error since server acquires database lock and neo4j-admin is independent tool which needs to acquire database lock too. Kills, lock file removals and sudos didn't work for me.

What helped:

  1. docker run --rm ... neo4j:latest neo4j-admin ... - this performs one-shot import into empty database. No dead container remains, only imported data in external volume. (Note the command fails if db is not empty.) The point is, the Docker entrypoint starts server unless CMD in Dockerfile is overriden.
  2. docker run -d ... neo4j:latest - this runs neo4j server
like image 2
Tomáš Záluský Avatar answered Nov 08 '22 16:11

Tomáš Záluský