cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Import csv with neo4j-admin on a docker

Hi, I am trying to import a csv file with neo4j-admin on a docker
First I run the docker:

docker run \
    --name testneo4j \
    -p7474:7474 -p7687:7687 \
    -d \
    -v $HOME/neo4j/data:/data \
    -v $HOME/neo4j/logs:/logs \
    -v $HOME/neo4j/import:/var/lib/neo4j/import \
    --env NEO4J_AUTH=neo4j/test \
    neo4j:4.1.1

inside the docker, I run the following:

neo4j-admin import --nodes=Location=node_location.csv

and got the following error:

Neo4j version: 4.1.1
Importing the contents of these files into /data/databases/neo4j:
Nodes:
  [Location]:
  /var/lib/neo4j/import/node_household.csv


Available resources:
  Total machine memory: 1.952GiB
  Free machine memory: 66.17MiB
  Max heap memory : 444.5MiB
  Processors: 4
  Configured max memory: 1.366GiB
  High-IO: false


IMPORT FAILED in 18477d 14h 34m 49s 585ms.
Data statistics is not available.
Peak memory usage: 0B
Import error: Unable to open store file: /data/databases/neo4j/neostore
Caused by:Unable to open store file: /data/databases/neo4j/neostore
org.neo4j.exceptions.UnderlyingStorageException: Unable to open store file: /data/databases/neo4j/neostore
	at org.neo4j.kernel.impl.store.CommonAbstractStore.checkAndLoadStorage(CommonAbstractStore.java:254)
	at org.neo4j.kernel.impl.store.CommonAbstractStore.initialise(CommonAbstractStore.java:151)

What did I miss?

4 REPLIES 4

anthapu
Graph Fellow

Welcome to the neo4J community.

Can you please check if the Neo4J instance has started? If so to be able to use neo4j-admin import you need to bring the neo4j instance down or stop the neo4j database.

neo4j-admin import over writes the existing database.

please elaborate: what do you mean "Neo4J instance has started".
If I run inside the docker

neo4j status

the result is

Neo4j is not running

Hi @shmkuf , I am now seeing the exact same error as yours. And the database is listed as not running. but interestingly I can connect to it and create nodes via the browser connection. I wonder how you solved this problem. Thanks!

IMPORT FAILED in 19317d 16h 41m 33s 709ms.

Data statistics is not available.

Peak memory usage: 0B

Import error: Unable to open store file: /data/databases/neo4j/neostore

Caused by:Unable to open store file: /data/databases/neo4j/neostore

org.neo4j.exceptions.UnderlyingStorageException: Unable to open store file: /data/databases/neo4j/neostore

at org.neo4j.kernel.impl.store.CommonAbstractStore.checkAndLoadStorage(CommonAbstractStore.java:253)

So I tried to check the status and stop the database but it all returned 'db not running'

~/neo4j-test05 $ docker exec -it --user $(id -u):$(id -g) neo4j-test05 neo4j stop

Neo4j not running

~/neo4j-test05 $ docker exec -it --user $(id -u):$(id -g) neo4j-test05 neo4j status

Neo4j is not running