Issue with transport client and sniffing nodes

Elasticsearch versio 6.2.4

I have few issues, most likely related.

  1. If I enable sniffing Transport client, it doesn't see any nodes and trying to use it, in specific example, getting all indices from cluster, results in error:
    NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{IK6R6eFjTk-wLEbJXIBE4A}{localhost}{127.0.0.1:9300}] ] at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:347)

But, when I remove sniffing from settings, then I can see my client nodeServices.nodes list has my node.
When analyzing client in debugger, I can see that there is an issue in client.injector "Method threw 'java.lang.StackOverflowError' exception. Cannot evaluate org.elasticsearch.common.inject.InjectorImpl.toString()", but that doesn't stop client of creating new index when I tried that.
Not sure if this error is what causes issue number 2.

  1. Because if above, I commented out sniffing settings, just to see how far I will get, and trying to get all indices from cluster:

client.admin().
cluster().
prepareState().
execute().
actionGet().
getState().
getMetaData().
getIndices();

Well, that fails:

client: org.elasticsearch.transport.client.PreBuiltTransportClient@7cfb4736
Exception in thread "main" TransportSerializationException[Failed to deserialize response from handler [org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler]]; nested: IllegalArgumentException[Unknown NamedWriteable [org.elasticsearch.cluster.metadata.MetaData$Custom][ml]];
at org.elasticsearch.transport.TcpTransport.handleResponse(TcpTransport.java:1441)
at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1400)
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:64)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:297)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:413)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:545)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Unknown NamedWriteable [org.elasticsearch.cluster.metadata.MetaData$Custom][ml]
at org.elasticsearch.common.io.stream.NamedWriteableRegistry.getReader(NamedWriteableRegistry.java:112)
at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:45)
at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:39)
at org.elasticsearch.cluster.metadata.MetaData.readFrom(MetaData.java:775)
at org.elasticsearch.cluster.ClusterState.readFrom(ClusterState.java:668)
at org.elasticsearch.action.admin.cluster.state.ClusterStateResponse.readFrom(ClusterStateResponse.java:81)
at org.elasticsearch.transport.TransportResponseHandler.read(TransportResponseHandler.java:47)
at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.read(TransportService.java:1085)
at org.elasticsearch.transport.TcpTransport.handleResponse(TcpTransport.java:1437)

Note: my transport client and nodes are same version (since I just read that can cause issues)

I have xpack on cluster. maybe something with machine learning node or some node settings?

Ok, when I use PreBuiltXPackTransportClient - then I resolved issue with response deserializing.

But I still have issue when I enable sniffing nodes (note: I have only one node on cluster, it was created for test) - I get NoNodeAvailableException. If I comment that setting out, all works.

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