# Cluster state has not been recovered yet, cannot write to the \[null\] index

**URL:** <https://discuss.elastic.co/t/cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index/315945>\
**Category:** Elasticsearch\
**Created:** [October 6, 2022, 9:21am UTC](https://discuss.elastic.co/t/cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index/315945 "2022-10-06T09:21:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iLucas.Bechlte.exe](https://avatars.discourse-cdn.com/v4/letter/i/3ab097/32.png) [@iLucas.Bechlte.exe](https://discuss.elastic.co/u/iLucas.Bechlte.exe)\
**Post date:** [October 6, 2022, 9:21am UTC](https://discuss.elastic.co/t/cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index/315945/1 "2022-10-06T09:21:07Z")

</div>

Hi,

i try to run an elastic stack with the localhost as the only node. I followed the official installation guide, but when I get to the running check it shows me this error after entering the password:  
`{"error":{"root_cause":[{"type":"status_exception","reason":"Cluster state has not been recovered yet, cannot write to the [null] index"}],"type":"authentication_processing_error","reason":"failed to promote the auto-configured elastic password hash","caused_by":{"type":"status_exception","reason":"Cluster state has not been recovered yet, cannot write to the [null] index"}},"status":503}`

The the logs show this:  
`[2022-10-06T11:16:16,265][WARN][o.e.c.c.ClusterFormationFailureHelper] [localhost.localdomain] master not discovered yet, this node has not previously joined a bootstrapped cluster, and this node must discover master-eligible nodes [localhost] to bootstrap a cluster: have discovered [{localhost.localdomain}{f7D__SY7TkOyXBOSpZo5jg}{Z4Bg4ot7RUymAYGLqaC1WQ}{localhost.localdomain}{localhost}{127.0.0.1:9300}{cdfhilmrstw}]; discovery will continue using [127.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304, 127.0.0.1:9305, [::1]:9301, [::1]:9302, [::1]:9303, [::1]:9304, [::1]:9305] from hosts providers and [{localhost.localdomain}{f7D__SY7TkOyXBOSpZo5jg}{Z4Bg4ot7RUymAYGLqaC1WQ}{localhost.localdomain}{localhost}{127.0.0.1:9300}{cdfhilmrstw}] from last-known cluster state; node term 0, last-accepted version 0 in term 0`

My .yml file:

```auto
network.host: localhost
http.port: 9200
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
cluster.initial_master_nodes: ["localhost"]
http.host: 0.0.0.0

```

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![iLucas.Bechlte.exe](https://avatars.discourse-cdn.com/v4/letter/i/3ab097/32.png) [@iLucas.Bechlte.exe](https://discuss.elastic.co/u/iLucas.Bechlte.exe)\
**Post date:** [October 7, 2022, 1:00pm UTC](https://discuss.elastic.co/t/cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index/315945/2 "2022-10-07T13:00:24Z")

</div>

I found a solution: Giving the system a dns entry and a hostname worked for me.

---

<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, 1:00pm UTC](https://discuss.elastic.co/t/cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index/315945/3 "2022-11-04T13:00:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
