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
637 stars 161 forks source link

open-gds-2.5.7 jar: GDS 2.5.7 is not compatible with Neo4j version: 5.16 #296

Closed icejean closed 9 months ago

icejean commented 9 months ago

Hi, all, I download the source of GDS 2.5.7 and build Open GDS package with the following command:

gradle :open-packaging:shadowCopy -Pneo4jVersion=5.16.0

According to GDS's document Neo4j Community 5.16.0 should work with Open GDS 2.5.7, but Neo4j Community 5.16.0 failed to start and get the following exceptions saying that GDS 2.5.7 is not compatible with Neo4j version: 5.16, any idea?

D:\Neo4j\neo4j-community-5.16.0\bin>neo4j console
Directories in use:
home:         D:\Neo4j\neo4j-community-5.16.0
config:       D:\Neo4j\neo4j-community-5.16.0\conf
logs:         D:\Neo4j\neo4j-community-5.16.0\logs
plugins:      D:\Neo4j\neo4j-community-5.16.0\plugins
import:       D:\Neo4j\neo4j-community-5.16.0\import
data:         D:\Neo4j\neo4j-community-5.16.0\data
certificates: D:\Neo4j\neo4j-community-5.16.0\certificates
licenses:     D:\Neo4j\neo4j-community-5.16.0\licenses
run:          D:\Neo4j\neo4j-community-5.16.0\run
Starting Neo4j.
2024-01-31 09:32:42.383+0000 INFO  Logging config in use: File 'D:\Neo4j\neo4j-community-5.16.0\conf\user-logs.xml'
2024-01-31 09:32:42.391+0000 INFO  Starting...
2024-01-31 09:32:43.156+0000 INFO  This instance is ServerId{2e528e2a} (2e528e2a-4589-4da7-a535-843c897b3762)
2024-01-31 09:32:43.647+0000 INFO  ======== Neo4j 5.16.0 ========
2024-01-31 09:32:43.721+0000 INFO  [] GDS compatibility: for Neo4j Settings 5.x -- available, for Neo4j Settings 4.4 -- not available, selected: Neo4j Settings 5.x
2024-01-31 09:32:43.722+0000 INFO  [] GDS compatibility: for Neo4j 5.6 -- not available, for Neo4j 5.7 -- not available, for Neo4j 5.8 -- not available, for Neo4j 5.9 -- not available, for Neo4j 5.10 -- not available, for Neo4j 5.11 -- not available, for Neo4j 5.12 -- not available, for Neo4j 5.13 -- not available, for Neo4j 5.14 -- not available, for Neo4j 5.15 -- not available, for Neo4j 4.4 -- not available
2024-01-31 09:32:43.726+0000 ERROR Failed to start Neo4j on localhost:7474.
java.lang.RuntimeException: Error starting Neo4j database server at D:\Neo4j\neo4j-community-5.16.0\data\databases
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:273) ~[neo4j-5.16.0.jar:5.16.0]
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:209) ~[neo4j-5.16.0.jar:5.16.0]
        at org.neo4j.server.CommunityBootstrapper.createNeo(CommunityBootstrapper.java:38) ~[neo4j-5.16.0.jar:5.16.0]
        at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:187) [neo4j-5.16.0.jar:5.16.0]
        at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:99) [neo4j-5.16.0.jar:5.16.0]
        at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:30) [neo4j-5.16.0.jar:5.16.0]
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.GlobalExtensions@7b208b45' failed to initialize. Please see the attached cause exception "GDS 2.5.7 is not compatible with Neo4j version: 5.16".        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:334) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:56) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:85) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:264) ~[neo4j-5.16.0.jar:5.16.0]
        ... 5 more
Caused by: org.neo4j.kernel.extension.FailedToBuildExtensionException: Failed to build kernel extension Extension:OpenGraphDataScienceExtension[gds.open] because it is compiled with a reference to a class, method, or field, that is not in the class path: 'GDS 2.5.7 is not compatible with Neo4j version: 5.16'. 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.16.0.jar:5.16.0]
        at org.neo4j.kernel.extension.ExtensionFailureStrategies$1.handle(ExtensionFailureStrategies.java:68) ~[neo4j-kernel-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.extension.AbstractExtensions.init(AbstractExtensions.java:68) ~[neo4j-kernel-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:317) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:56) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:85) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:264) ~[neo4j-5.16.0.jar:5.16.0]
        ... 5 more
Caused by: java.lang.LinkageError: GDS 2.5.7 is not compatible with Neo4j version: 5.16
        at org.neo4j.gds.compat.ProxyUtil$ProxyInfo.lambda$proxy$0(ProxyUtil.java:254) ~[open-gds-2.5.7.jar:?]
        at org.neo4j.gds.compat.ProxyUtil.findProxy(ProxyUtil.java:54) ~[open-gds-2.5.7.jar:?]
        at org.neo4j.gds.compat.Neo4jProxy.<clinit>(Neo4jProxy.java:92) ~[open-gds-2.5.7.jar:?]
        at org.neo4j.gds.procedures.integration.LogAccessor.getLog(LogAccessor.java:32) ~[open-gds-2.5.7.jar:?]
        at org.neo4j.gds.extension.OpenGraphDataScienceExtension.newInstance(OpenGraphDataScienceExtension.java:58) ~[open-gds-2.5.7.jar:?]
        at org.neo4j.gds.extension.OpenGraphDataScienceExtension.newInstance(OpenGraphDataScienceExtension.java:49) ~[open-gds-2.5.7.jar:?]
        at org.neo4j.kernel.extension.AbstractExtensions.newInstance(AbstractExtensions.java:124) ~[neo4j-kernel-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.extension.AbstractExtensions.init(AbstractExtensions.java:62) ~[neo4j-kernel-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:317) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:56) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:85) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:264) ~[neo4j-5.16.0.jar:5.16.0]
        ... 5 more
2024-01-31 09:32:43.733+0000 INFO  Neo4j Server shutdown initiated by request
2024-01-31 09:32:43.733+0000 INFO  Stopped.
Neo4j web server failed to start. See log for more info.
Run with '--verbose' for a more detailed error message.

D:\Neo4j\neo4j-community-5.16.0\bin>
Mats-SX commented 9 months ago

Hi @icejean.

This problem is a bit surprising, but I think it stems from an outdated source tree. When you say that you 'download the source of GDS 2.5.7', what does that mean precisely?

Normally, one would clone this repository to get the source code, using something like

git clone git@github.com:neo4j/graph-data-science.git

Then you can use git functionality to browse around in the repo's commit history. There is a tag 2.5.7 that denotes the state of the repository at the release of GDS 2.5.7, where compatibility for Neo4j DBMS 5.16.0 is included. But this denotes the official release of Neo4j GDS, which is subtly different from OpenGDS. OpenGDS is not a product that we release, but it is an open source project that people like yourself can fork, extend, contribute to, build and use, all under the remits of the GPLv3 license.

So the version number 2.5.7 does not actually refer to a version of OpenGDS. In fact, OpenGDS will receive compatibility for Neo4j DBMS versions with a slight delay from the official release of GDS the product. In this case, we added 5.16 compatibility on Jan 11 and published it to OpenGDS on Jan 22.

So how to resolve your problem? I think the easiest way to do that is to make sure you are at the very head of the 2.5 branch when you build OpenGDS with the Gradle command (which looks correct, by the way). If you are using git as I described above, you can do for example this:

git checkout 2.5

or maybe like this:

git checkout -b my-2.5-branch;
git reset --hard origin/2.5;

(The last command assumes that you have named the upstream repo (this repo) origin, which is conventional. If you named it otherwise, just change origin to that name.)

At the very least, you should be at commit 7ecd04b5f9.

Note also that the version you will get when you build from the very head of the 2.5 branch is not 2.5.7 but 2.5.8 (unless you override the build configuration). That probably doesn't matter so much.

You can also build OpenGDS from the head of the master branch. In that case it will be versioned 2.7.0 but it will work with Neo4j DBMS 5.16 as well.

I hope this helps!

icejean commented 9 months ago

I just downloaded the source from the release page of graph data science's github site. Well, I'll have a try on the master branch then.

Mats-SX commented 9 months ago

Ah, I see. Yes that is a few commits behind for 5.16 compatibility on the open source level. If you prefer to download zips, you can try this link, which is a zip of the head of 2.5.

I would prefer 2.5 at this time over master. Or potentially 2.6, which is the newest release. master is undergoing some changes at this time and will be a bit unstable for a week or two.

icejean commented 9 months ago

Well, I need to build my own algorithms working together with Neo4j Community 5.16.0+Open GDS 2.5.6 or 2.5.7, so I have to make a jar of the version. There's another issue of my project other than this one, but I have to address this one first.

icejean commented 9 months ago

The master branch is O.K. with Neo4j Community 5.16.0, it's Open GDS 2.7.0 alpha01, which jar is named after by open-gds-2.7.0-alpha01.jar, thanks!

icejean commented 9 months ago

Ah, I see. Yes that is a few commits behind for 5.16 compatibility on the open source level. If you prefer to download zips, you can try this link, which is a zip of the head of 2.5.

I would prefer 2.5 at this time over master. Or potentially 2.6, which is the newest release. master is undergoing some changes at this time and will be a bit unstable for a week or two.

Version 2.5.8 doesn't work.

Caused by: java.lang.LinkageError: GDS 2.5.8 is not compatible with Neo4j version: 5.16
        at org.neo4j.gds.compat.ProxyUtil$ProxyInfo.lambda$proxy$0(ProxyUtil.java:254) ~[open-gds-2.5.8.jar:?]
        at org.neo4j.gds.compat.ProxyUtil.findProxy(ProxyUtil.java:54) ~[open-gds-2.5.8.jar:?]
        at org.neo4j.gds.compat.Neo4jProxy.<clinit>(Neo4jProxy.java:92) ~[open-gds-2.5.8.jar:?]
        at org.neo4j.gds.procedures.integration.LogAccessor.getLog(LogAccessor.java:32) ~[open-gds-2.5.8.jar:?]
        at org.neo4j.gds.extension.OpenGraphDataScienceExtension.newInstance(OpenGraphDataScienceExtension.java:58) ~[open-gds-2.5.8.jar:?]
        at org.neo4j.gds.extension.OpenGraphDataScienceExtension.newInstance(OpenGraphDataScienceExtension.java:49) ~[open-gds-2.5.8.jar:?]
        at org.neo4j.kernel.extension.AbstractExtensions.newInstance(AbstractExtensions.java:124) ~[neo4j-kernel-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.extension.AbstractExtensions.init(AbstractExtensions.java:62) ~[neo4j-kernel-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:317) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:56) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:85) ~[neo4j-common-5.16.0.jar:5.16.0]
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:264) ~[neo4j-5.16.0.jar:5.16.0]

The master branch of 2.7.0 alpha01 is O.K. with Neo4j Community 5.16.0.

Mats-SX commented 9 months ago

Are you still blocked, or did you make your way through the issues?

icejean commented 9 months ago

Actually I'm blocked by another issue#297, it's related to issue#294. @Mats-SX @vnickolov .

Mats-SX commented 9 months ago

Okay, but let's solve that within that issue.