crate / docker-crate

Source repository for the official CrateDB Docker image
https://registry.hub.docker.com/_/crate/
Apache License 2.0
49 stars 22 forks source link

Docker container have access troubles to the /crate/data directory #138

Closed manveloff closed 5 years ago

manveloff commented 5 years ago

As I understand, it's not a support request, but the official Crate's docker image bug. That's why I've created this issue request.

Here is my Crate's docker-compose.yml setup

general-crate:
    image: crate:latest
    ports:
      - 4200:4200
    environment:
      - CRATE_HEAP_SIZE=3g
    volumes:
      - /crate:/data
      - <path_to_the_project>/manager/configs/active/services/general-crate/crate.yml:/crate/config/crate.yml
    deploy:
      mode: global
      endpoint_mode: dnsrr
      update_config:
        parallelism: 2  

CrateDB version 3.1.2

Environment description (inside a container) JVM version: "1.8.0_191 Kernel: Linux ac75a799d53e 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Distribution: CentOS-7 Docker: 18.09.0, build 4d60db4 1 node, locally, using docker-compose up (not in swarm mode).

Environment description (where I start a docker container) Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic

Description I try to start a container with official Crate docker image. But it is not starting because of the error described below. It has some access troubles inside the container (AccessDeniedException: /crate/data). If I'm not mistaken, this access issue is an inner issue of the official Crate docker image. Otherwise I don't understand how my docker-compose setup or environment could provoke this?

docker logs stage_general-crate_1_74687e5aa3a0
[2018-12-07T10:29:23,109][INFO ][o.e.n.Node               ] [Piz S-chalembert] initializing ...
[2018-12-07T10:29:23,134][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [Piz S-chalembert] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to create node environment
        at org.elasticsearch.bootstrap.StartupExceptionProxy.<init>(StartupExceptionProxy.java:31) ~[crate-app-3.1.2.jar:3.1.2]
        at io.crate.bootstrap.CrateDB.init(CrateDB.java:159) ~[crate-app-3.1.2.jar:3.1.2]
        at io.crate.bootstrap.CrateDB.execute(CrateDB.java:135) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:85) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.1.4.jar:3.1.2]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.1.4.jar:3.1.2]
        at io.crate.bootstrap.CrateDB.main(CrateDB.java:88) ~[crate-app-3.1.2.jar:3.1.2]
        at io.crate.bootstrap.CrateDB.main(CrateDB.java:81) ~[crate-app-3.1.2.jar:3.1.2]
Caused by: java.lang.IllegalStateException: Failed to create node environment
        at org.elasticsearch.node.Node.<init>(Node.java:268) ~[crate-app-3.1.2.jar:3.1.2]
        at io.crate.node.CrateNode.<init>(CrateNode.java:66) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.bootstrap.BootstrapProxy$1.<init>(BootstrapProxy.java:202) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.bootstrap.BootstrapProxy.setup(BootstrapProxy.java:202) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.bootstrap.BootstrapProxy.init(BootstrapProxy.java:267) ~[crate-app-3.1.2.jar:3.1.2]
        at io.crate.bootstrap.CrateDB.init(CrateDB.java:155) ~[crate-app-3.1.2.jar:3.1.2]
        ... 6 more
Caused by: java.nio.file.AccessDeniedException: /crate/data
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:1.8.0_181]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_181]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_181]
        at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:1.8.0_181]
        at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_181]
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_181]
        at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_181]
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:204) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.node.Node.<init>(Node.java:265) ~[crate-app-3.1.2.jar:3.1.2]
        at io.crate.node.CrateNode.<init>(CrateNode.java:66) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.bootstrap.BootstrapProxy$1.<init>(BootstrapProxy.java:202) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.bootstrap.BootstrapProxy.setup(BootstrapProxy.java:202) ~[crate-app-3.1.2.jar:3.1.2]
        at org.elasticsearch.bootstrap.BootstrapProxy.init(BootstrapProxy.java:267) ~[crate-app-3.1.2.jar:3.1.2]
        at io.crate.bootstrap.CrateDB.init(CrateDB.java:155) ~[crate-app-3.1.2.jar:3.1.2]
        ... 6 more
mfussenegger commented 5 years ago

Duplicate of https://github.com/crate/docker-crate/issues/137