Getting "invalid internal transport message format" when using Java TransportClient + Shield

I'm trying to use the Java client (2.4.4) to connect to our Elasticsearch cluster (2.4.4). They are both on the same version of the jdk (1.8.0u121) and both are using the same jks, which I believe I understand correctly from the documentation here:

[https://www.elastic.co/guide/en/shield/current/_using_elasticsearch_java_clients_with_shield.html#disabling-client-auth]

My settings in Java are as follows:

Settings settings = Settings.settingsBuilder()
			.put("cluster.name", "dw-elasticsearch-stg")
			.put("action.bulk.compress", false)
			.put("shield.user", "my-username:my-password")
			.put("shield.ssl.truststore.path", "/my/local/path/to/jks")
			.put("shield.ssl.truststore.password", "the-jks-password")
			.put("shield.transport.ssl", true)
			.put("shield.ssl.hostname_verification", "false")
			.build();

		TransportClient client = TransportClient.builder()
			.settings(settings)
			.addPlugin(ShieldPlugin.class)
			.build()
			.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("hostname-of-a-client-node"), 9300));

		client.admin().cluster().health(Requests.clusterHealthRequest());

When I run the above, I get the following exception on the client:

Exception in thread "main" NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{10.41.122.172}{10.41.122.172:9300}]]
	at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:326)
	at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:223)
	at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55)
	at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:295)
	at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:359)
...

And the following exception on the server:

java.io.StreamCorruptedException: invalid internal transport message format, got (16,3,3,0)
        at org.elasticsearch.transport.netty.SizeHeaderFrameDecoder.decode(SizeHeaderFrameDecoder.java:65)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.cleanup(FrameDecoder.java:482)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.channelDisconnected(FrameDecoder.java:365)

What are some debug tips for making the connection work? What should I be looking for?

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