Open mateuszpawlik opened 3 days ago
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
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.
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.
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:
I get the following error:
$ 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