Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_cat/plugins threw NullPointerException #45321

Closed
shoulian-zhao opened this issue Aug 8, 2019 · 2 comments
Closed

_cat/plugins threw NullPointerException #45321

shoulian-zhao opened this issue Aug 8, 2019 · 2 comments
Labels
>bug :Data Management/CAT APIs Text APIs behind /_cat

Comments

@shoulian-zhao
Copy link

Elasticsearch version : 6.7.0

Plugins installed: [
{"analysis-icu","version":"6.7.0"},
{"analysis-ik","version":"6.7.0-rc1"},
{"analysis-kuromoji","version":"6.7.0"},
{"analysis-phonetic","version":"6.7.0"},
{"analysis-pinyin","version":"6.7.0"},
{"analysis-smartcn","version":"6.7.0"},
{"elasticsearch-repository-oss","version":"6.7.0"},
{"ingest-attachment","version":"6.7.0"},
{"mapper-murmur3","version":"6.7.0"},
{"mapper-size","version":"6.7.0"},
{"repository-hdfs","version":"6.7.0"}]

JVM version : OpenJDK 64-Bit Server VM (11.0.3-AJDK+26-Alibaba)

OS version : Linux 3.10.0-327.ali2010.rc6.alios7.x86_64 # x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
Sometimes there is NullPointerException error when _cat/plugins was executed and according to class org/elasticsearch/rest/action/cat/RestPluginsAction.java, this may happen when ClusterStateResponse state or NodesInfoResponse nodesInfo can't be retrieved.

Looking at the code it seems that a node present in the ClusterStateResponse can be missing in the NodesInfoResponse since they are retrieved in order (first the cluster state then the nodes infos). It's not really clear to me why we need to retrieve the cluster state since we have all the infos that we need in the NodesInfoResponse response. I guess we could remove the cluster state entirely or protect against missing nodes in the nodes info response in order to avoid the NPE.

But it's expected to be handled more properly instead of throwing NullPointerException.

Provide logs (if relevant):

[2019-07-17T18:04:38,301][WARN ][r.suppressed             ] [nodeName] path: /_cat/plugins, params: {format=json}
java.lang.NullPointerException: null
	at org.elasticsearch.rest.action.cat.RestPluginsAction.buildTable(RestPluginsAction.java:99) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.rest.action.cat.RestPluginsAction.access$000(RestPluginsAction.java:41) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.rest.action.cat.RestPluginsAction$1$1.buildResponse(RestPluginsAction.java:72) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.rest.action.cat.RestPluginsAction$1$1.buildResponse(RestPluginsAction.java:69) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.rest.action.RestResponseListener.processResponse(RestResponseListener.java:37) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.rest.action.RestActionListener.onResponse(RestActionListener.java:47) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:85) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:81) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:43) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction.finishHim(TransportNodesAction.java:251) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction.onOperation(TransportNodesAction.java:228) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction.access$100(TransportNodesAction.java:151) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction$1.handleResponse(TransportNodesAction.java:205) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.action.support.nodes.TransportNodesAction$AsyncAction$1.handleResponse(TransportNodesAction.java:195) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleResponse(TransportService.java:1098) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.transport.TcpTransport$1.doRun(TcpTransport.java:985) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.common.util.concurrent.EsExecutors$DirectExecutorService.execute(EsExecutors.java:192) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.transport.TcpTransport.handleResponse(TcpTransport.java:977) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:952) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.transport.TcpTransport.inboundMessage(TcpTransport.java:763) [elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:53) [transport-netty4-client-6.7.0.jar:6.7.0]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323) [netty-codec-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297) [netty-codec-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241) [netty-handler-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1436) [netty-handler-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1203) [netty-handler-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1247) [netty-handler-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) [netty-codec-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) [netty-codec-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) [netty-codec-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:656) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:556) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:510) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:470) [netty-transport-4.1.32.Final.jar:4.1.32.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909) [netty-common-4.1.32.Final.jar:4.1.32.Final]
	at java.lang.Thread.run(Thread.java:834) [?:?]
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

wangkhc added a commit to wangkhc/elasticsearch that referenced this issue Feb 21, 2020
dakrone pushed a commit that referenced this issue Feb 24, 2020
Relates #45321

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
dakrone pushed a commit to dakrone/elasticsearch that referenced this issue Feb 24, 2020
Relates elastic#45321

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
dakrone pushed a commit to dakrone/elasticsearch that referenced this issue Feb 24, 2020
Relates elastic#45321

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@dakrone
Copy link
Member

dakrone commented Feb 24, 2020

Should be resolved by #52620

@dakrone dakrone closed this as completed Feb 24, 2020
dakrone added a commit that referenced this issue Feb 24, 2020
Relates #45321

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Kaihong.Wang <kyra.wkh@alibaba-inc.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
dakrone added a commit that referenced this issue Feb 24, 2020
Relates #45321

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Kaihong.Wang <kyra.wkh@alibaba-inc.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/CAT APIs Text APIs behind /_cat
Projects
None yet
Development

No branches or pull requests

3 participants