Skip to content

Unable to access 'path.data' #74

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

Closed
sudokien opened this issue Dec 1, 2015 · 5 comments · Fixed by #77
Closed

Unable to access 'path.data' #74

sudokien opened this issue Dec 1, 2015 · 5 comments · Fixed by #77

Comments

@sudokien
Copy link

sudokien commented Dec 1, 2015

Hi, I'm having this issue when trying to have a mounted data volume

$ mkdir esdata

$ docker run -it --rm -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch
Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data/elasticsearch)
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/elasticsearch
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
    at java.nio.file.Files.createDirectory(Files.java:674)
    at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
    at java.nio.file.Files.createDirectories(Files.java:767)
    at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:250)
    at org.elasticsearch.bootstrap.Security.addPath(Security.java:227)
    at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:206)
    at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:184)
    at org.elasticsearch.bootstrap.Security.configure(Security.java:105)
    at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
elasticsearch       latest              14d91f1920dc        6 days ago          345.7 MB
nginx               latest              198a73cfd686        11 days ago         132.8 MB
centos              7                   e9fa5d3a0d0e        6 weeks ago         172.3 MB
centos              latest              e9fa5d3a0d0e        6 weeks ago         172.3 MB

$ docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 17:56:04 UTC 2015
 OS/Arch:      darwin/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 17:56:04 UTC 2015
 OS/Arch:      linux/amd64

If I mount /tmp/esdata from my host instead, surprisingly it works:

$ mkdir /tmp/esdata

$ docker run -it --rm -v /tmp/esdata:/usr/share/elasticsearch/data elasticsearch
[2015-12-01 09:11:59,916][INFO ][node                     ] [Specialist] version[2.1.0], pid[1], build[72cd1f1/2015-11-18T22:40:03Z]
[2015-12-01 09:11:59,917][INFO ][node                     ] [Specialist] initializing ...
[2015-12-01 09:11:59,982][INFO ][plugins                  ] [Specialist] loaded [], sites []
[2015-12-01 09:12:00,001][INFO ][env                      ] [Specialist] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/sda1)]], net usable_space [184.7gb], net total_space [195.8gb], spins? [possibly], types [ext4]
[2015-12-01 09:12:02,338][INFO ][node                     ] [Specialist] initialized
[2015-12-01 09:12:02,338][INFO ][node                     ] [Specialist] starting ...
[2015-12-01 09:12:02,470][WARN ][common.network           ] [Specialist] publish address: {0.0.0.0} is a wildcard address, falling back to first non-loopback: {172.17.0.2}
[2015-12-01 09:12:02,472][INFO ][transport                ] [Specialist] publish_address {172.17.0.2:9300}, bound_addresses {[::]:9300}
[2015-12-01 09:12:02,501][INFO ][discovery                ] [Specialist] elasticsearch/LsFT2a0rSp2Z1lWNMmU6dg
[2015-12-01 09:12:05,595][INFO ][cluster.service          ] [Specialist] new_master {Specialist}{LsFT2a0rSp2Z1lWNMmU6dg}{172.17.0.2}{172.17.0.2:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2015-12-01 09:12:05,661][WARN ][common.network           ] [Specialist] publish address: {0.0.0.0} is a wildcard address, falling back to first non-loopback: {172.17.0.2}
[2015-12-01 09:12:05,662][INFO ][http                     ] [Specialist] publish_address {172.17.0.2:9200}, bound_addresses {[::]:9200}
[2015-12-01 09:12:05,663][INFO ][node                     ] [Specialist] started
[2015-12-01 09:12:05,664][INFO ][gateway                  ] [Specialist] recovered [0] indices into cluster_state
@alexott
Copy link

alexott commented Dec 22, 2015

Have the same issue on Mac OS X...

@sylvinus
Copy link

Same on Mac OS X.

@yosifkit
Copy link
Member

This is related to boot2docker/boot2docker#581; since the elasticsearch process runs as a different user id than the owner of the folder shared from the Mac, it will not have access to write to the VBox Shared Folder. The reason -v /tmp/esdata:/usr/share/elasticsearch/data works is that it is actually just mounting that folder from the Docker VM and nothing is shared to the host Mac.

The linked thread has some suggestions for working around the issue. Some users that want persistence (@md5) just mount a second virtual disk to their VM and mount folders from there to their containers; this allows them to rebuild the VM anytime but still keep their data.

@sudokien
Copy link
Author

Thanks @yosifkit!

@shymaamasoud
Copy link

image
i have the same issue and i can't solve it

1gtm pushed a commit to appscode-images/elasticsearch that referenced this issue Feb 14, 2024
This commit was created by the elastic-dockerfiles-publisher.
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

Successfully merging a pull request may close this issue.

5 participants