0

Windows 10 and Neo4j Desktop 1.4.9, Java 17.

Each time I try to dump a database, I get the following error in Neo4j Desktop. enter image description here

I checked the Neo4jDesktop log.

[2021-11-21 18:43:55.043] [error] Selecting JVM - Version:11.0.8, Name:OpenJDK 64-Bit Server VM, Vendor:Azul Systems, Inc.
Invalid value for option '--to': cannot convert 'P:\Software\DB\NoSQL\Neo4j_data\relate-data\projects\project-21158abc-7557-4b51-8eb1-19276b14bfda\from-blog-neo4j-Nov-21-2021-18:43:48.dump' to interface java.nio.file.Path (java.nio.file.InvalidPathException: Illegal char <:> at index 128: P:\Software\DB\NoSQL\Neo4j_data\relate-data\projects\project-21158abc-7557-4b51-8eb1-19276b14bfda\from-blog-neo4j-Nov-21-2021-18:43:48.dump)

Dump a database into a single-file archive.

USAGE

neo4j-admin dump [--expand-commands] [--verbose] [--database=<database>]
                 --to=<path>

DESCRIPTION

Dump a database into a single-file archive. The archive can be used by the load
command. <destination-path> can be a file or directory (in which case a file
called <database>.dump will be created). It is not possible to dump a database
that is mounted in a running Neo4j server.

OPTIONS

      --verbose           Enable verbose output.
      --expand-commands   Allow command expansion in config value evaluation.
      --database=<database>
                          Name of the database to dump.
                            Default: neo4j
      --to=<path>         Destination (file or folder) of database dump.

When I tried the command from the Powershell, it gives an error regarding the JVM version, and asks to change the JDK:

Selecting JVM - Version:17.0.1, Name:OpenJDK 64-Bit Server VM, Vendor:Oracle Corporation
WARNING! You are using an unsupported Java runtime.
* Please use Oracle(R) Java(TM) 11, OpenJDK(TM) 11 to run Neo4j.
* Please see https://neo4j.com/docs/ for Neo4j installation instructions.
OpenJDK 64-Bit Server VM warning: Option UseBiasedLocking was deprecated in version 15.0 and will likely be removed in a future release.
Exception in thread "main" java.lang.LinkageError: Cannot to link java.nio.DirectByteBuffer
        at org.neo4j.internal.unsafe.UnsafeUtil.<clinit>(UnsafeUtil.java:124)
        at org.neo4j.io.pagecache.impl.muninn.MuninnPageCache.verifyHacks(MuninnPageCache.java:397)
        at org.neo4j.io.pagecache.impl.muninn.MuninnPageCache.<init>(MuninnPageCache.java:369)
        at org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory.createPageCache(ConfiguringPageCacheFactory.java:104)
        at org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory.getOrCreatePageCache(ConfiguringPageCacheFactory.java:86)
        at org.neo4j.kernel.recovery.Recovery.getPageCache(Recovery.java:478)
        at org.neo4j.kernel.recovery.Recovery.isRecoveryRequired(Recovery.java:210)
        at org.neo4j.kernel.recovery.Recovery.isRecoveryRequired(Recovery.java:168)
        at org.neo4j.commandline.dbms.DumpCommand.checkRecoveryState(DumpCommand.java:182)
        at org.neo4j.commandline.dbms.DumpCommand.checkDbState(DumpCommand.java:170)
        at com.neo4j.commandline.dbms.EnterpriseDumpCommand.checkDbState(EnterpriseDumpCommand.java:36)
        at org.neo4j.commandline.dbms.DumpCommand.execute(DumpCommand.java:113)
        at org.neo4j.cli.AbstractCommand.call(AbstractCommand.java:71)
        at org.neo4j.cli.AbstractCommand.call(AbstractCommand.java:34)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at org.neo4j.cli.AdminTool.execute(AdminTool.java:89)
        at org.neo4j.cli.AdminTool.main(AdminTool.java:67)
        Suppressed: java.lang.LinkageError: Could not get Throwable message field
                at org.neo4j.internal.helpers.Exceptions.<clinit>(Exceptions.java:239)
                at org.neo4j.kernel.impl.scheduler.CentralJobScheduler.shutdown(CentralJobScheduler.java:271)
                at org.neo4j.kernel.impl.scheduler.CentralJobScheduler.close(CentralJobScheduler.java:282)
                at org.neo4j.kernel.recovery.Recovery.isRecoveryRequired(Recovery.java:209)
                ... 16 more
        Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private java.lang.String java.lang.Throwable.detailMessage accessible: module java.base does not "opens java.lang" to unnamed module @2b552920
                at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
                at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
                at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
                at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
                at org.neo4j.internal.helpers.Exceptions.<clinit>(Exceptions.java:235)
                ... 19 more
Caused by: java.lang.IllegalAccessException: module java.base does not open java.nio to unnamed module @2b552920
        at java.base/java.lang.invoke.MethodHandles.privateLookupIn(MethodHandles.java:259)
        at org.neo4j.internal.unsafe.UnsafeUtil.<clinit>(UnsafeUtil.java:107)

**************Downgraded to Java 11 After I downgraded(simply pointed the environment variables to jdk 11), the neo4j-admin dump command worked but the Neo4j Desktop still fails to dump, the error in the logs is same.

Kaliyug Antagonist
  • 3,512
  • 9
  • 51
  • 103

2 Answers2

0

Several suggestions:

Is your path incorrect? I've used a directory within the active database folder. I just create a dump folder along side the bin, plugin, import and data folders.

You execute the command from the bin folder.

The database needs to be stopped.

David A Stumpf
  • 753
  • 5
  • 13
0

If the error in your logs hasn't changed after the downgrade, then note the lines:

[2021-11-21 18:43:55.043] [error] Selecting JVM - Version:11.0.8, Name:OpenJDK 64-Bit Server VM, Vendor:Azul Systems, Inc.
Invalid value for option '--to': cannot convert 'P:\Software\DB\NoSQL\Neo4j_data\relate-data\projects\project-21158abc-7557-4b51-8eb1-19276b14bfda\from-blog-neo4j-Nov-21-2021-18:43:48.dump' to interface java.nio.file.Path (java.nio.file.InvalidPathException: Illegal char <:> at index 128: P:\Software\DB\NoSQL\Neo4j_data\relate-data\projects\project-21158abc-7557-4b51-8eb1-19276b14bfda\from-blog-neo4j-Nov-21-2021-18:43:48.dump)

In particular Illegal char<:>. The path that you provided is P:\Software\DB\NoSQL\Neo4j_data\relate-data\projects\project-21158abc-7557-4b51-8eb1-19276b14bfda\from-blog-neo4j-Nov-21-2021-18:43:48.dump. You have a colon in your path name where you specify the timestamp, and that is causing your install to puke. Rename the file and then you're all set.


If the error in powershell hasn't changed after the downgrade, then note this portion of your powershell output:

Selecting JVM - Version:17.0.1, Name:OpenJDK 64-Bit Server VM, Vendor:Oracle Corporation
WARNING! You are using an unsupported Java runtime.

This means that even though you installed Java 11, you still have Java 17 on your system and that is the version that is being picked up. There are two approaches to resolve this: easy and "correct". If you aren't working on multiple projects, some of which require Java 17, then I'd recommend the easy approach.

Easy approach: Uninstall Java 17. Be certain that it is completely uninstalled. If you aren't sure that you've done so, uninstall all Java from your system. Install Java 11. In powershell, run java -version and confirm that you see Java 11 as the version listed. If you need a JDK, run javac -version for completeness and check that too. At this point, it should be impossible for your system to be providing Java 17 to Neo4j.

Correct approach: Learn how the two applications are finding Java. Ensure that they are both correctly configured to refer to the Java version that they need.

Why is this happening? Java versions greater than 11 restrict access to an JVM internal class java.nio.DirectByteBuffer, and Neo4j hasn't updated their implementation. Historically, these classes had minimal documentation and they typically warned developers not to touch them as they were subject to sudden incompatible changes without warning. Some codebases used them anyway for a variety of reasons.