I run neo4j DBMS by neo4j user in docker container from neo4j:4.4.21-community image, the container is normal. I mount data/logs/plugins/import/conf.
The container inspect detail as:
[
{
"Id": "ea2079cef94e2e94a89ee91074876ae6e439ec4eb1e20800685b6da797ada0d1",
"Created": "2023-06-21T07:35:26.4625366Z",
"Path": "tini",
"Args": [
"-g",
"--",
"/startup/docker-entrypoint.sh",
"neo4j"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 9696,
"ExitCode": 0,
"Error": "",
"StartedAt": "2023-06-21T07:35:27.1123208Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:bf473beffa6246d62d4c2569c194944c072628ba6fb73a92647faa1d868e2053",
"ResolvConfPath": "/var/lib/docker/containers/ea2079cef94e2e94a89ee91074876ae6e439ec4eb1e20800685b6da797ada0d1/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/ea2079cef94e2e94a89ee91074876ae6e439ec4eb1e20800685b6da797ada0d1/hostname",
"HostsPath": "/var/lib/docker/containers/ea2079cef94e2e94a89ee91074876ae6e439ec4eb1e20800685b6da797ada0d1/hosts",
"LogPath": "/var/lib/docker/containers/ea2079cef94e2e94a89ee91074876ae6e439ec4eb1e20800685b6da797ada0d1/ea2079cef94e2e94a89ee91074876ae6e439ec4eb1e20800685b6da797ada0d1-json.log",
"Name": "/knowledge-graph",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/home/jedore/projects/neo4j2/data:/data:rw",
"/home/jedore/projects/neo4j2/logs:/logs:rw",
"/home/jedore/projects/neo4j2/import:/import:ro",
"/home/jedore/projects/neo4j2/plugins:/plugins:ro",
"/home/jedore/projects/neo4j2/conf:/conf:ro"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {
"max-size": "100m"
}
},
"NetworkMode": "default",
"PortBindings": {
"7473/tcp": [
{
"HostIp": "",
"HostPort": "7473"
}
],
"7474/tcp": [
{
"HostIp": "",
"HostPort": "7474"
}
],
"7687/tcp": [
{
"HostIp": "",
"HostPort": "7687"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
0,
0
],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": [
"0",
"7474"
],
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": true,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [
"label=disable"
],
"UTSMode": "",
"UsernsMode": "host",
"ShmSize": 67108864,
"Runtime": "runc",
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DeviceRequests": null,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": null,
"ReadonlyPaths": null
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/ffcb595ae4aeef2dff835563a1e99f2b32549cae0beae02119d0b2a2404595cf-init/diff:/var/lib/docker/overlay2/1b7ae4855a7860574594c44c3b8be82dc903879e15dffa5857831be1719f4423/diff:/var/lib/docker/overlay2/7ddfea4c531b06b72d6603aa9dcadb99bae2b944107997ddfde63b57785c0af6/diff:/var/lib/docker/overlay2/81aa409dc6551e8ce6dfe309eb43754367bdd0dc583a61203f46f8c07a8a6e00/diff:/var/lib/docker/overlay2/21875b75595b2d1d63c540885876947b3e0fe3a82d064041dbd926b9bbfdf5fe/diff:/var/lib/docker/overlay2/a083b548a88243b7e40f02456318e5903352285aa92a7c357f48ba6057034748/diff",
"MergedDir": "/var/lib/docker/overlay2/ffcb595ae4aeef2dff835563a1e99f2b32549cae0beae02119d0b2a2404595cf/merged",
"UpperDir": "/var/lib/docker/overlay2/ffcb595ae4aeef2dff835563a1e99f2b32549cae0beae02119d0b2a2404595cf/diff",
"WorkDir": "/var/lib/docker/overlay2/ffcb595ae4aeef2dff835563a1e99f2b32549cae0beae02119d0b2a2404595cf/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/home/jedore/projects/neo4j2/data",
"Destination": "/data",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/home/jedore/projects/neo4j2/logs",
"Destination": "/logs",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/home/jedore/projects/neo4j2/import",
"Destination": "/import",
"Mode": "ro",
"RW": false,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/home/jedore/projects/neo4j2/plugins",
"Destination": "/plugins",
"Mode": "ro",
"RW": false,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/home/jedore/projects/neo4j2/conf",
"Destination": "/conf",
"Mode": "ro",
"RW": false,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "ea2079cef94e",
"Domainname": "",
"User": "7474",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"7473/tcp": {},
"7474/tcp": {},
"7687/tcp": {}
},
"Tty": true,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/var/lib/neo4j/bin:/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"JAVA_HOME=/opt/java/openjdk",
"NEO4J_SHA256=ba7cef86b9b2f0743f3855f4543f81fa46d07c5c724a56e5f4e0f437e20cc3a5",
"NEO4J_TARBALL=neo4j-community-4.4.21-unix.tar.gz",
"NEO4J_EDITION=community",
"NEO4J_HOME=/var/lib/neo4j"
],
"Cmd": [
"neo4j"
],
"Image": "neo4j:4.4.21-community",
"Volumes": {
"/conf": {},
"/data": {},
"/import": {},
"/logs": {},
"/plugins": {}
},
"WorkingDir": "/var/lib/neo4j",
"Entrypoint": [
"tini",
"-g",
"--",
"/startup/docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "fd13c088d4085532d4e7519b9ad2759c48539dab704b1302ca8238fad541fc16",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"7473/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "7473"
},
{
"HostIp": "::",
"HostPort": "7473"
}
],
"7474/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "7474"
},
{
"HostIp": "::",
"HostPort": "7474"
}
],
"7687/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "7687"
},
{
"HostIp": "::",
"HostPort": "7687"
}
]
},
"SandboxKey": "/var/run/docker/netns/fd13c088d408",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "878044cec1abb1d8276e1b989619aa573765d3333b21101f17faa45fefbc6af1",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "871209b514a89b544982e4090d07cc8bbfebb30c48debdec6919c2cd7fc2f9d6",
"EndpointID": "878044cec1abb1d8276e1b989619aa573765d3333b21101f17faa45fefbc6af1",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
]
Then, I enter container docker exec -it <container name> /bin/bash
.
Import data to a new database by neo4j-admin import
as:
neo4j-admin import --database=knowledge-graph --nodes=import/vertex_stage_header.csv,import/vertex_stage.csv
But this raised a error:
java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /import.report
at org.neo4j.importer.ImportCommand.execute(ImportCommand.java:272)
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)
Caused by: java.nio.file.AccessDeniedException: /import.report
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
at java.base/java.nio.file.Files.newOutputStream(Files.java:220)
at org.neo4j.io.fs.DefaultFileSystemAbstraction.openFileOutputStream(DefaultFileSystemAbstraction.java:278)
at org.neo4j.io.fs.DefaultFileSystemAbstraction.openAsOutputStream(DefaultFileSystemAbstraction.java:83)
at org.neo4j.importer.CsvImporter.doImport(CsvImporter.java:157)
at org.neo4j.importer.ImportCommand.execute(ImportCommand.java:268)
But if I import data by root user, this will succeed.
I create&run this neo4j container by neo4j user, and system&neo4j
databases are create successful. The data
directory owned to neo4j user, too.
I don't know why, anyone met this error or know the reason ? Thanks a lot!