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

**URL:** <https://discuss.elastic.co/t/getting-invalid-internal-transport-message-format-when-using-java-transportclient-shield/79951>\
**Category:** Elasticsearch\
**Created:** [March 24, 2017, 9:35pm UTC](https://discuss.elastic.co/t/getting-invalid-internal-transport-message-format-when-using-java-transportclient-shield/79951 "2017-03-24T21:35:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzheaux](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jzheaux/32/7138_2.png) [@jzheaux](https://discuss.elastic.co/u/jzheaux)\
**Post date:** [March 24, 2017, 9:35pm UTC](https://discuss.elastic.co/t/getting-invalid-internal-transport-message-format-when-using-java-transportclient-shield/79951/1 "2017-03-24T21:35:56Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 21, 2017, 9:36pm UTC](https://discuss.elastic.co/t/getting-invalid-internal-transport-message-format-when-using-java-transportclient-shield/79951/2 "2017-04-21T21:36:21Z")

</div>

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