# Exception from one shard - ArrayIndexOutOfBoundsException

**URL:** <https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608>\
**Category:** Elasticsearch\
**Created:** [October 16, 2011, 4:55pm UTC](https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608 "2011-10-16T16:55:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Green](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryan_green/32/3028_2.png) [@Bryan\_Green](https://discuss.elastic.co/u/Bryan_Green)\
**Post date:** [October 16, 2011, 4:55pm UTC](https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608/1 "2011-10-16T16:55:20Z")

</div>

Hi folks,

Here is the query I run against this url  
'system,library,serc/statustype/\_search'  
{  
"from": 0,  
"size": 999,  
"sort": {  
"order\_no": {  
"order": "asc"  
}  
},  
"filter": {  
"bool": {  
"must": [  
{  
"or": [  
{  
"term": {  
"value": "claimed"  
}  
},  
{  
"term": {  
"closed\_ind": "n"  
}  
}  
]  
},  
{  
"term": {  
"item\_input\_ind": "y"  
}  
}  
]  
}  
}  
}

Here is the exception trace I receive.

[2011-10-16 11:43:29,729][DEBUG][action.search.type] [Puff Adder]  
[serc][1], node[Elt9nySKTtSglTXz9oSYcw], [P], s[STARTED]: Failed to execute  
[org.elasticsearch.action.search.SearchRequest@79f3878b]  
org.elasticsearch.search.query.QueryPhaseExecutionException: [serc][1]:  
query[ConstantScore(_:_)],from[0],size[999],sort[\<custom:"order\_no":  
org.elasticsearch.index.field.data.longs.LongFieldDataType$1@6e37715c\>]:  
Query Failed [Failed to execute main query]  
at  
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:221)  
at  
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown  
Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown  
Source)  
at java.lang.Thread.run(Unknown Source)  
Caused by: java.lang.ArrayIndexOutOfBoundsException

I am running 0.17.8. Anybody know what this is? Thought I saw some  
correspondence about this exception last few weeks.

I don't think I even have a result in this particular index for the query to  
pull back. I've also had issues with the "order\_no" custom sort but after  
removing the sorting I still get this same error. Error does not happen  
removing the serc index.

Here's some of the details:  
Query length: 2.17605ms  
took 1 timed\_out false \_shards total 6 successful 5 failed 1 hits total  
5 max\_score false

And my setup...  
gateway.type: local  
gateway.recover\_after\_nodes: 1  
gateway.recover\_after\_time: 5m  
gateway.expected\_nodes: 1

index.gateway.snapshot\_interval : 4s  
index.gateway.snapshot\_on\_close: true  
index.store.type: fs  
index.number\_of\_shards : 2  
index.number\_of\_replicas : 0

Open to any suggestions. Thank you for your time.  
-Bryan Green

---

<div class="post-metadata">

**Author:** ![Bryan\_Green](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryan_green/32/3028_2.png) [@Bryan\_Green](https://discuss.elastic.co/u/Bryan_Green)\
**Post date:** [October 16, 2011, 7:29pm UTC](https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608/2 "2011-10-16T19:29:45Z")

</div>

I went ahead and dumped my indexes and brought all of the data back in and  
things seem to be working now.

Any ideas what could have happened here or prevention measures for the  
future?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 16, 2011, 8:07pm UTC](https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608/3 "2011-10-16T20:07:31Z")

</div>

This smells like this bug:  
[Array out-of-bounds exception with bool filter · Issue #1400 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1400), fixed in 0.17  
branch and master. Will probably release 0.17.9 sometime this week.

On Sun, Oct 16, 2011 at 9:29 PM, Bryan Green [bryogreen@gmail.com](mailto:bryogreen@gmail.com) wrote:

> I went ahead and dumped my indexes and brought all of the data back in and  
> things seem to be working now.
> 
> Any ideas what could have happened here or prevention measures for the  
> future?

---

<div class="post-metadata">

**Author:** ![Bryan\_Green](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryan_green/32/3028_2.png) [@Bryan\_Green](https://discuss.elastic.co/u/Bryan_Green)\
**Post date:** [October 16, 2011, 8:38pm UTC](https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608/4 "2011-10-16T20:38:36Z")

</div>

Interesting, I should have tried w/o the bool filter.

I went back to the old indexes (directory backup) and the failure went away  
went I removed the 'bool' filter. I think 1400 is the rat.

Thank you.

FYI  
There is an error in the json in the guide for the \_cache version of "or"  
here:  
[http://www.elasticsearch.org/guide/reference/query-dsl/or-filter.html](http://www.elasticsearch.org/guide/reference/query-dsl/or-filter.html)

Parse error on line 9:  
... "or": "filters": [  
-----------------------^  
Expecting '}', ',', ']'

---

<div class="post-metadata">

**Author:** ![Kenneth\_Loafman\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kenneth_loafman_2/32/2224_2.png) [@Kenneth\_Loafman\_2](https://discuss.elastic.co/u/Kenneth_Loafman_2)\
**Post date:** [October 16, 2011, 9:16pm UTC](https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608/5 "2011-10-16T21:16:20Z")

</div>

When was this fixed in master? We started seeing this too, from the Friday  
morning master.

...Ken

On Sun, Oct 16, 2011 at 3:38 PM, Bryan Green [bryogreen@gmail.com](mailto:bryogreen@gmail.com) wrote:

> Interesting, I should have tried w/o the bool filter.
> 
> I went back to the old indexes (directory backup) and the failure went away  
> went I removed the 'bool' filter. I think 1400 is the rat.
> 
> Thank you.
> 
> FYI  
> There is an error in the json in the guide for the \_cache version of "or"  
> here:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/or-filter.html)
> 
> Parse error on line 9:  
> ... "or": "filters": [  
> -----------------------^  
> Expecting '}', ',', ']'

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 16, 2011, 9:22pm UTC](https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608/6 "2011-10-16T21:22:11Z")

</div>

It was fixed on Saturday, so you don't have it if you built master on  
friday...

On Sun, Oct 16, 2011 at 11:16 PM, Kenneth Loafman [kenneth@loafman.com](mailto:kenneth@loafman.com)wrote:

> When was this fixed in master? We started seeing this too, from the Friday  
> morning master.
> 
> ...Ken
> 
> On Sun, Oct 16, 2011 at 3:38 PM, Bryan Green [bryogreen@gmail.com](mailto:bryogreen@gmail.com) wrote:
> 
> > Interesting, I should have tried w/o the bool filter.
> > 
> > I went back to the old indexes (directory backup) and the failure went  
> > away went I removed the 'bool' filter. I think 1400 is the rat.
> > 
> > Thank you.
> > 
> > FYI  
> > There is an error in the json in the guide for the \_cache version of "or"  
> > here:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/or-filter.html)
> > 
> > Parse error on line 9:  
> > ... "or": "filters": [  
> > -----------------------^  
> > Expecting '}', ',', ']'

---

<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 6, 2017, 3:51am UTC](https://discuss.elastic.co/t/exception-from-one-shard-arrayindexoutofboundsexception/5608/7 "2017-07-06T03:51:49Z")

</div>


