NullPointerException in LongComparator.setTopValue
Hi all, I get a NullPointerException using Elasticsearch 7.9.1 with Lucene Core 8.6.2 CentOS 7: "stacktrace": ["org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed", "at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:551) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:309) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:582) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:393) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.search.AbstractSearchAsyncAction.access$100(AbstractSearchAsyncAction.java:68) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:245) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.search.SearchExecutionStatsCollector.onFailure(SearchExecutionStatsCollector.java:73) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:59) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:403) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.transport.TransportService$6.handleException(TransportService.java:638) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1172) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1281) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1255) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:61) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.transport.TransportChannel.sendErrorResponse(TransportChannel.java:56) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:51) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.search.SearchService.lambda$runAsync$0(SearchService.java:414) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:44) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:710) [elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.9.1.jar:7.9.1]", "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]", "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]", "at java.lang.Thread.run(Thread.java:832) [?:?]", "Caused by: org.elasticsearch.ElasticsearchException$1: Cannot invoke \"java.lang.Long.longValue()\" because \"value\" is null", "at org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:644) ~[elasticsearch-7.9.1.jar:7.9.1]", "at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:307) [elasticsearch-7.9.1.jar:7.9.1]", "... 21 more", "Caused by: java.lang.NullPointerException: Cannot invoke \"java.lang.Long.longValue()\" because \"value\" is null", "at org.apache.lucene.search.FieldComparator$LongComparator.setTopValue(FieldComparator.java:392) ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:53:36]", "at org.apache.lucene.search.FieldComparator$LongComparator.setTopValue(FieldComparator.java:348) ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:53:36]", "at org.apache.lucene.search.TopFieldCollector$PagingFieldCollector.(TopFieldCollector.java:210) ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:53:36]", "at org.apache.lucene.search.TopFieldCollector.create(TopFieldCollector.java:484) ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:53:36]", "at org.apache.lucene.search.TopFieldCollector.create(TopFieldCollector.java:450) ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:53:36]", "at org.elasticsearch.search.query.TopDocsCollectorContext$SimpleTopDocsCollectorContext.createCollector(TopDocsCollectorContext.java:217) ~[elastics
Re: NullPointerException in LongComparator.setTopValue
Hi Michael, At first sight, this looks more like an Elasticsearch bug than like a Lucene bug to me. Can you file an issue at https://github.com/elastic/elasticsearch and share the search request than you are running? On Thu, Mar 18, 2021 at 11:52 AM Michael Grafl - SKIDATA < michael.gr...@skidata.com> wrote: > Hi all, > > I get a NullPointerException using Elasticsearch 7.9.1 with Lucene Core > 8.6.2 CentOS 7: > > "stacktrace": > ["org.elasticsearch.action.search.SearchPhaseExecutionException: all shards > failed", > "at > org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:551) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:309) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:582) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:393) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.search.AbstractSearchAsyncAction.access$100(AbstractSearchAsyncAction.java:68) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:245) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.search.SearchExecutionStatsCollector.onFailure(SearchExecutionStatsCollector.java:73) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:59) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:403) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.transport.TransportService$6.handleException(TransportService.java:638) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1172) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1281) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1255) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:61) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.transport.TransportChannel.sendErrorResponse(TransportChannel.java:56) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:51) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.search.SearchService.lambda$runAsync$0(SearchService.java:414) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:44) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:710) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) > [elasticsearch-7.9.1.jar:7.9.1]", > "at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) > [?:?]", > "at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) > [?:?]", > "at java.lang.Thread.run(Thread.java:832) [?:?]", > "Caused by: org.elasticsearch.ElasticsearchException$1: Cannot invoke > \"java.lang.Long.longValue()\" because \"value\" is null", > "at > org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:644) > ~[elasticsearch-7.9.1.jar:7.9.1]", > "at > org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:307) > [elasticsearch-7.9.1.jar:7.9.1]", > "... 21 more", > "Caused by: java.lang.NullPointerException: Cannot invoke > \"java.lang.Long.longValue()\" because \"value\" is null", > "at > org.apache.lucene.search.FieldComparator$LongComparator.setTopValue(FieldComparator.java:392) > ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - > ivera - 2020-08-26 10:53:36]", > "at > org.apache.lucene.search.FieldComparator$LongComparator.setTopValue(FieldComparator.java:348) > ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - > ivera - 2020-08-26 10:53:36]", > "at > org.apache.lucene.search.TopFieldCollector$PagingFieldCollector.(TopFieldCollector.java:210) > ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - > ivera - 2020-08-26 10:53:36]", > "at > org.apache.lucene.search.TopFieldCollector.create(TopFieldCollector.java:48