1

I'm using Neo4j v 4.0.3 on Azure. Python code is used to load the database. Standard cypher create queries work as expected:

Create (n:xxx{name:'xxx'})

However, this does not work:

LOAD CSV With HEADERS FROM 'https://neo4jclusterdiag.blob.core.windows.net/neo4j-import/jTags.csv?{SAS}' AS line FIELDTERMINATOR '|' MERGE (p:AncestryTag{TagId: toInteger(line.TagId),color:toString(line.Color),Label:toString(line.Label)})

The CSV is simple:

TagId|Color|Label
1000|#6ba410|Brydie Scotland
1001|#FFE300|Scroggie
1002|#e3720f|Brodie Scotland
1003|#f06158|Robertson Scotland
1004|#cb478a|Goolsby
1005|#655586|Watt Aberdeenshire
1006|#0079a3|Milne Scotland
1007|#489b9b|Hay Aberdeenshire
1008|#FFB800|Anderson
1009|#a94500|Thomas
1010|#871a13|Bain, McBain

I have a separate local install on Neo4j v 4.0.3 and the LOAD CSV works fine there. So it's something amiss with the Azure database.

I've made the following changes in the config file:

#dbms.directories.import=/var/lib/neo4j/import
dbms.security.allow_csv_import_from_file_urls=true

I try running the LOAD CSV from python code or within the Neo4j browser. Same error with both:

neobolt.exceptions.ClientError: Couldn't load the external resource at: https://neo4jclusterdiag.blob.core.windows.net/neo4j-import/jTags.csv?{SAS}

In the browser I also see:

Neo.ClientError.Statement.ExternalResourceFailed

I can place this in my browser address window and retrieve the file:

https://neo4jclusterdiag.blob.core.windows.net/neo4j-import/jTags.csv?{SAS}

Thus, there is something specifically wrong with my Azure database not recornizing the file I'm trying to import using load csv.

David A Stumpf
  • 753
  • 5
  • 13
  • BTW, I should mention that this code worked with an Azure Neo4j 3.x database. I'm upgrading to 4.x to leverage its multiple database capabilities. – David A Stumpf May 10 '20 at 16:03
  • I don't understand the relevance of mentioning it's your "Azure database." Installing Neo4j on Azure (presumably in a set of VMs?) isn't any different from installing to local VMs/machines, aside from how you manage your inbound/outbound networking ports. That said: You mentioned this all worked in v3.x but not v4.x. Seems like that might be more relevant... – David Makogon May 10 '20 at 16:35
  • I have installs of 4.x locally and on Azure (a VM). The former executes the load csv successfully, the Azure install does not. It's not a 3.x vs 4.x issue, but Azure vs local – David A Stumpf May 10 '20 at 17:08
  • There is one difference between the local and Azure Neo4j v 4.x. The local install is the community edition and on Azure it is Enterprise. The latter has 2 dbs at present; perhaps that is the issue? – David A Stumpf May 10 '20 at 17:40
  • A complete guess but maybe the curly braces in the URL are throwing off Neo4j's parsing of the LOAD CSV command. Try changing `{SAS}` to `%7BSAS%7D` and see if that works – hoyski May 11 '20 at 12:20
  • {SAS} was a placeholder for the SAS security string necessary to access the file at Azure. With it appended, I can access the file remotely from my laptop. So that is not the problem. – David A Stumpf May 11 '20 at 12:40

0 Answers0