cancel
Showing results for 
Search instead for 
Did you mean: 

Import in docker on ubuntu not working - Couldn't load the external resource at

Hello, I am having a struggle trying to import a csv file. I'm running neo4j in a docker on ubuntu 20.04.1 and use this command:

sudo docker run
--name testneo4j
-p7474:7474 -p7687:7687
-v $HOME/neo4j/data:/data
-v $HOME/neo4j/conf:/conf
-v $HOME/neo4j/logs:/logs
-v $HOME/neo4j/import:/var/lib/neo4j/import
-v $HOME/neo4j/plugins:/plugins
--env NEO4J_AUTH=neo4j/test
--env NEO4J_dbms_security_allow__csv__import__from__file__urls=true
--env NEO4J_dbms_directories_import="/import"
neo4j:latest

file sample.csv is under $HOME/neo4j/import (permissions are set ok), then in the browser i do:

LOAD CSV FROM "file:///sample.csv" AS row RETURN row;

and then i get:

Couldn't load the external resource at: file:/import/sample.csv

i went through some threads (found very similar issues but to no avail), articles as well as tried possible solutions and still stuck. Not sure how to trouble shoot it and see nothing of interest in the log file. Any help would be appreciated.

Thanks

1 ACCEPTED SOLUTION

dana_canzano
Neo4j
Neo4j

if you change

--env NEO4J_dbms_directories_import="/import"

to

--env NEO4J_dbms_directories_import=import

as this is the default (i.e note no leading / and also not enclosed in double quotes ) does this address your issue

View solution in original post

3 REPLIES 3

dana_canzano
Neo4j
Neo4j

if you change

--env NEO4J_dbms_directories_import="/import"

to

--env NEO4J_dbms_directories_import=import

as this is the default (i.e note no leading / and also not enclosed in double quotes ) does this address your issue

thanks for pointing that out! it works fine now. Thanks a lot!

naima
Node

what permissions we should set to the file..the import is not working for me..i am using docker to run neo4j..this is my query..

LOAD CSV WITH HEADERS FROM 'file:///final_output.csv' AS row WITH row WHERE row.entity1 IS NOT NULL 
MERGE (n:Source {Name: row.entity1}) 
MERGE (m:Destination {Name: row.entity2})
MERGE (n) -[:to {dist:row.action}]-> (m)
This is my docker command:

docker run \     --name nluneo4j \     -p 7474:7474 -p 7687:7687 \     -d \     -v /root/neo4j1/data:/data \     -v /root/neo4j1/logs:/logs \     -v /root/neo4j1/import:/root/neo4j/import \     -v /root/neo4j1/plugins:/plugins \ --env NEO4J_AUTH=neo4j/test \ --env NEO4J_dbms_security_allow__csv__import__from__file__urls=true \ 

--env NEO4J_dbms_directories_import=import \ neo4j:latest