Elasticsearch reports cannot create regular file '/etc/elasticsearch/elasticsearch.yml': Permission denied post upgrade to 4.5
Issue
- Elastic search crashing with permission denied errors in the logs. The issue arise after upgrading to 4.5. Also, the user tried install ES again but same issue.
oc get pods -n openshift-logging -l component=elasticsearch
NAME READY STATUS RESTARTS AGE
elasticsearch-cdm-01rallqy-1-6c865994d-v7kkj 1/2 CrashLoopBackOff 32 141m
elasticsearch-cdm-01rallqy-2-5b54c6f99-55sl8 1/2 CrashLoopBackOff 32 141m
elasticsearch-cdm-01rallqy-3-686b6f9fb6-c6xz9 1/2 CrashLoopBackOff 32 140m
- Checking the logs from the elasticsearch pods from openshift-logging project reports the following error.
oc logs elasticsearch-cdm-01rallqy-1-6c865994d-v7kkj -n openshift-logging -c elasticsearch
[2020-08-12 20:42:36,570][INFO ][container.run ] Begin Elasticsearch startup script
[2020-08-12 20:42:36,573][INFO ][container.run ] Comparing the specified RAM to the maximum recommended for Elasticsearch...
[2020-08-12 20:42:36,574][INFO ][container.run ] Inspecting the maximum RAM available...
[2020-08-12 20:42:36,577][INFO ][container.run ] ES_JAVA_OPTS: ' -Xms8192m -Xmx8192m'
[2020-08-12 20:42:36,578][INFO ][container.run ] Copying certs from /etc/openshift/elasticsearch/secret to /etc/elasticsearch//secret
[2020-08-12 20:42:36,583][INFO ][container.run ] Building required jks files and truststore
Importing keystore /etc/elasticsearch//secret/admin.p12 to /etc/elasticsearch//secret/admin.jks...
Entry for alias 1 successfully imported.
Import command completed: 1 entries successfully imported, 0 entries failed or cancelled
.........
.....
Certificate was added to keystore
Certificate was added to keystore
cp: cannot create regular file '/etc/elasticsearch/elasticsearch.yml': Permission denied
cp: cannot create regular file '/etc/elasticsearch/log4j2.properties': Permission denied
Environment
- Red Hat OpenShift Container Platform
- 4.5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.