R
Railwayβ€’7mo ago
Dmitry

Permission denied to volume directory

I've set a custom a custom ELASTICSEARCH_DATADIR ARG in my Dockerfile /data which is the same directory my volume is configured to /data However when I deploy I get the following error
ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/data/nodes];
Likely root cause: java.nio.file.AccessDeniedException: /data/nodes
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397)
at java.base/java.nio.file.Files.createDirectory(Files.java:700)
at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
at java.base/java.nio.file.Files.createDirectories(Files.java:793)
ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/data/nodes];
Likely root cause: java.nio.file.AccessDeniedException: /data/nodes
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397)
at java.base/java.nio.file.Files.createDirectory(Files.java:700)
at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
at java.base/java.nio.file.Files.createDirectories(Files.java:793)
Any ideas what might be the issue here? The volume is definitely connected to the service using it.
No description
19 Replies
Percy
Percyβ€’7mo ago
Project ID: c2e25e3f-aa2f-4b0b-8aa3-0367ede8a6dd
Dmitry
Dmitryβ€’7mo ago
c2e25e3f-aa2f-4b0b-8aa3-0367ede8a6dd
Brody
Brodyβ€’7mo ago
send the dockerhub page for the docker image youre using please
Dmitry
Dmitryβ€’7mo ago
https://hub.docker.com/r/bitnami/elasticsearch My Dockerfile looks like this
FROM bitnami/elasticsearch:7.17.15

ARG ELASTICSEARCH_DATADIR=/data
FROM bitnami/elasticsearch:7.17.15

ARG ELASTICSEARCH_DATADIR=/data
I've also tried ELASTICSEARCH_DATA_DIR_LIST but that gives the same permission denied error
Brody
Brodyβ€’7mo ago
why are you using a dockerfile for that? just deploy the image
Dmitry
Dmitryβ€’7mo ago
Don't I need to specify a custom data directory for my volume?
Brody
Brodyβ€’7mo ago
what is the data directory elasticsearch defaults to?
Dmitry
Dmitryβ€’7mo ago
Not sure tbh.. let me check If you've installed ES on Linux, the default data folder is in /var/lib/elasticsearch (CentOS) or /var/lib/elasticsearch/data (Ubuntu) So /var/lib/elasticsearch/data I would assume?
Brody
Brodyβ€’7mo ago
No description
Dmitry
Dmitryβ€’7mo ago
Oh... Should I make the volume be at /bitnami then?
Brody
Brodyβ€’7mo ago
yes
Dmitry
Dmitryβ€’7mo ago
Gotcha.. let me try that πŸ™‚
Brody
Brodyβ€’7mo ago
forego the dockerfile please just deploy the image
Dmitry
Dmitryβ€’7mo ago
Ok yeah sorry.. i'm still learning πŸ˜„ Trying to get ES working on Temporal πŸ˜…
Brody
Brodyβ€’7mo ago
you will also need a service variable RAILWAY_RUN_UID set to 0
Dmitry
Dmitryβ€’7mo ago
Ok I think it's using the volume now?
[railway] using [1] data paths, mounts [[/bitnami (/dev/zvol/railway_0/vol_f2b6lmj27qc9auw0)]]
[railway] using [1] data paths, mounts [[/bitnami (/dev/zvol/railway_0/vol_f2b6lmj27qc9auw0)]]
πŸ˜„ I think? Gotta wait and see if the disk usage goes up I guess
Brody
Brodyβ€’7mo ago
you are, railway does indeed use a zvol
Dmitry
Dmitryβ€’7mo ago
Sweet!!! Thanks so much for your help! πŸ™ŒπŸ»
Brody
Brodyβ€’7mo ago
no problem!