# ConnectionTimeout caused by - ReadTimeoutError, master not discovered yet

**URL:** <https://discuss.elastic.co/t/connectiontimeout-caused-by-readtimeouterror-master-not-discovered-yet/207420>\
**Category:** Elasticsearch\
**Created:** [November 11, 2019, 11:07pm UTC](https://discuss.elastic.co/t/connectiontimeout-caused-by-readtimeouterror-master-not-discovered-yet/207420 "2019-11-11T23:07:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dstromberg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dstromberg/32/52956_2.png) [@dstromberg](https://discuss.elastic.co/u/dstromberg)\
**Post date:** [November 11, 2019, 11:07pm UTC](https://discuss.elastic.co/t/connectiontimeout-caused-by-readtimeouterror-master-not-discovered-yet/207420/1 "2019-11-11T23:07:15Z")

</div>

Hi folks.

I'm getting this error in a python3 program trying to talk to elasticsearch:

> elasticsearch.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10))

curl'ing the health status returns:

> $ curl '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'  
> {  
> "error" : {  
> "root\_cause" : [  
> {  
> "type" : "master\_not\_discovered\_exception",  
> "reason" : null  
> }  
> ],  
> "type" : "master\_not\_discovered\_exception",  
> "reason" : null  
> },  
> "status" : 503  
> }

And that might be related to this repeating error in my elasticsearch.log:

> [2019-11-08T11:33:24,176][WARN][o.e.c.c.ClusterFormationFailureHelper] [centos-7-grok3-installer] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [127.0.0.1, [::1]] to bootstrap a cluster: have discovered [{centos-7-grok3-installer}{-mDmAKOvT7-q0RNwIUmY5g}{gMxgAO2HRnGhEEDbvC1M9g}{127.0.0.1}{127.0.0.1:9300}{dim}{ml.machine\_memory=2959122432, xpack.installed=true, ml.max\_open\_jobs=20}]; discovery will continue using from hosts providers and [{centos-7-grok3-installer}{-mDmAKOvT7-q0RNwIUmY5g}{gMxgAO2HRnGhEEDbvC1M9g}{127.0.0.1}{127.0.0.1:9300}{dim}{ml.machine\_memory=2959122432, xpack.installed=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0

I'm also getting:

> java.lang.UnsupportedOperationException: sun.misc.Unsafe unavailable

...which appears to be a deprecated API as of Java 11.

I've googled for hours about this, and I found some solutions, but apparently I have a slightly different problem from those.

I'm on CentOS 7.7, and I'm using elasticsearch-7.3.2-x86\_64.rpm

I believe I'm using this version of Java:

> $ /usr/share/elasticsearch/jdk/bin/java -version  
> openjdk version "12.0.2" 2019-07-16  
> OpenJDK Runtime Environment (build 12.0.2+10)  
> OpenJDK 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)

My /etc/elasticsearch/elasticsearch.yml looks like:

> $ grep -v '^#' /etc/elasticsearch/elasticsearch.yml  
> path.data: /var/lib/elasticsearch  
> path.logs: /var/log/elasticsearch  
> discovery.zen.ping.unicast.hosts: ["127.0.0.1", "[::1]"]

BTW, I'm in a single-host "cluster" for now, but eventually this will become multi-host.

Please help? I'm kinda stuck.

Thanks!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [November 12, 2019, 6:32pm UTC](https://discuss.elastic.co/t/connectiontimeout-caused-by-readtimeouterror-master-not-discovered-yet/207420/3 "2019-11-12T18:32:04Z")

</div>

> [@dstromberg](#):
>
> `this node must discover master-eligible nodes [127.0.0.1, [::1]]`

This indicates you have also set

```auto
cluster.initial_master_nodes: ["127.0.0.1", "[::1]"]

```

although I do not understand why this is not shown in the `elasticsearch.yml` you quoted. This is an incorrect value for this setting since it should contain node name(s) instead. Try:

```auto
cluster.initial_master_nodes: "centos-7-grok3-installer"

```

You can remove this setting after the cluster starts for the first time.

---

<div class="post-metadata">

**Author:** ![dstromberg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dstromberg/32/52956_2.png) [@dstromberg](https://discuss.elastic.co/u/dstromberg)\
**Post date:** [November 12, 2019, 7:38pm UTC](https://discuss.elastic.co/t/connectiontimeout-caused-by-readtimeouterror-master-not-discovered-yet/207420/4 "2019-11-12T19:38:37Z")

</div>

That's working.

I thought I tried that, but perhaps not.

I actually tried a lot of things - too many to list.

Thanks.

---

<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:** [December 10, 2019, 7:38pm UTC](https://discuss.elastic.co/t/connectiontimeout-caused-by-readtimeouterror-master-not-discovered-yet/207420/5 "2019-12-10T19:38:38Z")

</div>

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