# Failed to load settings from \[elasticsearch.yml\]

**URL:** <https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [August 18, 2020, 10:25am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391 "2020-08-18T10:25:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kailas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kailas/32/55376_2.png) [@Kailas](https://discuss.elastic.co/u/Kailas)\
**Post date:** [August 18, 2020, 10:25am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/1 "2020-08-18T10:25:39Z")

</div>

I am getting the following exception . I have followed this link  
[https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-advanced-node-scheduling.html#k8s-define-elasticsearch-nodes-roles](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-advanced-node-scheduling.html#k8s-define-elasticsearch-nodes-roles)

root@k8smaster elastic]# ku logs quickstart-es-ingest-data-0 -n eckcluster  
Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: IllegalStateException[only value lists are allowed in serialized settings];  
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1100)

Can anyone please help find the error , this is my yaml file

[root@k8smaster elastic]# vi elasticsearch.yaml  
count: 3  
config:  
node.master: false  
node.data: true  
node.ingest: true  
node.attr.data: hot  
podTemplate:  
spec:  
containers:  
- name: elasticsearch  
resources:  
limits:  
memory: 16Gi  
cpu: 4  
affinity:  
nodeAffinity:  
requiredDuringSchedulingIgnoredDuringExecution:  
nodeSelectorTerms:  
- matchExpressions:  
- key: [beta.kubernetes.io/instance-type](http://beta.kubernetes.io/instance-type)  
operator: In  
values:  
- highio  
volumeClaimTemplates:  
- metadata:  
name: elasticsearch-data  
spec:  
accessModes:  
- ReadWriteOnce  
resources:  
requests:  
storage: 20Gi  
storageClassName: myStorage

---

<div class="post-metadata">

**Author:** ![charith-elastic](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@charith-elastic](https://discuss.elastic.co/u/charith-elastic)\
**Post date:** [August 18, 2020, 1:03pm UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/2 "2020-08-18T13:03:26Z")

</div>

This manifest doesn't seem to be complete. It is missing a few important fields like `apiVersion` and `version` and seems to be invalid because there are no master nodes configured at all. Please paste the full manifest and we can take a look. You can surround the text with ``` to format it properly.

---

<div class="post-metadata">

**Author:** ![Kailas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kailas/32/55376_2.png) [@Kailas](https://discuss.elastic.co/u/Kailas)\
**Post date:** [August 19, 2020, 6:57am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/4 "2020-08-19T06:57:33Z")

</div>

'''  
''' apiVersion: [elasticsearch.k8s.elastic.co/v1](http://elasticsearch.k8s.elastic.co/v1)  
kind: Elasticsearch  
metadata:  
name: quickstart  
spec:  
version: 7.8.1  
nodeSets:

- name: master  
count: 3  
config:  
node.master: true  
node.data: false  
node.ingest: false  
node.remote\_cluster\_client: false
- name: ingest-data  
count: 3  
config:  
node.master: false  
node.data: true  
node.ingest: true  
node.attr.data: hot  
podTemplate:  
spec:  
containers:  
- name: elasticsearch  
resources:  
limits:  
memory: 16Gi  
cpu: 4  
affinity:  
nodeAffinity:  
requiredDuringSchedulingIgnoredDuringExecution:  
nodeSelectorTerms:  
- matchExpressions:  
- key: [beta.kubernetes.io/instance-type](http://beta.kubernetes.io/instance-type)  
operator: In  
values:  
- highio  
volumeClaimTemplates:
  - metadata:  
name: elasticsearch-data  
spec:  
accessModes:
    - ReadWriteOnce  
resources:  
requests:  
storage: 20Gi  
storageClassName: mystorage'''

---

<div class="post-metadata">

**Author:** ![Kailas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kailas/32/55376_2.png) [@Kailas](https://discuss.elastic.co/u/Kailas)\
**Post date:** [August 19, 2020, 6:58am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/5 "2020-08-19T06:58:10Z")

</div>

Please check the above yaml file and let me know if there is a fix.

---

<div class="post-metadata">

**Author:** ![charith-elastic](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@charith-elastic](https://discuss.elastic.co/u/charith-elastic)\
**Post date:** [August 19, 2020, 8:00am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/6 "2020-08-19T08:00:38Z")

</div>

There are no obvious problems with the config. I was able to create a cluster successfully using your manifest. What are the outputs of the following commands?

```auto
kubectl get elasticsearch quickstart

```

```auto
kubectl get pods -l elasticsearch.k8s.elastic.co/cluster-name=quickstart

```

```auto
kubectl describe sts quickstart-es-ingest-data

```

```auto
kubectl logs quickstart-es-ingest-data-0

```

---

<div class="post-metadata">

**Author:** ![Kailas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kailas/32/55376_2.png) [@Kailas](https://discuss.elastic.co/u/Kailas)\
**Post date:** [August 20, 2020, 4:49am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/7 "2020-08-20T04:49:32Z")

</div>

> [@charith-elastic](#):
>
> `kubectl logs quickstart-es-ingest-data-0`

Thank you for reply. However, the same error still persists.

I have used Elastic 7.9.0 this time with 2 data nodes.

[root@k8smaster elastic]# kubectl get pods -n ec  
NAME READY STATUS RESTARTS AGE  
quickstart-es-ingest-data-0 0/1 CrashLoopBackOff 7 12m  
quickstart-es-ingest-data-1 0/1 CrashLoopBackOff 7 12m  
quickstart-es-master-0 1/1 Running 0 12m

[root@k8smaster elastic]# kubectl get elasticsearch quickstart  
Error from server (NotFound): [elasticsearches.elasticsearch.k8s.elastic.co](http://elasticsearches.elasticsearch.k8s.elastic.co) "quickstart" not found  
[root@k8smaster elastic]# kubectl get pods -l [elasticsearch.k8s.elastic.co/cluster-name=quickstart](http://elasticsearch.k8s.elastic.co/cluster-name=quickstart)  
No resources found in default namespace.  
[root@k8smaster elastic]# kubectl describe sts quickstart-es-ingest-data  
Error from server (NotFound): statefulsets.apps "quickstart-es-ingest-data" not found  
[root@k8smaster elastic]# kubectl logs quickstart-es-ingest-data-0  
Error from server (NotFound): pods "quickstart-es-ingest-data-0" not found  
[root@k8smaster elastic]#

Error:  
root@k8smaster elastic]# ku logs quickstart-es-ingest-data-0 -n ec  
Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: IllegalStateException[only value lists are allowed in serialized settings];  
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1100)  
at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1073)

---

<div class="post-metadata">

**Author:** ![charith-elastic](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@charith-elastic](https://discuss.elastic.co/u/charith-elastic)\
**Post date:** [August 20, 2020, 7:23am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/8 "2020-08-20T07:23:48Z")

</div>

You have to run the commands against the namespace the resources are in -- which seems to be `ec` in this case. What is the output of:

```auto
kubectl get secret quickstart-es-ingest-data-es-config -n ec -o=go-template='{{ index .data "elasticsearch.yml" | base64decode }}'

```

---

<div class="post-metadata">

**Author:** ![Kailas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kailas/32/55376_2.png) [@Kailas](https://discuss.elastic.co/u/Kailas)\
**Post date:** [August 20, 2020, 7:59am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/9 "2020-08-20T07:59:50Z")

</div>

## Output of the above command is

[root@k8smaster elastic]# kubectl get secret quickstart-es-ingest-data-es-config -n ec -o=go-template='{{ index .data "elasticsearch.yml" | base64decode }}'  
cluster:  
name: quickstart  
discovery:  
seed\_providers: file  
network:  
host: 0.0.0.0  
publish\_host: {POD\_IP} node: attr: data: hot data: true ingest: true master: false name: {POD\_NAME}  
path:  
data: /usr/share/elasticsearch/data  
logs: /usr/share/elasticsearch/logs  
podTemplate:  
spec:  
affinity:  
nodeAffinity:  
requiredDuringSchedulingIgnoredDuringExecution:  
nodeSelectorTerms:  
- matchExpressions:  
- key: [beta.kubernetes.io/instance-type](http://beta.kubernetes.io/instance-type)  
operator: In  
values:  
- highio  
containers:  
- name: elasticsearch  
resources:  
limits:  
cpu: 4  
memory: 16Gi  
xpack:  
license:  
upload:  
types:  
- trial  
- enterprise  
security:  
authc:  
realms:  
file:  
file1:  
order: -100  
native:  
native1:  
order: -99  
reserved\_realm:  
enabled: "false"  
enabled: "true"  
http:  
ssl:  
certificate: /usr/share/elasticsearch/config/http-certs/tls.crt  
certificate\_authorities: /usr/share/elasticsearch/config/http-certs/ca.crt  
enabled: true  
key: /usr/share/elasticsearch/config/http-certs/tls.key  
transport:  
ssl:  
certificate: /usr/share/elasticsearch/config/node-transport-cert/transport.tls.crt  
certificate\_authorities:  
- /usr/share/elasticsearch/config/transport-certs/ca.crt  
- /usr/share/elasticsearch/config/transport-remote-certs/ca.crt  
enabled: "true"  
key: /usr/share/elasticsearch/config/node-transport-cert/transport.tls.key  
verification\_mode: certificate  
[root@k8smaster elastic]#

---

<div class="post-metadata">

**Author:** ![charith-elastic](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@charith-elastic](https://discuss.elastic.co/u/charith-elastic)\
**Post date:** [August 20, 2020, 8:34am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/10 "2020-08-20T08:34:12Z")

</div>

It's very difficult to decipher this because it's not properly formatted (you can use triple backticks (```) as in Markdown to format it). The reason formatting is important is because it is YAML and spacing is significant.

I see a `podTemplate` definition amongst the contents of `elasticsearch.yml`. it shouldn't be there at all. My hunch is that in your Elasticsearch manifest, you have used the wrong spacing -- causing the `podTemplate` definition to become part of the `config` field. This explains the problem because Elasticsearch is seeing an invalid configuration file. Please correct the spacing in your manifest and the problem should go away.

---

<div class="post-metadata">

**Author:** ![Kailas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kailas/32/55376_2.png) [@Kailas](https://discuss.elastic.co/u/Kailas)\
**Post date:** [August 20, 2020, 11:43am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/11 "2020-08-20T11:43:29Z")

</div>

You spotted correctly !! Thanks. I could get the yaml working, however the data pod is in pending state. I am debugging and will reach out to you if I need further help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:10am UTC](https://discuss.elastic.co/t/failed-to-load-settings-from-elasticsearch-yml/245391/12 "2022-11-04T08:10:28Z")

</div>


