neo4j / graph-data-science

Source code for the Neo4j Graph Data Science library of graph algorithms.
https://neo4j.com/docs/graph-data-science/current/
Other
596 stars 157 forks source link

Unable to use graph-data-science plugin on neo4j:latest #274

Closed lothan closed 1 year ago

lothan commented 1 year ago

Trying to use the graph-data-science plugin for the neo4j docker image and it fails at startup.

At the most minimal example using neo4j:latest on Ubuntu 22.04 :

$ sudo docker run --env NEO4J_PLUGINS='["graph-data-science"]' neo4j:latest
Unable to find image 'neo4j:latest' locally
latest: Pulling from library/neo4j
759700526b78: Pull complete
16587156d6d6: Pull complete
bf092e6a4075: Pull complete
158e8789f08f: Pull complete
d5b62bb6d5e4: Pull complete
Digest: sha256:ca9c939fac3c770fc0e62663f48105cd89f88b13941ceb09157f6863e773e8ca
Status: Downloaded newer image for neo4j:latest
Fetching versions.json for Plugin 'graph-data-science' from https://graphdatascience.ninja/versions.json
Installing Plugin 'graph-data-science' from https://graphdatascience.ninja/neo4j-graph-data-science-2.3.8.jar to /var/lib/neo4j/plugins/graph-data-science.jar
Applying default values for plugin graph-data-science to neo4j.conf
2023-06-30 03:48:30.186+0000 INFO  Starting...
2023-06-30 03:48:31.392+0000 INFO  This instance is ServerId{30c0dc28} (30c0dc28-85ed-46d8-8e76-c72a932dd232)
2023-06-30 03:48:32.249+0000 INFO  ======== Neo4j 5.9.0 ========
2023-06-30 03:48:32.352+0000 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:272) ~[neo4j-5.9.0.jar:5.9.0]
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:208) ~[neo4j-5.9.0.jar:5.9.0]
    at org.neo4j.server.CommunityBootstrapper.createNeo(CommunityBootstrapper.java:38) ~[neo4j-5.9.0.jar:5.9.0]
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:188) [neo4j-5.9.0.jar:5.9.0]
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:100) [neo4j-5.9.0.jar:5.9.0]
    at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:30) [neo4j-5.9.0.jar:5.9.0]
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.GlobalExtensions@13a37e2a' failed to initialize. Please see the attached cause exception "Exception java.lang.NoClassDefFoundError: Could not initialize class org.neo4j.gds.compat.SettingProxy [in thread "main"]".
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:335) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:57) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:86) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:263) ~[neo4j-5.9.0.jar:5.9.0]
    ... 5 more
Caused by: org.neo4j.kernel.extension.FailedToBuildExtensionException: Failed to build kernel extension Extension:AuraMaintenanceExtension[gds.aura.maintenance] because it is compiled with a reference to a class, method, or field, that is not in the class path: 'Could not initialize class com.neo4j.gds.internal.AuraMaintenanceSettings'. The most common cause of this problem, is that Neo4j has been upgraded without also upgrading all installed extensions, such as APOC. Make sure that all of your extensions are build against your specific version of Neo4j.
    at org.neo4j.kernel.extension.ExtensionFailureStrategies.wrap(ExtensionFailureStrategies.java:56) ~[neo4j-kernel-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.extension.ExtensionFailureStrategies$1.handle(ExtensionFailureStrategies.java:68) ~[neo4j-kernel-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.extension.AbstractExtensions.init(AbstractExtensions.java:69) ~[neo4j-kernel-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:318) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:57) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:86) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:263) ~[neo4j-5.9.0.jar:5.9.0]
    ... 5 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.neo4j.gds.internal.AuraMaintenanceSettings
    at com.neo4j.gds.internal.AuraMaintenanceExtension.newInstance(AuraMaintenanceExtension.java:55) ~[graph-data-science.jar:?]
    at com.neo4j.gds.internal.AuraMaintenanceExtension.newInstance(AuraMaintenanceExtension.java:38) ~[graph-data-science.jar:?]
    at org.neo4j.kernel.extension.AbstractExtensions.newInstance(AbstractExtensions.java:125) ~[neo4j-kernel-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.extension.AbstractExtensions.init(AbstractExtensions.java:63) ~[neo4j-kernel-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:318) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:57) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:86) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:263) ~[neo4j-5.9.0.jar:5.9.0]
    ... 5 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: Could not initialize class org.neo4j.gds.compat.SettingProxy [in thread "main"]
    at com.neo4j.gds.internal.AuraMaintenanceSettings.<clinit>(AuraMaintenanceSettings.java:27) ~[graph-data-science.jar:?]
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
    at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
    at java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789) ~[?:?]
    at java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729) ~[?:?]
    at java.util.ServiceLoader$3.next(ServiceLoader.java:1403) ~[?:?]
    at org.neo4j.service.Services.loadAllSafely(Services.java:152) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.service.Services.loadAll(Services.java:73) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.service.Services.loadAll(Services.java:59) ~[neo4j-common-5.9.0.jar:5.9.0]
    at org.neo4j.configuration.Config.<clinit>(Config.java:98) ~[neo4j-configuration-5.9.0.jar:5.9.0]
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:128) ~[neo4j-5.9.0.jar:5.9.0]
    ... 2 more
2023-06-30 03:48:32.368+0000 INFO  Neo4j Server shutdown initiated by request
2023-06-30 03:48:32.370+0000 INFO  Stopped.

associated docker version:

$ sudo docker version
Client: Docker Engine - Community
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:51:00 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:51:00 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Thanks!

vnickolov commented 1 year ago

@ert-plus thank you for reporting this, we are going to have a look and let you know.

vnickolov commented 1 year ago

@ert-plus, we have updated the mapping with the correct version, can you please try again, note that Docker may have cached this.

lothan commented 1 year ago

Awesome! Looks like it works now. Thanks for the quick fix!

Cleaning old docker images:

$ sudo docker image prune -a
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
Deleted Images:
untagged: neo4j:5.8
untagged: neo4j@sha256:3bf8dbbda1ef52063693b245c06bf5e9d2768195f082b1b1aed9933475470540
deleted: sha256:5ad022bbe615bdf0661ab86f40e73af636e0c6e870e3c60d844b9562397fbefc
deleted: sha256:6baf8eefe184d62942a2ad42b10716069efd744b5c68851d4bbb50feefdda793
deleted: sha256:c2a9cffb8f2679d3279a1318d67f7a9b8e1f10b48ebbc9bdaf9c2fa5dc68c50e
deleted: sha256:43b068272249fcdff5303b3d6425497b52c34294e4c1ad67d1f7d5157e16be60
deleted: sha256:ef8c57bfcf5d9a42738dcdd7b2d5d2c1de90ef3888362a0f028e21d8045629e1
untagged: neo4j:latest
untagged: neo4j@sha256:ca9c939fac3c770fc0e62663f48105cd89f88b13941ceb09157f6863e773e8ca
deleted: sha256:b246f3b226b168f5342e28e71b7502c2fe6bf1d2afe536b7694ce2cb9cd99c25
deleted: sha256:70eb7f4c956670d53932b76849a22ec22574733e92033990cdd50047143dbaf1
deleted: sha256:63fb35f8ccbcef8e54d84e36a39ad42f73ea5c7fc137e53f47451a5a10dcf1d0
deleted: sha256:3890f46e5c7ff8d181fed83558571c5eb0b6e637039c1ff071b0d2ce9212089e
deleted: sha256:3bc02428433382f381cc07b115c06e04a069f4ee7a96a7c9d1ebbd7124fcaaef
deleted: sha256:0cc1f01656262cc1319655e8570146e4aa190c3fb8c7e81c353760c44a96c13b

Total reclaimed space: 1.005GB

And then trying again:

$ sudo docker run --env NEO4J_PLUGINS='["graph-data-science"]' neo4j:latest
Unable to find image 'neo4j:latest' locally
latest: Pulling from library/neo4j
759700526b78: Pull complete
16587156d6d6: Pull complete
bf092e6a4075: Pull complete
158e8789f08f: Pull complete
d5b62bb6d5e4: Pull complete
Digest: sha256:ca9c939fac3c770fc0e62663f48105cd89f88b13941ceb09157f6863e773e8ca
Status: Downloaded newer image for neo4j:latest
Fetching versions.json for Plugin 'graph-data-science' from https://graphdatascience.ninja/versions.json
Installing Plugin 'graph-data-science' from https://graphdatascience.ninja/neo4j-graph-data-science-2.4.1.jar to /var/lib/neo4j/plugins/graph-data-science.jar
Applying default values for plugin graph-data-science to neo4j.conf
2023-06-30 15:40:03.300+0000 INFO  Starting...
2023-06-30 15:40:04.348+0000 INFO  This instance is ServerId{cf979e5a} (cf979e5a-8da8-48bf-98a9-7db4443956bc)
2023-06-30 15:40:05.029+0000 INFO  ======== Neo4j 5.9.0 ========
2023-06-30 15:40:05.186+0000 INFO  GDS compatibility: for Neo4j Settings 4.4 -- not available, for Neo4j Settings 5.1 -- not available, for Neo4j Settings 5.2.0 -- not available, for Neo4j Settings 5.3 -- not available, for Neo4j Settings 5.4 -- not available, for Neo4j Settings 5.5 -- not available, for Neo4j Settings 5.6 -- not available, for Neo4j Settings 5.7 -- not available, for Neo4j Settings 5.8 -- not available, for Neo4j Settings 5.9 -- available, selected: Neo4j Settings 5.9
2023-06-30 15:40:05.187+0000 INFO  GDS compatibility: for Neo4j 4.4 -- not available, for Neo4j 5.1 -- not available, for Neo4j 5.2.0 -- not available, for Neo4j 5.3 -- not available, for Neo4j 5.4 -- not available, for Neo4j 5.5 -- not available, for Neo4j 5.6 -- not available, for Neo4j 5.7 -- not available, for Neo4j 5.8 -- not available, for Neo4j 5.9 -- available, selected: Neo4j 5.9
2023-06-30 15:40:17.025+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2023-06-30 15:40:18.179+0000 INFO  Remote interface available at http://localhost:7474/
2023-06-30 15:40:18.183+0000 INFO  id: 751690348B91D3CA1FB44F36F37CE06F8819737B03C125382AF2D0986308807A
2023-06-30 15:40:18.184+0000 INFO  name: system
2023-06-30 15:40:18.184+0000 INFO  creationDate: 2023-06-30T15:40:05.87Z
2023-06-30 15:40:18.185+0000 INFO  Started.