NullPointerException while PinnedQuery with aggregation

Hi, guys!
I have a kotlin application and Elasticsearch v7.5.2 cluster.
Im trying to execute common search request with Pinned subquery in parallel. Most of my requests were successfully finished, but couple of them ends with search_phase_execution_exception (all shards failed):

Caused by: java.lang.NullPointerException
	at org.apache.lucene.search.DisjunctionMaxScorer.advanceShallow(DisjunctionMaxScorer.java:80) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]
	at org.apache.lucene.search.ReqOptSumScorer.advanceShallow(ReqOptSumScorer.java:274) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]
	at org.apache.lucene.search.ConjunctionScorer.advanceShallow(ConjunctionScorer.java:80) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]
	at org.apache.lucene.search.CappedScoreQuery$1$1.get(CappedScoreQuery.java:127) ~[?:?]
	at org.apache.lucene.search.CappedScoreQuery$1.scorer(CappedScoreQuery.java:152) ~[?:?]
	at org.apache.lucene.search.DisjunctionMaxQuery$DisjunctionMaxWeight.scorer(DisjunctionMaxQuery.java:139) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]
	at org.apache.lucene.search.Weight.bulkScorer(Weight.java:181) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]
	at org.elasticsearch.search.internal.ContextIndexSearcher$1.bulkScorer(ContextIndexSearcher.java:162) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.elasticsearch.search.internal.ContextIndexSearcher.searchInternal(ContextIndexSearcher.java:189) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:173) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:442) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]
	at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:270) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:113) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:335) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:355) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.elasticsearch.search.SearchService.lambda$executeQueryPhase$1(SearchService.java:340) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.elasticsearch.action.ActionListener.lambda$map$2(ActionListener.java:146) ~[elasticsearch-7.5.2.jar:7.5.2]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63) ~[elasticsearch-7.5.2.jar:7.5.2]

In the same time my cluster state is

{
  "cluster_name": "my_cluster",
  "status": "yellow",
  "timed_out": false,
  "number_of_nodes": 1,
  "number_of_data_nodes": 1,
  "active_primary_shards": 75,
  "active_shards": 75,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 64,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 53.956834532374096
}

Im not sure if unassigned shards is the root of my problem, but i know that active_shards_percent_as_number should be 100.
If you need some additional information like my OS facts or query sources, let me know, thanks!

Hi Ilia,
See Pinned Query with Term Aggregation get me null_pointer_exception

1 Like

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