# Unable to connect to Elasticsearch. Error: Request Timeout after 30000ms

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858>\
**Category:** Kibana\
**Created:** [May 3, 2020, 10:17am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858 "2020-05-03T10:17:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [May 3, 2020, 10:17am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/1 "2020-05-03T10:17:58Z")

</div>

hi,  
I've been trying to simulate a Kibana to Elastic Connection. (As per the [Link](https://discuss.elastic.co/t/warning-migrations-unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/215472) it was related to Kibana OSS, but I tried both Kibana and Kibana-oss, but still no luck.)

> ./bin/kibana --version  
> 7.6.2

cat custom/config/kibana.yml

> ```
> ---
> ################################
> # kibana_build_config_items
> ################################
> 
> server.name: kibana
> server.host: "192.168.56.107"
> elasticsearch.hosts: ["http://192.168.56.103:9200"]
> 
> ```

and Starting using  
` ./bin/kibana -c custom/config/kibana.yml`

```
  log [10:13:13.746] [info][plugins-system] Setting up [21] plugins: [usageCollection,metrics,timelion,apm_oss,uiActions,data,navigation,status_page,share,newsfeed,kibana_legacy,management,dev_tools,inspector,expressions,visualizations,embeddable,dashboard_embeddable_container,home,eui_utils,bfetch]
  log [10:13:13.754] [info][plugins][usageCollection] Setting up plugin
  log [10:13:13.757] [info][metrics][plugins] Setting up plugin
  log [10:13:13.757] [info][plugins][timelion] Setting up plugin
  log [10:13:13.758] [info][apm_oss][plugins] Setting up plugin
  log [10:13:13.758] [info][data][plugins] Setting up plugin
  log [10:13:13.763] [info][plugins][share] Setting up plugin
  log [10:13:13.765] [info][home][plugins] Setting up plugin
  log [10:13:13.770] [info][bfetch][plugins] Setting up plugin
  log [10:13:13.775] [info][savedobjects-service] Waiting until all Elasticsearch nodes are compatible with Kibana before starting saved objects migrations...
  log [10:13:13.803] [info][savedobjects-service] Starting saved objects migrations
  log [10:13:43.803] [warning][savedobjects-service] Unable to connect to Elasticsearch. Error: Request Timeout after 30000ms

```

I can reach the ElasticURL correctly from the Kibana installed location using curl.

> ```
> {
> "name" : "my_elastichost",
> "cluster_name" : "elasticsearch",
> "cluster_uuid" : "_na_",
> "version" : {
> "number" : "7.6.2",
> "build_flavor" : "default",
> "build_type" : "tar",
> "build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
> "build_date" : "2020-03-26T06:34:37.794943Z",
> "build_snapshot" : false,
> "lucene_version" : "8.4.0",
> "minimum_wire_compatibility_version" : "6.8.0",
> "minimum_index_compatibility_version" : "6.0.0-beta1"
> },
> "tagline" : "You Know, for Search"
> }
> 
> ```

Not sure why its so hard to setup a simple elastic/kibana combination ☹

---

<div class="post-metadata">

**Author:** ![Ankita\_Pachauri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_pachauri/32/61469_2.png) [@Ankita\_Pachauri](https://discuss.elastic.co/u/Ankita_Pachauri)\
**Post date:** [May 3, 2020, 5:37pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/2 "2020-05-03T17:37:12Z")

</div>

Can you explain more about it.

---

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [May 3, 2020, 7:15pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/3 "2020-05-03T19:15:37Z")

</div>

Sorry, i thought I put all the details in the OP. The error I'm getting and the configs I'm using etc.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 3, 2020, 9:04pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/4 "2020-05-03T21:04:34Z")

</div>

Hello,

Where did you get that `-c` param for /bin/kibana? I don't remember that ever being available. Kibana should only load settings from the /config/kibana.yml file

---

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [May 5, 2020, 8:19am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/5 "2020-05-05T08:19:32Z")

</div>

Kibana can load from external config using -c  
`https://discuss.elastic.co/t/quick-question-how-to-start-kibana-with-custom-config-file/123247`

---

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [May 5, 2020, 10:08am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/6 "2020-05-05T10:08:11Z")

</div>

Configuration at Elasticsearch.yml is

```auto
# ======================== Elasticsearch Custom Configuration =========================

## Modify this and make it dynamic later##
cluster.name: "my-cluster"
network.host: 0.0.0.0
discovery.seed_hosts: []

## X-Pack settings
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack.html
#
xpack.license.self_generated.type: trial
xpack.security.enabled: true
xpack.monitoring.collection.enabled: true

```

The only error at ElasticSearch end is:

```auto
[2020-05-05T11:03:51,163][WARN][r.suppressed] [myserver] path: /.kibana, params: {index=.kibana}
org.elasticsearch.discovery.MasterNotDiscoveredException: null
	at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$2.onTimeout(TransportMasterNodeAction.java:220) [elasticsearch-7.6.2.jar:7.6.2]
	at org.elasticsearch.cluster.ClusterStateObserver$ContextPreservingListener.onTimeout(ClusterStateObserver.java:325) [elasticsearch-7.6.2.jar:7.6.2]
	at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:252) [elasticsearch-7.6.2.jar:7.6.2]
	at org.elasticsearch.cluster.service.ClusterApplierService$NotifyTimeout.run(ClusterApplierService.java:598) [elasticsearch-7.6.2.jar:7.6.2]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:633) [elasticsearch-7.6.2.jar:7.6.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:830) [?:?]
[2020-05-05T11:03:51,167][WARN][r.suppressed] [myserver] path: /.kibana_task_manager, params: {index=.kibana_task_manager}
org.elasticsearch.discovery.MasterNotDiscoveredException: null
	at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$2.onTimeout(TransportMasterNodeAction.java:220) [elasticsearch-7.6.2.jar:7.6.2]
	at org.elasticsearch.cluster.ClusterStateObserver$ContextPreservingListener.onTimeout(ClusterStateObserver.java:325) [elasticsearch-7.6.2.jar:7.6.2]
	at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:252) [elasticsearch-7.6.2.jar:7.6.2]
	at org.elasticsearch.cluster.service.ClusterApplierService$NotifyTimeout.run(ClusterApplierService.java:598) [elasticsearch-7.6.2.jar:7.6.2]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:633) [elasticsearch-7.6.2.jar:7.6.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:830) [?:?]

```

---

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [May 5, 2020, 11:15am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/7 "2020-05-05T11:15:43Z")

</div>

At last found the problem !!

Put in following setting in elasticsearch.yml and it worked.

```auto
network.host: 0.0.0.0
discovery.type: single-node

```

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 5, 2020, 11:51am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/8 "2020-05-05T11:51:22Z")

</div>

That config setting only works for development version of Kibana (when you run it from source). Changing that to 0.0.0.0 worked because the default kibana.yml looks for elasticsearch on localhost (or 0.0.0.0).

---

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [May 5, 2020, 2:43pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/9 "2020-05-05T14:43:51Z")

</div>

oh. I didn't run from source. I ran from the binary and it worked

I could put `network.host` any value within the network segment and it works. (theoritically it was working before as well). The key setting was `single-node` for development/basic purposes.

---

<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:** [June 2, 2020, 2:43pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-error-request-timeout-after-30000ms/230858/10 "2020-06-02T14:43:52Z")

</div>

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