java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because the return value of "org.elasticsearch.indices.NodeIndicesStats.getShardStats(org.elasticsearch.index.Index)" is null

Hi

We are getting below in prod

[2023-01-26T23:55:54,079][ERROR][o.e.x.m.c.c.ClusterStatsCollector] [xxx-prd-elkmd1.xxxxxx.com] collector [cluster_stats] failed to collect data

java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because the return value of "org.elasticsearch.indices.NodeIndicesStats.getShardStats(org.elasticsearch.index.Index)" is null

at org.elasticsearch.xpack.core.DataTiersFeatureSet.lambda$calculateStats$7(DataTiersFeatureSet.java:120) ~[?:?]

at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]

at org.elasticsearch.xpack.core.DataTiersFeatureSet.calculateStats(DataTiersFeatureSet.java:119) ~[?:?]

at org.elasticsearch.xpack.core.DataTiersFeatureSet.lambda$usage$0(DataTiersFeatureSet.java:80) ~[?:?]

at java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:178) ~[?:?]

at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:?]

at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1837) ~[?:?]

at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]

at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]

at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?]

at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]

at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?]

at org.elasticsearch.xpack.core.DataTiersFeatureSet.lambda$usage$1(DataTiersFeatureSet.java:80) ~[?:?]

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:117) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:83) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:77) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:32) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.lambda$applyInternal$2(SecurityActionFilter.java:165) ~[?:?]

at org.elasticsearch.action.ActionListener$3.onResponse(ActionListener.java:167) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.ActionListener.completeWith(ActionListener.java:340) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.nodes.TransportNodesAction.newResponseAsync(TransportNodesAction.java:156) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.nodes.TransportNodesAction.newResponse(TransportNodesAction.java:132) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction.lambda$finishHim$1(TransportNodesAction.java:264) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.common.util.concurrent.EsExecutors$DirectExecutorService.execute(EsExecutors.java:215) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction.finishHim(TransportNodesAction.java:264) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction.onOperation(TransportNodesAction.java:249) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction.access$100(TransportNodesAction.java:185) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction$1.handleResponse(TransportNodesAction.java:232) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction$1.handleResponse(TransportNodesAction.java:224) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.TransportService$6.handleResponse(TransportService.java:739) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleResponse(TransportService.java:1280) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.InboundHandler.doHandleResponse(InboundHandler.java:291) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.InboundHandler.handleResponse(InboundHandler.java:275) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.InboundHandler.messageReceived(InboundHandler.java:128) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.InboundHandler.inboundMessage(InboundHandler.java:84) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.TcpTransport.inboundMessage(TcpTransport.java:690) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.InboundPipeline.forwardFragments(InboundPipeline.java:131) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.InboundPipeline.doHandleBytes(InboundPipeline.java:106) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.InboundPipeline.handleBytes(InboundPipeline.java:71) ~[elasticsearch-7.12.0.jar:7.12.0]

at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:63) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[?:?]

at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[?:?]

at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1518) ~[?:?]

at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1267) ~[?:?]

at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1314) ~[?:?]

at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501) ~[?:?]

at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440) ~[?:?]

at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[?:?]

at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[?:?]

at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[?:?]

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) ~[?:?]

at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:615) ~[?:?]

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:578) ~[?:?]

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[?:?]

at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[?:?]

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]

at java.lang.Thread.run(Thread.java:832) [?:?]

{
"error" : {
"root_cause" : [
{
"type" : "null_pointer_exception",
"reason" : "Cannot invoke "java.util.List.stream()" because the return value of "org.elasticsearch.indices.NodeIndicesStats.getShardStats(org.elasticsearch.index.Index)" is null"
}
],
"type" : "null_pointer_exception",
"reason" : "Cannot invoke "java.util.List.stream()" because the return value of "org.elasticsearch.indices.NodeIndicesStats.getShardStats(org.elasticsearch.index.Index)" is null"
},
"status" : 500
}

It looks like this was fixed in 7.14.0 -- Add null check for shard stats to data tier telemetry by dakrone · Pull Request #75185 · elastic/elasticsearch · GitHub.

1 Like

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