Shard failure when scrolling - invalid results, but no error reported

I have been having some problem with a failing test (using the
ElasticsearchIntegrationTest) that was testing scrolling.
It took quite a while to notice that in my response was an indication I was
getting a shard failure (my search response was OK, but the response
included shard failures).
I strongly suspect this is why I am not getting the results I expect from
the scroll (ie no results, totalHits=0)

When I dump the search response, I get a bit of a cryptic (at least for me)
message and I can't figure out what the cause is:
e.g.

{
"_scroll_id" : "c2NhbjswOzE7dG90YWxfaGl0czoxOw==",
"took" : 11,
"timed_out" : false,
"_shards" : {
"total" : 10,
"successful" : 9,
"failed" : 1,
"failures" : [ {
"index" : "logistics",
"shard" : 8,
"status" : 500,
"reason" : "QueryPhaseExecutionException[[logistics][8]:
query[+ConstantScore(cache(_type:quota))
+(groupCompanyId:582D1EE6CDF54510AAA7CC2AA635F31B)
+_all:cancelled*],from[0],size[500]: Query Failed [Failed to execute main
query]]; nested: AssertionError; "
} ]
},
"hits" : {
"total" : 1000,
"max_score" : 0.0,
"hits" : [ ]
}
}

  1. I would have expected this error to manifest itself in the form of an
    exception (java api) rather than having to inspect shard failures manually
    (given the impact on the results).
    I have seen all shards fail, but still no error reported. Is this expected?

  2. How can I get a full stack trace of the error related to the shard
    failure? "nested: AssertionError;" is teasing me with the fact that there
    is more info, but its being kept from me.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/023bdc12-6e6a-4bd2-a357-f8419cb4a403%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

With a bit of cunning use of the debugger, I managed to get the stacktrace
that was lost.
It appears that maybe the ElasticsearchIntegrationTest environment is the
cause...
This looks like a bug?

java.lang.AssertionError
at org.elasticsearch.common.util.BigArrays$LongArrayWrapper.get(BigArrays.
java:200)
at org.elasticsearch.test.cache.recycler.MockBigArrays$LongArrayWrapper.get
(MockBigArrays.java:374)
at org.elasticsearch.common.util.BytesRefHash.get(BytesRefHash.java:66)
at org.elasticsearch.common.util.BytesRefHash.set(BytesRefHash.java:101)
at org.elasticsearch.common.util.BytesRefHash.add(BytesRefHash.java:145)
at org.elasticsearch.search.aggregations.bucket.terms.
StringTermsAggregator$WithOrdinals.collect(StringTermsAggregator.java:299)
at org.elasticsearch.search.aggregations.
AggregationPhase$AggregationsCollector.collect(AggregationPhase.java:164)
at org.elasticsearch.common.lucene.MultiCollector.collect(MultiCollector.
java:60)
at org.apache.lucene.search.Scorer.score(Scorer.java:65)
at org.apache.lucene.search.AssertingScorer.score(AssertingScorer.java:136)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:621)
at org.elasticsearch.search.internal.ContextIndexSearcher.search(
ContextIndexSearcher.java:173)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:491)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:448)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:281)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:269)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:123)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.
java:282)
at org.elasticsearch.search.action.SearchServiceTransportAction.
sendExecuteQuery(SearchServiceTransportAction.java:270)
at org.elasticsearch.action.search.type.
TransportSearchScrollQueryThenFetchAction$AsyncAction.executeQueryPhase(
TransportSearchScrollQueryThenFetchAction.java:200)
at org.elasticsearch.action.search.type.
TransportSearchScrollQueryThenFetchAction$AsyncAction.access$600(
TransportSearchScrollQueryThenFetchAction.java:75)
at org.elasticsearch.action.search.type.
TransportSearchScrollQueryThenFetchAction$AsyncAction$2.run(
TransportSearchScrollQueryThenFetchAction.java:184)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
java:908)
at java.lang.Thread.run(Thread.java:662)

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4ed29d05-f287-44ff-ba83-f690b71fae1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.