I've noticed this error today in the logs of our 5.4 cluster when running a scroll query - one that ran with no issues before and is running with no issues after this exception, which I was not able to reproduce.
Has anyone seen this before? Any idea what could be causing it?
[2017-08-29T11:17:29,137][DEBUG][o.e.a.s.TransportSearchScrollAction] [data1-iil-003] [569527] Failed to execute query phase
org.elasticsearch.transport.RemoteTransportException: [data1-iil-003][x.x.x.x:9300][indices:data/read/search[phase/query+fetch/scroll]]
Caused by: java.lang.NullPointerException
at org.elasticsearch.search.DefaultSearchContext.isCancelled(DefaultSearchContext.java:810) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:138) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:294) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:391) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.action.search.SearchTransportService$10.messageReceived(SearchTransportService.java:374) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.action.search.SearchTransportService$10.messageReceived(SearchTransportService.java:371) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.transport.TransportService$7.doRun(TransportService.java:627) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.4.0.jar:5.4.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_92]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92]
[2017-08-29T11:17:29,179][WARN ][r.suppressed ] path: /_search/scroll, params: {scroll=300000ms}
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
at org.elasticsearch.action.search.SearchScrollQueryAndFetchAsyncAction.onPhaseFailure(SearchScrollQueryAndFetchAsyncAction.java:159) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.action.search.SearchScrollQueryAndFetchAsyncAction.access$300(SearchScrollQueryAndFetchAsyncAction.java:42) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.action.search.SearchScrollQueryAndFetchAsyncAction$1.onFailure(SearchScrollQueryAndFetchAsyncAction.java:146) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:51) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1041) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1145) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1123) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.transport.TransportService$7.onFailure(TransportService.java:638) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.onFailure(ThreadContext.java:623) [elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39) [elasticsearch-5.4.0.jar:5.4.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_92]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92]
Caused by: org.elasticsearch.transport.RemoteTransportException: [data1-iil-003][x.x.x.x:9300][indices:data/read/search[phase/query+fetch/scroll]]
Caused by: java.lang.NullPointerException
at org.elasticsearch.search.DefaultSearchContext.isCancelled(DefaultSearchContext.java:810) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:138) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:294) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:391) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.action.search.SearchTransportService$10.messageReceived(SearchTransportService.java:374) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.action.search.SearchTransportService$10.messageReceived(SearchTransportService.java:371) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.transport.TransportService$7.doRun(TransportService.java:627) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638) ~[elasticsearch-5.4.0.jar:5.4.0]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-5.4.0.jar:5.4.0]