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.

Config for Upgrade from 4.4 to 5.1

BairDev
Node Clone

After upgrading neo4j  to version 5.1.0 (from 4.4.x) the server does not start anymore.

Error Message:````

Failed to read config /etc/neo4j/neo4j.conf: Unrecognized setting. No declared setting with name: apoc.export.file.enabled

But there is exactly this entry in my neo4j.conf

#*****************************************************************
# Neo4j configuration
#
# For more details and a complete list of settings, please see
# https://neo4j.com/docs/operations-manual/current/reference/configuration-settings/
#*****************************************************************

# The name of the default database
#dbms.default_database=neo4j

# Paths of directories in the installation.
dbms.directories.data=/var/lib/neo4j/data
dbms.directories.plugins=/var/lib/neo4j/plugins
dbms.directories.logs=/var/log/neo4j
dbms.directories.lib=/usr/share/neo4j/lib
#dbms.directories.run=run
#dbms.directories.transaction.logs.root=data/transactions

# This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or comment it out to
# allow files to be loaded from anywhere in the filesystem; this introduces possible security problems. See the
# `LOAD CSV` section of the manual for details.
dbms.directories.import=/var/lib/neo4j/import

# Whether requests to Neo4j are authenticated.
# To disable authentication, uncomment this line
#dbms.security.auth_enabled=false

# Enable this to be able to upgrade a store from an older version.
dbms.allow_upgrade=true

#*******************************************************************
# APOC settings
#*******************************************************************
apoc.ttl.enabled=true
# should be 24 hours
apoc.ttl.schedule=86400
dbms.security.procedures.unrestricted=apoc.*
apoc.export.file.enabled=true

So I don't really get the error message an how the config file can be updated properly.

1 ACCEPTED SOLUTION

Hello @BairDev 

Neo4j 5 uses stricter checking on the neo4j.conf file by default - the error message is saying that you need to remove that setting. Does commenting that setting make the error go away?

View solution in original post

10 REPLIES 10

Hello @BairDev 

Neo4j 5 uses stricter checking on the neo4j.conf file by default - the error message is saying that you need to remove that setting. Does commenting that setting make the error go away?

Yes, that works!

Together with commenting out apoc.ttl.enabled

#*******************************************************************
# APOC settings
#*******************************************************************
## apoc.ttl.enabled=tru
# should be 24 hours
# apoc.ttl.schedule=86400
dbms.security.procedures.unrestricted=apoc.*
# apoc.export.file.enabled=true

Hi,

I ran into the same error and commented out the relevant lines but then got an error. I also tried following the instructions on the apoc readme: https://github.com/neo4j/apoc#using-apoc-with-the-neo4j-docker-image. 

 

Error:

"""

ERROR Failed to start Neo4j on 0.0.0.0:7474.

java.lang.RuntimeException: Error starting Neo4j database server at /data/databases

 at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:255) ~[neo4j-5.1.0.jar:5.1.0]

....

Failed to build kernel extension Extension:RegisterComponentFactory[ApocRegisterComponent] because it is compiled with a reference to a class, method, or field, that is not in the class path: ''org.neo4j.logging.Log org.neo4j.logging.internal.LogService.getUserLog(java.lang.Class)''. The most common cause of this problem, is that Neo4j has been upgraded without also upgrading allinstalled extensions, such as APOC. Make sure that all of your extensions are build against your specific version of Neo4j.

"""

 

docker_compose.yml after commenting out for error. 

"""

services:

neo4j:

image: neo4j

build: ./neo4j

ports:

- 7474:7474

- 7687:7687

environment:

#- NEO4J_apoc_import_file_use__neo4j__config=true

#- NEO4J_dbms_security_procedures_unrestricted=apoc.\\\*

#- NEO4J_apoc_export_file_enabled=true

#- NEO4J_apoc_import_file_enabled=true

#- NEO4J_dbms_shell_enabled=true

- NEO4J_PLUGINS=["apoc"]

 

"""

Looks like a version mismatch - did you get the correct version of apoc for your version of neo4j?

chasemc
Node Link

What's the recommended way to export if this is disabled?
for example, apoc.export.graphml.query fails with:

Failed to invoke procedure `apoc.export.graphml.query`: Caused by: java.lang.RuntimeException: Export to files not enabled, please set apoc.export.file.enabled=true in your apoc.conf.
Otherwise, if you are running in a cloud environment without filesystem access, use the `{stream:true}` config and null as a 'file' parameter to stream the export back to your client.

If you wanted graphml export, then it seems like you would want to enable? It's probably best to open a new thread and provide the full details of what's going on to get the best help.

I can open a new thread but it's exactly the same issue. Commenting out the line allows the docker image/neo4j to start but obviously disables exporting altogether, including it results in the error described in the original post

sg_neoloc='somdirectory'
docker run \
    --user=$(id -u):$(id -g) \
    -p7474:7474 -p7687:7687 \
    -v $sg_neoloc/data:/data \
    -v $sg_neoloc/logs:/logs \
    -v $sg_neoloc/import:/var/lib/neo4j/import \
    -v $sg_neoloc/plugins:/plugins \
    -v $sg_neoloc/conf:/var/lib/neo4j/conf \
    -env NEO4J_apoc_export_file_enabled=true \
    -env NEO4J_apoc_import_file_enabled=true \
    -env NEO4J_apoc_import_file_use__neo4j__config=true \
        --env NEO4J_AUTH=neo4j/test \
        --env NEO4J_PLUGINS='["apoc", "graph-data-science"]' \
        --env NEO4J_server_memory_heap_initial__size='23000m' \
        --env NEO4J_server_memory_heap_max__size='23000m' \
        --env NEO4J_server_memory_pagecache_size='20g' \
        --env NEO4J_server_jvm_additional='-XX:+ExitOnOutOfMemoryError' \
    neo4j:5.1.0
    

OK I gotcha now. I'm looking at the docs for 5.0, and I don't see that procedure anymore. Let me reach out internally and see what I can find.

Apparently if you use "-e apoc.export.file.enabled=true" in your docker run it should work. I also got myself twisted around and was looking at the apoc labs docs and not the core docs. It's in there - the "-e apoc.export.file.enabled=true" is a workaround for now.

I wasn't able to get it to work through docker env. I had to create an apoc.conf as described here:
https://community.neo4j.com/t5/neo4j-graph-platform/setting-apoc-import-file-enabled-true-in-your-ne...