cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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

dw222ek
Node Link

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...?

1 ACCEPTED SOLUTION

Hi, I faced same issue and was able to resolve it by creating the "apoc.conf" file as suggested here. Just to elaborate on the steps:
Step:1
To traverse to the Dbms folder, click the three dots (...), go to "open folder" -> DBMS, the dbms folder will open, then navigate to "conf" folder inside it & you could find the "neo4j.conf" file. Now you need to create a new "apoc.conf" file.

Step2:
In the dbms folder -> open “conf” folder -> create a new “apoc.conf” file by opening a notepad, then type the following 2 lines and save files as “.conf” file under “all files” in the same “conf” folder.

apoc.import.file.enabled=true

apoc.import.file.use_neo4j_config=true

Step: 3
Restart the dbms

View solution in original post

30 REPLIES 30

12kunal34
Graph Fellow

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

ameyasoft
Graph Maven

Hi,

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

2X_7_7c72c29d3fd4725c3de8d9684f23b776ebb1b789.png

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

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.

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.

Did this get turned into a new topic? I couldn't find it in your topics and searching load. The suggested solution of adding file: in this thread doesn't work for me.

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.

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:///

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

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

Thanks

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 ?

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

Hello

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.

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

this does not work. I got this as error
There is no procedure with the name apoc.export.csv.data registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.

I guess you didn't install apoc correctly? Does the rest of APOC work for you?
.e.g call apoc.help("")

Hi, I faced same issue and was able to resolve it by creating the "apoc.conf" file as suggested here. Just to elaborate on the steps:
Step:1
To traverse to the Dbms folder, click the three dots (...), go to "open folder" -> DBMS, the dbms folder will open, then navigate to "conf" folder inside it & you could find the "neo4j.conf" file. Now you need to create a new "apoc.conf" file.

Step2:
In the dbms folder -> open “conf” folder -> create a new “apoc.conf” file by opening a notepad, then type the following 2 lines and save files as “.conf” file under “all files” in the same “conf” folder.

apoc.import.file.enabled=true

apoc.import.file.use_neo4j_config=true

Step: 3
Restart the dbms

oh man thank you so much for this!

I thought I was going crazy!

shern2
Node Link

Hi! I would like to clarify if the following is a bug for Neo4j 4++ (4.2.1 Desktop):

After creating apoc.conf file with apoc.export.file.enabled=true line. I restarted Neo4j DB, and was able to call a simple export function
call apoc.export.csv.query('MATCH (n) RETURN (n) LIMIT 10', 'hello.csv',{})

I would like to programmatically check if this setting is enabled in my code before I make the export call. However, when I do call dbms.listConfig(), it shows that it is still set to "false".
The same happens for apoc.import.file.enabled=true.

I will do a workaround to parse the apoc.conf file for now. But my guess is this is a bug that is a result of Neo4j 3.5+ config..

Hey Shern ! 

I have the same issue/confusion you have 

I would like to programmatically check if this setting is enabled in my code before I make the export call. However, when I do call dbms.listConfig(), it shows that it is still set to "false".
The same happens for apoc.import.file.enabled=true.

I will do a workaround to parse the apoc.conf file for now. But my guess is this is a bug that is a result of Neo4j 3.5+ config..


I can confirm that my apoc plugin is well installed (I can see the apoc procedures when I do the following query:  CALL dbms.procedures() YIELD name, signature RETURN name, signature;)

I am using the helm chart, so my apoc configs looks like this

apoc_config:
apoc.trigger.enabled: "false"
apoc.ttl.enabled: "false"
apoc.export.file.enabled: "false"
apoc.import.file.enabled: "false"
apoc.import.file.allow_read_from_filesystem: "true"
apoc.uuid.enabled: "true"
apoc.import.file.use_neo4j_config: "true"
apoc.jobs.scheduled.num_threads: "10"
apoc.jobs.pool.num_threads: "10"

 

I can see that it appears in the container under /config/apoc.conf (there is also a /config/neo4j.conf in there which is a symlink to /var/lib/neo4j/conf/neo4j.conf.

Now I am not sure if the neo4j binary tries to load the config from /config/ or /var/lib/neo4j/conf location.

Apoc.conf doesn't exist in /var/lib/neo4j/conf and doing "CALL dbms.listConfig();" doesn't show up my customs settings. 

 

call dbms.listConfig("apoc");
+---------------------------------------------------------------------------------------------------------------------------+
| name | description | value | dynamic |
+---------------------------------------------------------------------------------------------------------------------------+
| "apoc.export.file.enabled" | "apoc.export.file.enabled, a boolean" | "false" | FALSE |
| "apoc.import.file.enabled" | "apoc.import.file.enabled, a boolean" | "false" | FALSE |
| "apoc.import.file.use_neo4j_config" | "apoc.import.file.use_neo4j_config, a boolean" | "true" | FALSE |
| "apoc.initializer.cypher" | "apoc.initializer.cypher, a string" | "No Value" | FALSE |
| "apoc.jobs.pool.num_threads" | "apoc.jobs.pool.num_threads, a long" | "No Value" | FALSE |
| "apoc.jobs.queue.size" | "apoc.jobs.queue.size, a long" | "No Value" | FALSE |
| "apoc.jobs.scheduled.num_threads" | "apoc.jobs.scheduled.num_threads, a long" | "No Value" | FALSE |
| "apoc.trigger.enabled" | "apoc.trigger.enabled, a boolean" | "false" | FALSE |
| "apoc.ttl.enabled" | "switches TTL feature on or off" | "false" | FALSE |
| "apoc.ttl.limit" | "maximum number of nodes to be deleted during one iteration" | "1000" | FALSE |
| "apoc.ttl.schedule" | "how often does TTL expiry check run in background" | "1m" | FALSE |
| "apoc.uuid.enabled" | "apoc.uuid.enabled, a boolean" | "false" | FALSE |
+---------------------------------------------------------------------------------------------------------------------------+

Are the settings loaded ? are they not ? Shouldn't it be be more straight forward ? 

I also tried to show the apoc settings using the query found in the documentation but it doesn't work, not too sure why

https://neo4j.com/labs/apoc/4.4/overview/apoc.config/apoc.config.list/

 

jm_0-1660670830554.png

 

oh god I think I just figured it out.

This give me the cue I needed:

jm_0-1660675688610.png

So it seems we must select a user database to get the current Apoc version, and its seems to apply the same for Apoc config values ! 

When I use a custom database, I can run this big query and see my custom apoc config values. 

CALL apoc.config.list()
YIELD key, value
WHERE key CONTAINS "apoc"
RETURN key, value;

However, even if I have selected a custom database, I still don't see them when I run 

CALL dbms.listConfig("apoc")
but it might not be an issue .

gclindsey
Node Clone

I'm using the Neo4j 4.4.5 Community Edition AMI from AWS Marketplace on EC2 and I tried the adding the following lines to /var/lib/neo4j/conf/apoc.conf with no luck:

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

What worked for me was to add those lines to /etc/neo4j/neo4j.template instead and restart the server. Unfortunately this AMI was recently discontinued so I'm not sure how helpful this will be in the future, but it solved my problem.

Neo4j 4.4.9. Same issue. Tried to add apoc.import.file.enabled=true to neo4j.conf.

Tried to create a file apoc.conf and write apoc.import.file.enabled=true apoc.import.file.use_neo4j_config=true.

Tried to create a file neo4j.template and write

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

But nothing works. Does someone have some idea?