Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neo4j-admin:latest image not compatible with neo4j:5.22.0 image #519

Open
mateuszpawlik opened this issue Oct 15, 2024 · 2 comments
Open
Assignees

Comments

@mateuszpawlik
Copy link

mateuszpawlik commented Oct 15, 2024

I tried to use the neo4j-admin:latest (at pull time 5.21.2 and couldn't find a newer one) image for a database dump as explained in the docs.

The documentation actually lists neo4j-admin:5.24.0 image, which is not available.

I use neo4j:5.22.0 image for my database, because APOC is not available for a newer version.

My command:

docker run --interactive --tty --rm --volume=neo4j_data:/data --volume=$PWD/neo4j-backups:/backups neo4j/neo4j-admin:latest neo4j-admin database dump neo4j --to-path=/backups

I get the following error:

2024-10-15 09:27:10.749+0000 INFO  [o.n.c.d.DumpCommand] Starting dump of database 'neo4j'
2024-10-15 09:27:10.966+0000 ERROR [o.n.c.d.DumpCommand] Failed to dump database 'neo4j': Failure when checking for recovery state: '%s'.org.neo4j.kernel.impl.transaction.log.entry.UnsupportedLogVersionException: Log file contains entries with prefix 18, and the highest supported Kernel Version is KernelVersion{V5_20,version=17}. This indicates that the log files originates from an newer version of neo4j, which we don't support downgrading from.
2024-10-15 09:27:10.966+0000 ERROR [o.n.c.d.DumpCommand] Dump failed for databases: 'neo4j'
Dump failed for databases: 'neo4j'
$ docker version
Client: Docker Engine - Community
 Version:           27.3.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        ce12230
 Built:             Fri Sep 20 11:41:11 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.3.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       41ca978
  Built:            Fri Sep 20 11:41:11 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.22
  GitCommit:        7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc:
  Version:          1.1.14
  GitCommit:        v1.1.14-0-g2c9f560
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Operating system: Debian 12

@mateuszpawlik
Copy link
Author

I solved it by using the same image I use for the database.

docker run --interactive --tty --rm --volume=neo4j_data:/data --volume=$PWD/neo4j-backups:/backups neo4j:5.22.0 neo4j-admin database dump neo4j --to-path=/backups

@mateuszpawlik
Copy link
Author

Or so I thought that I fixed it. After cleaning Docker environment, the above command stopped working with:

ERROR [o.n.c.d.DumpCommand] Failed to dump database 'neo4j': Unable to dump database: AccessDeniedException: /backups

It took me several hours to figure out why it stopped working.

One difference between neo4j/neo4j-admin and neo4j images is explicit change of ownership of the /backup directory.

if [ -d /backups ]; then
check_mounted_folder_writable_with_chown "/backups"
fi

When I executed neo4j-admin from neo4j/neo4j-admin image, although it failed, it silently (or I missed it) changed the ownership of the /backup directory. Then, neo4j-admin from neo4j simply worked. When I tried again in a fresh docker environment, I started getting AccessDeniedException. It does make sense that the neo4j user from docker container cannot write to my host directory with drwxr-xr-x permissions. However, it was difficult to find out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants