# Node not discovering master node properly, "Cluster state has not been recovered yet, cannot write to the \[null\] index" error \[503\]

**URL:** <https://discuss.elastic.co/t/node-not-discovering-master-node-properly-cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index-error-503/303692>\
**Category:** Elasticsearch\
**Created:** [May 2, 2022, 1:09am UTC](https://discuss.elastic.co/t/node-not-discovering-master-node-properly-cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index-error-503/303692 "2022-05-02T01:09:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dheist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dheist/32/104602_2.png) [@dheist](https://discuss.elastic.co/u/dheist)\
**Post date:** [May 2, 2022, 1:09am UTC](https://discuss.elastic.co/t/node-not-discovering-master-node-properly-cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index-error-503/303692/1 "2022-05-02T01:09:38Z")

</div>

Hello, I have 2 servers in 2 different locations I am trying to make into a cluster. Both are running Elasticsearch v8.1.3.

I have the master server, which is configured like this:

```auto
cluster.name: yyz-news-prod
node.name: node-yyz-1
cluster.initial_master_nodes: ["node-yyz-1"]
discovery.seed_hosts:
   - xx.xx.xxx.x
   - yy.yyy.yyy.yy

xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
http.host: [_local_, _site_]

```

And then the second server:

```auto
cluster.name: yyz-news-prod
node.name: node-yyz-2
cluster.initial_master_nodes: ["node-yyz-1"]
discovery.seed_hosts:
   - xx.xx.xxx.x
   - yy.yyy.yyy.yy

xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
http.host: [_local_, _site_]

```

I started with a fresh install for both servers, launched the master server first, then launched the second slave server. However when I `curl --insecure https://localhost:9200/_cluster/health?pretty` on my master server I see only 1 nodes connected:

```auto
"cluster_name" : "yyz-news-prod",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 2,
  "active_shards" : 2,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0

```

When I do the same on the slave server with the autogenerated slave password for the `elastic` user I get the following 503 error:

```auto
{
  "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
}

```

I don't know why my slave node cannot connect to and find my master node? They are both portforwarded on `9200` and `9300` so I don't think it's a networking issue. Any suggestions?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 2, 2022, 7:45am UTC](https://discuss.elastic.co/t/node-not-discovering-master-node-properly-cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index-error-503/303692/2 "2022-05-02T07:45:00Z")

</div>

Can you take a look at the logs on the server side, they should be more helpful, than that error message returned to the client.

Thanks!

---

<div class="post-metadata">

**Author:** ![dheist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dheist/32/104602_2.png) [@dheist](https://discuss.elastic.co/u/dheist)\
**Post date:** [May 2, 2022, 5:42pm UTC](https://discuss.elastic.co/t/node-not-discovering-master-node-properly-cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index-error-503/303692/3 "2022-05-02T17:42:10Z")

</div>

Hello, thank you for the response and sorry for the late reply.

The output of the `/var/log/elasticsearch/my-cluster-name.log` seems to be repeating the following line until the client disconnects from the master server:

```auto
[2022-05-02T01:32:11,627][WARN][o.e.x.c.s.t.n.SecurityNetty4Transport] [node-yyz-1] client did not trust this server's certificate, closing connection Netty4TcpChannel{localAddress=/10.0.0.207:9300, remoteAddress=/yy.yyy.yyy.yy:58074, profile=default}

```

I did not configure the certificates of either node, I just installed them via the apt package manager and they auto configured the security settings.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [May 3, 2022, 12:32am UTC](https://discuss.elastic.co/t/node-not-discovering-master-node-properly-cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index-error-503/303692/4 "2022-05-03T00:32:29Z")

</div>

See: **Reconfigure a node to join an existing cluster**

> **[Install Elasticsearch with Debian Package | Elasticsearch Guide \[8.1\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html#_reconfigure_a_node_to_join_an_existing_cluster)**

---

<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:** [May 31, 2022, 12:33am UTC](https://discuss.elastic.co/t/node-not-discovering-master-node-properly-cluster-state-has-not-been-recovered-yet-cannot-write-to-the-null-index-error-503/303692/5 "2022-05-31T00:33:16Z")

</div>

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