# Watcher is throwing timeout\_exception

**URL:** https://discuss.elastic.co/t/watcher-is-throwing-timeout-exception/278514
**Category:** Kibana
**Tags:** elastic-stack-monitoring, elastic-stack-alerting
**Created:** [July 13, 2021, 9:30am UTC](https://discuss.elastic.co/t/watcher-is-throwing-timeout-exception/278514 "2021-07-13T09:30:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JF\_LTQ](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JF\_LTQ](https://discuss.elastic.co/u/JF_LTQ)
#### Post date: [July 13, 2021, 9:30am UTC](https://discuss.elastic.co/t/watcher-is-throwing-timeout-exception/278514/1 "2021-07-13T09:30:54Z")

</div>

Hello,

We've been having some issues with watchers throwing timeout exceptions:

```auto
"result": {
    "execution_time": "2021-07-13T07:45:00.144Z",
    "execution_duration": 60004,
    "input": {
      "type": "search",
      "status": "failure",
      "error": {
        "root_cause": [
          {
            "type": "timeout_exception",
            "reason": "java.util.concurrent.TimeoutException: Timeout waiting for task."
          }
        ],
        "type": "timeout_exception",
        "reason": "java.util.concurrent.TimeoutException: Timeout waiting for task.",
        "caused_by": {
          "type": "timeout_exception",
          "reason": "Timeout waiting for task."
        }

```

This event seems to be completely random, sometimes it happens multiple times a day, sometimes it goes a few days without throwing this error.

One of the things I tried was changing these values in the elasticsearch.yml file:

> xpack.http.default\_connection\_timeout from `120s` to `240s`

> xpack.http.default\_read\_timeout from `120s` to `240s`

Still, it didn't work. Ideally we could maybe increase the `execution_duration` parameter ? If this is possible how can we do it ? I've been searching since yesterday but I haven't found anything useful.

Can anyone please assist ?

Thank you.

---

<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: [July 13, 2021, 10:18am UTC](https://discuss.elastic.co/t/watcher-is-throwing-timeout-exception/278514/2 "2021-07-13T10:18:03Z")

</div>

the `search` input is not using the http timeouts. There is a dedicated timeout parameter, see [Watcher search input | Elasticsearch Guide [7.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/input-search.html)

do you know why your searches take so much time? Maybe solving that would be better than increasing a timeout.

---

<div class="post-metadata">

### Author: ![JF\_LTQ](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JF\_LTQ](https://discuss.elastic.co/u/JF_LTQ)
#### Post date: [July 13, 2021, 10:41am UTC](https://discuss.elastic.co/t/watcher-is-throwing-timeout-exception/278514/3 "2021-07-13T10:41:49Z")

</div>

Hey,

Thanks a lot for the reply, seems to be exactly what I need, although I'm not very experienced with elastic, could you assist me in changing the timeout parameter for all watchers?  
Regarding your suggestion, I'll certainly be looking into the issue of why they are taking so long (most of them are simple queries as well), but for now I need a sort of "workaround" as we depend on these watchers for production issues.

Thank you a lot.

---

<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: [August 10, 2021, 10:41am UTC](https://discuss.elastic.co/t/watcher-is-throwing-timeout-exception/278514/4 "2021-08-10T10:41:53Z")

</div>

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