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

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?

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 .