Load CSV Fails in Cypher + Neo4j “LoadExternalResourceException: Couldn't load the external resource at:”

前端 未结 2 772
梦谈多话
梦谈多话 2021-01-15 05:08

I have a fresh install of Neo4j 2.1.4 open source on a corporate cloud server running Ubuntu 14.04. I am importing a CSV file into the database. The path to my file is \'/ho

相关标签:
2条回答
  • 2021-01-15 05:41

    A co-worker helped me debug this.

    The problem was a permission. In Linux, neo4j has its own user 'neo4j'. That user did not have permissions to access the data at /home/myuser/data-neo4j/node.csv

    We moved the data to a folder where the neo4j user has permissions and adjusted the path in the query.

    For future reference, the log for Neo4j can provide additional info, an in Linux, is found at /var/log/neo4j

    0 讨论(0)
  • 2021-01-15 05:46

    sheldonkreger, your co-worker is right. Thanks to him.

    I solved it doing the same, but you actually don't need to place the file in a location where neo4j user has permissions, as suggested by him, for example /var/log/neo4j or /var/lib/neo4j.

    Instead, just go to the neo4j directories mentioned above and see the file permissions over there, and provide the same permissions to your csv file or whichever file you are trying to import.

    For example, for my system the file permissions in neo4j folder was like this:

    ls -la
    total 208
    drwxr-xr-x  4 neo4j adm    4096 Feb  4 10:35 .
    drwxr-xr-x 87 root  root   4096 Feb 11 22:21 ..
    drwxr-xr-x  3 neo4j adm    4096 Feb  4 10:35 bin
    -rw-r--r--  1 neo4j adm   61164 Jan 29 22:32 CHANGES.txt
    lrwxrwxrwx  1 neo4j adm      10 Sep 30 12:07 conf -> /etc/neo4j
    drwxr-xr-x  4 neo4j adm    4096 Mar 13 13:25 data
    lrwxrwxrwx  1 neo4j adm      20 Sep 30 12:07 lib -> /usr/share/neo4j/lib
    -rw-r--r--  1 neo4j adm  125517 Jan 29 22:32 LICENSES.txt
    lrwxrwxrwx  1 neo4j adm      24 Sep 30 12:07 plugins -> /usr/share/neo4j/plugins
    -rw-r--r--  1 neo4j adm    1568 Jan 29 22:32 README.txt
    lrwxrwxrwx  1 neo4j adm      23 Sep 30 12:07 system -> /usr/share/neo4j/system
    -rw-r--r--  1 neo4j adm    4018 Jan 29 22:30 UPGRADE.txt
    

    So I did the same to my file and neo4j was successfully able to run the import command.

    I did this:

    sudo chown neo4j:adm <csv file location>
    
    0 讨论(0)
提交回复
热议问题