# 120s Timeout on Elasticsearch Queries via Kibana

**URL:** <https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007>\
**Category:** Kibana\
**Created:** [September 18, 2019, 12:52pm UTC](https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007 "2019-09-18T12:52:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [September 18, 2019, 12:52pm UTC](https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007/1 "2019-09-18T12:52:52Z")

</div>

I have two clusters (ES 7.3.1, bundled OpenJDK 12) that are hosted by an internal team here at my org. Each cluster has 6 data nodes, three master nodes, and one cluster has two client nodes that perform searches against both clusters simultaneously.

We are consistently hitting a 2 minute timeout on all queries ran through Kibana that is showing up as a `502 Bad Gateway`, the Kibana logs show a `socket hang up` at the same time.

The team hosting these clusters is now saying that the two-minute timeout is due to a setting (unexposed prior to [7.4](https://www.elastic.co/guide/en/kibana/master/settings.html#settings)) named `server.keepalivetimeout` seen in the code [here](https://github.com/elastic/kibana/blob/7.3/src/core/server/http/http_tools.ts#L86).

The issue is: I'd expect a timeout in Kibana to be handled more gracefully than being masked in the UI as a `502 gateway timeout`, and I'm pretty sure that in the past I've successfully ran \>2minute queries on older-versioned clusters.

Can anyone provide any clarification on whether I should be expecting to hit a hardcoded timeout at exactly 2 minutes?

Edit: we've made some modifications to the cluster and now the error at 2 minutes is showing up as:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/1/710b77653496498ec1f94fed72c33deb30531bb6.png)

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 18, 2019, 3:26pm UTC](https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007/2 "2019-09-18T15:26:35Z")

</div>

Hey @seth.yes,

Hmm, I'm just as surprised as you are about the `502 gateway timeout` error. Do you happen to have a proxy setup in-between Kibana and Elasticsearch?

When did these errors start happening? Was this following an upgrade, was it always this way, or did it just start happening one day for no apparent reason?

---

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [September 18, 2019, 4:43pm UTC](https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007/3 "2019-09-18T16:43:45Z")

</div>

Hi @Larry_Gregory , yes we do have a proxy setup between Elasticsearch and Kibana. The supporting team believes the timeout is occurring natively to Kibana.

I just want to verify that we should typically be able to run \>2m queries in Kibana 7.3, is that correct?

This is a new cluster deployed on 7.3, \>2m queries have never worked in this new cluster.

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 18, 2019, 4:50pm UTC](https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007/4 "2019-09-18T16:50:34Z")

</div>

I was able to confirm that your operations folks are correct -- the 2 minute timeout is a hard limit in version 7.3, but 7.4 and beyond can configure this via `server.socketTimeout` and `server.keepAliveTimeout`

---

<div class="post-metadata">

**Author:** ![wavezb](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@wavezb](https://discuss.elastic.co/u/wavezb)\
**Post date:** [September 18, 2019, 5:04pm UTC](https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007/5 "2019-09-18T17:04:18Z")

</div>

@Larry_Gregory thanks for the conformation. Looks like the latest downloadble version is still 7.3.2 as shown in [https://www.elastic.co/downloads/kibana](https://www.elastic.co/downloads/kibana). When 7.4 will be open to download? We're looking forward to trying it out as soon as possible.

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 18, 2019, 5:28pm UTC](https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007/6 "2019-09-18T17:28:00Z")

</div>

We don't have a fixed release date, but we're working hard on making it available as soon as possible.

---

<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:** [October 16, 2019, 5:28pm UTC](https://discuss.elastic.co/t/120s-timeout-on-elasticsearch-queries-via-kibana/200007/7 "2019-10-16T17:28:01Z")

</div>

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