Neo4j-admin check-consistency --report-dir option ignored

  • OS: Ubuntu 20.04 LTS (GNU/Linux 5.4.0-1028-aws x86_64)
  • neo4j version: 4.4.4
  • which plugins / extensions / procedures do you use: neo4j-admin check-consistency --backup=...

I created a dump file using

neo4j-admin dump --to=/data/neo4j/backup/my-db-20240516.dump --verbose --database=my-db

Then I wanted to run the consistency check following option 4 from this article: Four ways to check the consistency of a Neo4j graph - Knowledge Base

After running this command

neo4j-admin check-consistency --backup=/data/neo4j/backup/my-db-20240516.dump --verbose --report-dir=/data/neo4j/backup/report_dir

I get the following error:

Selecting JVM - Version:11.0.11+9-Ubuntu-0ubuntu2.20.04, Name:OpenJDK 64-Bit Server VM, Vendor:Ubuntu
Executing command line: /usr/lib/jvm/java-11-openjdk-amd64/bin/java -cp /var/lib/neo4j/plugins/*:/etc/neo4j/*:/usr/share/neo4j/lib/* -Xmx32505856k -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+TrustFinalNonStaticFields -XX:+DisableExplicitGC -XX:MaxInlineLevel=15 -Djdk.nio.maxCachedBufferSize=262144 -Dio.netty.tryReflectionSetAccessible=true -XX:+ExitOnOutOfMemoryError -Djdk.tls.ephemeralDHKeySize=2048 -Djdk.tls.rejectClientInitiatedRenegotiation=true -XX:FlightRecorderOptions=stackdepth=256 -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -Dfile.encoding=UTF-8 org.neo4j.cli.AdminTool check-consistency --backup=/data/neo4j/backup/my-db-20240516.dump --report-dir=/data/neo4j/backup/report_dir --verbose
neo4j 4.4.4
VM Name: OpenJDK 64-Bit Server VM
VM Vendor: Ubuntu
VM Version: 11.0.11+9-Ubuntu-0ubuntu2.20.04
JIT compiler: HotSpot 64-Bit Tiered Compilers
VM Arguments: [-Xmx32505856k, -XX:+UseG1GC, -XX:-OmitStackTraceInFastThrow, -XX:+AlwaysPreTouch, -XX:+UnlockExperimentalVMOptions, -XX:+TrustFinalNonStaticFields, -XX:+DisableExplicitGC, -XX:MaxInlineLevel=15, -Djdk.nio.maxCachedBufferSize=262144, -Dio.netty.tryReflectionSetAccessible=true, -XX:+ExitOnOutOfMemoryError, -Djdk.tls.ephemeralDHKeySize=2048, -Djdk.tls.rejectClientInitiatedRenegotiation=true, -XX:FlightRecorderOptions=stackdepth=256, -XX:+UnlockDiagnosticVMOptions, -XX:+DebugNonSafepoints, -Dfile.encoding=UTF-8]
org.neo4j.cli.CommandFailedException: Report directory path doesn't exist or not a directory: /data/neo4j/backup/my-db-20240516.dump
        at org.neo4j.consistency.CheckConsistencyCommand.execute(CheckConsistencyCommand.java:118)
        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:93)
        at org.neo4j.cli.AdminTool.main(AdminTool.java:79)

If I remove the --report-dir flag, and run

neo4j-admin check-consistency --backup=/data/neo4j/backup/my-db-20240516.dump --verbose

I get the same error (shortened to the important part):

org.neo4j.cli.CommandFailedException: Report directory path doesn't exist or not a directory: /data/neo4j/backup/my-db-20240516.dump

In both cases, the consistency checker seems to think that the dump file I provided for the --backup flag is the report directory and the value of --report-dir seems to be ignored.

Is this a bug or am I using the consistency check command wrong?

Edit 1

After running the dump command, I checked the file with file my-db-20240516.dump, like the article at Four ways to check the consistency of a Neo4j graph - Knowledge Base suggests. However, in my case I simply get back my-db-20240516.dump: data, and running tar xvzf indra-20240516.dump returns

gzip: stdin: not in gzip format

so I assume it is ready to be checked from here.

Caveat: I have not actually run these commands.

It looks like the documentation is a bit unclear on option backup.

neo4j-admin dump option --to appears to allow a file, folder or stdout.

--to=<path> Destination (file or folder or '-' for stdout) of database dump.

neo4j-admin option --backup appears to expect a directory - example on stackoverflow, example on github example 2 (context: data/databases/graph.db is a directory).

--backup=<path> Path to backup to check consistency of. Cannot be used together with --database.

So I guess, you never actually got to the point where --report-dir was ignored because (as the error message hinted at) --backup was not correctly used (i.e. no directory was provided to).

Thanks for replying @grapholog12514!

As an update for any future readers: I never resolved this issue. Instead I went back to look at the input files that I were suspecting of causing the issue that motivated me to try to run the consistency check in the first place. I indeed found an issue in one of my relationship input files, fixed it and that resolved the problem I had.

Update: I'm not in a position to try this again at the moment, so I can't check to see if what @grapholog12514 proposed will solve the issue I had. If anyone else wants to try this out, I'd be happy to close this as resolved.

1 Like