-
Notifications
You must be signed in to change notification settings - Fork 1.9k
AccessDeniedException /usr/share/elasticsearch/data/nodes #137
Comments
I had same problem on Kubernetes 1.14.2 with ES 6.2.4 and 6.8.0. I saw an almost identical issue here for 6.2.4 and here for 6.3.2. I saw many comments on permissions for elasticsearch user and also found comments on Elastic discuss, but I really didn't find a practical solution. |
I don't have an IBM Kubernetes cluster to test with. It's also a setup that we haven't tested at all yet, however if it has persistent storage it should work just fine. Are you able to give some more debugging output:
And if possible could you try to attach into the container while it is starting up and check if the volumes are mounted correctly?
I believe this is because you didn't quote |
@Crazybus i just pulled the latest helm chart and will try again. |
there is something with parsing the yaml. im getting the following error and here is the image tag:
here is the describe pod contents:
|
i changed the image: in the yaml to be the following to get by that error: image: "docker.elastic.co/elasticsearch/elasticsearch:{{ .Values.imageTag }}" |
here is the debugging info you requested:
|
|
One problem seems to be with the formatting of the image. In the pod spec I can see this:
This implies that you have something like this set:
However I don't see this in the values.yaml you posted earlier. And this isn't the right way to specify the image pull secrets for this chart. It should look like: helm-charts/elasticsearch/tests/elasticsearch_test.py Lines 384 to 390 in 4d6d768
Could you post the output of
This container shouldn't have the disks mounted into it. Can you run this again from the elasticsearch container? |
Having the same problem. Running kube v1.14.2 and es v7.1.0. All 3 pods can create the elasticsearch-master-graceful-termination-handler container but not the elasticsearch container. Only thing I customized when deploying was the namespace. Here are the logs for elasticsearch container:
|
@ghostymun Thanks for the extra report. Could you also provide me with this information?
And if possible could you try to attach into the container while it is starting up and check if the volumes are mounted correctly?
|
I to have the same issue! A lot of forum posts suggest this a UID or GID issue. I manually created the $DATA/elasticsearch. Set permissions 666 and created the PV's.
|
version 7.1.0 and I also installed in the non default name space. |
I manually changed the permissions to my own "matt" UID '1000' on each node after creating the PV's. Now it installed correctly! |
@Crazybus i think this has helped - at least for my IBM cloud 1.13 kube cluster: https://cloud.ibm.com/docs/containers?topic=containers-cs_troubleshoot_storage#file_app_failures in the initContainer section of the statefulset.yaml i added: this seems to have gotten around the access denied issue. |
Glad you figured it out. It's really surprising that IBM Kubernetes does not support this and actively encourages people to just run everything as root: https://cloud.ibm.com/docs/containers?topic=containers-cs_troubleshoot_storage#cs_storage_nonroot
There are other Kubernetes providers that do the opposite, that prevent you from running anything as root. Since the Elasticsearch chart does work in a non-root environment I think its best to keep it as is and instead expect that users requiring root only volumes add something like this to
|
@Crazybus sounds good. |
i have checked official es operator and used
from it. |
Having the same issue but with a path '/usr/share/elasticsearch/data/nodes/0' and cannot wrap my head around why it happens. Tried with several I am using a custom created |
This is the result of
|
This is happening for me every time I restart my minikube node... Is there any solution to this? |
@brandoncollins7 It's a permission issue. What's your environment? If you are on local you can just do chmod -R 777 on that directory(simplest but not the secure). If not on local then you will have to see that user who is running this service has permission to write into that directory, if not then give permission to that user. |
I had the same issue and found an elegant solution using IBM documentations (https://cloud.ibm.com/docs/containers?topic=containers-file_storage#file_storageclass_reference) First of all, you can make a little check : Before that, you should delete the PVCs ( as they will keep their StorageClass even with an helm uninstall/reinstall.). clone the helm chart from git to get the elasticsearch/values.yaml. In the values.yaml, find the volumeClaimTemplate and add the storageClassName line
Find the podSecurityContext and modify the fsGroup :
Then, you can perform your helm install with the custom values.yaml. Right Issues should have disappear |
Sometimes your storageClass will mount the Volume as root you need to fix permission on the mounted FS in docker.
|
Chart version:
version: 7.0.1-alpha1
Kubernetes version:
1.11
Kubernetes provider: E.g. GKE (Google Kubernetes Engine)
IBM cloud
Helm Version:
2.9.1
Values.yaml:
Describe the bug:
I initially had some issues with the image and tag due to ""
so i did this: to fix that: image: docker.elastic.co/elasticsearch/elasticsearch:{{ .Values.imageTag }}
but now the kubernetes pods are in a crashloopbackoff state with this in their logs:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
{"type": "server", "timestamp": "2019-05-16T21:50:15,565+0000", "level": "WARN", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-0", "message": "uncaught exception in thread [main]" ,
"stacktrace": ["org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/usr/share/elasticsearch/data/nodes];",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-7.0.1.jar:7.0.1]",
"at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.0.1.jar:7.0.1]",
"Caused by: org.elasticsearch.ElasticsearchException: failed to bind service",
"at org.elasticsearch.node.Node.(Node.java:580) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.node.Node.(Node.java:251) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:211) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:211) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:325) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.0.1.jar:7.0.1]",
"... 6 more",
"Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes",
"at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]",
"at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]",
"at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]",
"at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389) ~[?:?]",
"at java.nio.file.Files.createDirectory(Files.java:692) ~[?:?]",
"at java.nio.file.Files.createAndCheckIsDirectory(Files.java:799) ~[?:?]",
"at java.nio.file.Files.createDirectories(Files.java:785) ~[?:?]",
"at org.elasticsearch.env.NodeEnvironment.lambda$new$0(NodeEnvironment.java:270) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:207) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:267) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.node.Node.(Node.java:271) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.node.Node.(Node.java:251) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:211) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:211) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:325) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.0.1.jar:7.0.1]",
"... 6 more"] }
Steps to reproduce:
Expected behavior:
Provide logs and/or server output (if relevant):
Any additional context:
The text was updated successfully, but these errors were encountered: