Setting apoc.import.file.enabled=true in your neo4j.conf

I am all new to neo4j and have just downloaded the desktop version running on my Mac. When trying to load a json file with CALL apoc.load.json I get the error message:

Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure apoc.load.json: Caused by: java.lang.RuntimeException: Import from files not enabled, please set apoc.import.file.enabled=true in your neo4j.conf

But I cannot find any file named neo4j.conf on my Mac (or even any file/directory named neo4j or similar...) and I haven't found any documentation on how to actually find it and edit it so I hope that someone can help me with this...?

2 Likes

how is neo4j server running in your system ???
basically in Windows , we have to start server from application and in this application we are having a options button .
when you will click on it will get the neo4j config file option and you can start working on it.

for me it is in below location

AppData\Roaming\Neo4j Community Edition\neo4j.conf

Hi,

Launch Neo4j Desktop, click on'Manage' button. Click on the down arrow next to 'Open Folder'.

neoconf

From the drop down list select 'Configuration' and that will open the folder where neo4j.conf is located.

Copy and save the neo4j.conf file (before editing) as backup. Open with Notepad and uncomment this line (remove '#')

#dbms.security.procedures.unrestricted=apoc.,algo.

and save.

Restart Neo4j Desktop and try.

-Kamal

actually settings==neo4j.conf are directly manageable in neo4j desktop

3 Likes

Perfect thanks, you saved my day!

if i want to load a json file from a local folder, do I drop it in the "import" folder? I am trying

CALL apoc.load.json('financials.json')

and I get the error Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedureapoc.load.json: Caused by: java.lang.RuntimeException: Can't read url or key invalid URL (financials.json) as json: no protocol: financials.json

This is the first time I have tried loading JSON and am just playing around.

1 Like

I had the same problem (don’t understand why…) so I had to use the fully qualified name (starting from the Home directory) as in:

apoc.load.json("file:/users/myuser/desktop/python/wos/graph.json”)

Hope it works for you as well.

For new questions please start a new topic @mckenzma

@michael.hunger I posted it here only because I thought it might be somewhat relevant. I will address future questions in separate posts.

How will I able to this in GrapheneDB instance ?

I just created a new Neo4j enterprise on GCP and I have a JSON file in /var/lib/neo4j/import folder. when I am trying to read a file using this code ( call apoc.load.json(" file://comments.json ") yield value return value limit 5 ), i get the below error

Failed to invoke procedure apoc.load.json: Caused by: java.lang.RuntimeException: Import from files not enabled, please set apoc.import.file.enabled=true in your apoc.conf

I could see apoc.import.file.enabled=true in neo4j.conf file but i am unable to find apoc.conf anywhere in server. The cluster where I am looking or running queries is the LEADER node. I didnt get this issue last time but today I just deleted the old cluster and re-created a new node from scratch and started facing this issue. Can someone please tell me what is that I am missing here.

1 Like

What version of neo4j are you running? for 4.+ it's apoc.conf (you need to create it) and 3.5.x it's neo4j.conf

you also need three slashes file:///

2 Likes

I am using neo4j 4.1. Should apoc.conf file be placed in the same folder as neo4j.conf file?

1 Like

This is still unanswered, correct ? Should we put it IN the neo4j file or in its own apoc.conf in the same directory

Thanks

1 Like

Still not working, and I am mildly confused.

I went ahead and added those 3 statements to neo4j.con - same error
I created an apoc.conf with those. Same error.

Now I am lost. Any more thoughts ?

1 Like

After launching the Desktop you will see the database you created. At left top corner you will see three circles. Clicking on it displays the a list and select Manage. When it opens up you will Plugins. When clicked it shows the APOC and GDS library. Click on install one at a time and this will instal the libraries and updates the neo4j.conf file.

Once done click on Start button and it should start if everything goes well.

No luck

Uninstalled APOC and GDS
Reinstalled both
apoc.conf was not created and my import failed
but I got a new neo4j.conf so i added these lines
#********************************************************************

Other Neo4j system properties

#********************************************************************
apoc.trigger.enabled=true
apoc.ttl.enabled=true
apoc.file.import.enabled=true

Still no luck

added apoc.conf to the same directory

No luck

1 Like

Hello :slight_smile:

Did you have a look at the documentation?
Options that can be added to the apoc.conf file.

Regards,
Cobra

Yes, I read it. But there were 3 issues.

  1. No apoc.conf file existed
  2. The error message says "Failed to invoke procedure apoc.load.json: Caused by: java.lang.RuntimeException: Import from files not enabled, please set apoc.import.file.enabled=true in your apoc.conf" So I created one with that line in it ( see above) based MichaelHungers post (jan 19th)
  3. But I also saw the note above that which mentioned it needed to be in 2 places ( so I did that)

So at this point, I have a self created apoc.conf and a modified neo4j.conf and neither is solving the issue.

2 Likes

The apoc.conf file must be created manually (next to neo4j.conf file) because it's not necessary for other procedures.

In this file, you must write:

  • apoc.import.file.enabled=true
  • apoc.import.file.use_neo4j_config=true

After, you must restart your database in order to apply changes :slight_smile:

2 Likes