# "Service Unavailable" on aggs query search

**URL:** <https://discuss.elastic.co/t/service-unavailable-on-aggs-query-search/238682>\
**Category:** Elasticsearch\
**Created:** [June 25, 2020, 1:47pm UTC](https://discuss.elastic.co/t/service-unavailable-on-aggs-query-search/238682 "2020-06-25T13:47:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdrmahesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bdrmahesh/32/71165_2.png) [@bdrmahesh](https://discuss.elastic.co/u/bdrmahesh)\
**Post date:** [June 25, 2020, 1:47pm UTC](https://discuss.elastic.co/t/service-unavailable-on-aggs-query-search/238682/1 "2020-06-25T13:47:32Z")

</div>

I have a aggregation query written in nodejs. I have couple of aggregation queries in the node api.  
It happens randomly and only a couple times in a day that I get error

```auto
              Invoke Error {
                        "msg":"Service Unavailable",
                        "path":"/index_name/_search",
                        "query":{"type":"_doc"},
                        "body":"{\"query\":{<aggregation queries>}}",
                         "statusCode":503,
                        "response":"{\"Message\":null}"}

```

Most times it works normally.

I also get timeout error in api. I have timeout of 28s. This also happens sometimes so can't really recreate the error.

Any suggestions?

---

<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:** [July 23, 2020, 1:47pm UTC](https://discuss.elastic.co/t/service-unavailable-on-aggs-query-search/238682/2 "2020-07-23T13:47:53Z")

</div>

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