Failed to invoke procedure `apoc.load.json`: Caused by: java.io.IOException: Cannot open file

There was a similar question to this that was never fully answered. I am also getting this error and am unsure why.

My code:

CALL apoc.load.json("file:///AllItems.json") YIELD value as v where v.DOI IS NOT NULL and v.fulltext IS NOT NULL
RETURN count(*)

I have also tried:

CALL apoc.load.json("file:///AllItems.json"__) - which returns the same error.

I have managed to load the same file with the same user on the same computer before. I'm now rebuilding my graph from scratch - the only difference is that I just upgraded to Neo4j version 4.4.8 from 4.4.5. I know some people will say to go back to version 4.4.5 but I'm wondering if there is something I'm missing.

I have added: "apoc.import.file.enabled=true" to my DBMS settings

And have added AllItems.json in my files folder for the project. I've attached a screenshot of the structure of the json file.

Any ideas?

Hi @steggy I just commented it out and still get:

Failed to invoke procedure `apoc.load.json`: Caused by: java.io.IOException: Cannot open file /Users/dn/Library/Application Support/Neo4j Desktop/Application/relate-data/dbmss/dbms-05855b10-ade8-452f-9a10-5bbb58f77459/AllItems.json for reading.

I'm going to go back to 4.4.5 and see if it works - my old graph (on 4.4.5) still works with loading in the json even with the "dbms.directories.import" not commented out - my settings file allows that as well as "apoc.import.file.enabled=true"

Just so I understand - where would I find my "import" directory for this DB?

Hi @stephflint - is the file in the correct directory? By default, it would need to be in the "import" directory of your database, or you can comment out the "dbms.directories.import" setting to allow reading files from anywhere.

Click on the three dots next to your database in your project, then navigate to the import folder.

@glilienfield hi, thanks for your answer. I tried that and it caused an interesting situation... when I clicked the import folder it says "Trying to open undefined directory". Is there a way to link to the import folder - how might I find it on my system? At this stage, I'm thinking of upgrading to the latest version - but would be good to know incase it happens again