How to set apoc.import.file.enable=true?

i use desktop version 4.2.1 in neo4j.I want to import the json file. it is showing me the error --
Neo.ClientError.Procedure.ProcedureCallFailed
Failed to invoke procedure apoc.import.json: Caused by: java.lang.RuntimeException:
Import from files not enabled,
please set apoc.import.file.enabled=true in your apoc.conf

i have configured in the neo4j in settings and enabled it there but it is still not working.Then i saw in the apoc list that is is false?Can i change it here by some ways?

Hi @reeyarani17

Click "..." and select "Settings"

And add "apoc.import.file.enabled=true" to the last line.

#********************************************************************
# Other Neo4j system properties
#********************************************************************
apoc.import.file.enabled=true

Then restart the db.

1 Like

This is the best way to create the "apoc.conf" in conf folder.
And write "apoc.import.file.enabled=true" to the conf.

i had tried this way but it did not work for me.

Am i doing it wrong?I am writing the file in notepad with correct extension and then adding files to the neo4j desktop!I tried invoking the json file by call apoc.load.json("file link ")
Now also the error is showing.

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 may be missing some minor point since i am new to this.
Thankyou so much for your response !

Hi @reeyarani17

Is the cause not restarting the DB?

My Environment

macOS BigSur
Neo4j Desktop 1.4.2
Neo4j 4.2.3

1: Created the DB
2: Check the status

CALL apoc.config.list
"apoc.import.file.enabled"	"false"

3: CALL apoc.load.json

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

4: Add apoc.conf

Create ./conf/apoc.conf
apoc.import.file.enabled=true


5: Restart the DB

6: Check the status

CALL apoc.config.list
"apoc.import.file.enabled"	"true"

7: CALL apoc.load.json

3 Likes

thankyou for such a descriptive response :slight_smile:

How do I do this in Neo4j Browser on Aura instead of self-hosted version?

Yo in case your issue haven't gotten resolved check if the apoc.conf file you've created is a CONF file itself. Windows creats a text file even though your extension is .conf

Working solution

If you have the project in neo4j desktop, open the project in terminal and follow the below steps to setup the “apoc.trigger.enable=true” in “apoc.conf “file

Steps to Create 'apoc.conf’ via Command Line

  1. Navigate to the conf Directory: • Use the 'cd' command to navigate to the ‘conf' directory of your Neo4j database. cmd <your_directory>\conf

  2. Create the 'apoc.conf’ File: • Use the 'echo command to create the 'apoc.conf' file with the required configuration. “echo apoc.trigger.enabled=true › apoc.conf “will • This command will create a new file named "apoc.conf" in the "conf* directory and write the 'apoc. trigger. enabled=true’ setting into it.

  3. Verify the File Creation: • You can verify that the file has been created by listing the contents of the conf directory:

dir