# Canvas - Unexpected error from Elasticsearch: \[illegal\_argument\_exception\] Illegal Capacity: -2

**URL:** <https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [October 17, 2019, 11:48am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042 "2019-10-17T11:48:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdulsofts](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@abdulsofts](https://discuss.elastic.co/u/abdulsofts)\
**Post date:** [October 17, 2019, 11:48am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/1 "2019-10-17T11:48:27Z")

</div>

Hi,

This is w.r.t an error observed in Canvas dashboard containing a elsql. We are getting below error:  
Unexpected error from Elasticsearch: [illegal\_argument\_exception] Illegal Capacity: -2  
Please note that the index mentioned in the elsql has data in it.

**Query is:**  
SELECT status,count(_) as CNT FROM "prd-gst-bg-jobs_"  
where created\_ts \> TODAY() and job\_type\_id NOT IN (16,27) group by status

**Error is:**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/c/2c8152731e6353eeb2d9c9e2d585d9d6030b4176.png)

---

<div class="post-metadata">

**Author:** ![abdulsofts](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@abdulsofts](https://discuss.elastic.co/u/abdulsofts)\
**Post date:** [October 18, 2019, 5:34am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/2 "2019-10-18T05:34:59Z")

</div>

Hi,

Any help would be appreciable.

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [October 18, 2019, 2:49pm UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/3 "2019-10-18T14:49:47Z")

</div>

@abdulsofts

- What ES version is this?
- Also, if you run the same query outside Canvas (using the [REST API](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/sql-rest-overview.html) is one example), I am assuming you get the same error, but do you also get a more complete error message in Elasticsearch logs? (I'm interested in the stack trace especially)
- `prd-gst-bg-jobs` is an alias or an index?

---

<div class="post-metadata">

**Author:** ![abdulsofts](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@abdulsofts](https://discuss.elastic.co/u/abdulsofts)\
**Post date:** [October 23, 2019, 10:24am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/4 "2019-10-23T10:24:19Z")

</div>

Hi Andrei Stefan,

Thank you for your response.

ES version is 7.2.  
I think there are no related logs for this. Anyways, I will check again and post the logs if I find any.  
prd-gst-bg-jobs is the alias of index with which the query was working earlier and this issue was observed recently.

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [October 23, 2019, 10:43am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/5 "2019-10-23T10:43:01Z")

</div>

@abdulsofts can you be more specific on the version of ES? There isn't one single 7.2 version.

Also, a [similar looking bug](https://github.com/elastic/elasticsearch/pull/43878) has been fixed for 7.2.2 version. So, it's important to know the exact version. If you are using a version earlier than 7.2.2, can you upgrade and test this again? Thanks.

---

<div class="post-metadata">

**Author:** ![abdulsofts](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@abdulsofts](https://discuss.elastic.co/u/abdulsofts)\
**Post date:** [October 23, 2019, 11:20am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/6 "2019-10-23T11:20:58Z")

</div>

Hi,

Our elastic search version is 7.2.0.

{  
"name" : "\<host\_name\>",  
"cluster\_name" : "logging-prod",  
"cluster\_uuid" : "\<cluster\_uuid\>",  
"version" : {  
"number" : "7.2.0",  
"build\_flavor" : "default",  
"build\_type" : "deb",  
"build\_hash" : "508c38a",  
"build\_date" : "2019-06-20T15:54:18.811730Z",  
"build\_snapshot" : false,  
"lucene\_version" : "8.0.0",  
"minimum\_wire\_compatibility\_version" : "6.8.0",  
"minimum\_index\_compatibility\_version" : "6.0.0-beta1"  
},  
"tagline" : "You Know, for Search"  
}

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [October 23, 2019, 11:31am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/7 "2019-10-23T11:31:57Z")

</div>

@abdulsofts then I recommend upgrading to at least version 7.2.2 as there are high changes the bug is fixed there.

---

<div class="post-metadata">

**Author:** ![abdulsofts](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@abdulsofts](https://discuss.elastic.co/u/abdulsofts)\
**Post date:** [October 23, 2019, 11:53am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/8 "2019-10-23T11:53:38Z")

</div>

Thank you so much for your inputs.

---

<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:** [November 20, 2019, 11:53am UTC](https://discuss.elastic.co/t/canvas-unexpected-error-from-elasticsearch-illegal-argument-exception-illegal-capacity-2/204042/9 "2019-11-20T11:53:40Z")

</div>

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