# org.elasticsearch.transport.TransportSerializationException: Failed to deserialize exception response from stream when one node is still starting

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-transport-transportserializationexception-failed-to-deserialize-exception-response-from-stream-when-one-node-is-still-starting/9738>\
**Category:** Elasticsearch\
**Created:** [November 16, 2012, 10:45am UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-transportserializationexception-failed-to-deserialize-exception-response-from-stream-when-one-node-is-still-starting/9738 "2012-11-16T10:45:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barbara\_Ferreira](https://avatars.discourse-cdn.com/v4/letter/b/3da27b/32.png) [@Barbara\_Ferreira](https://discuss.elastic.co/u/Barbara_Ferreira)\
**Post date:** [November 16, 2012, 10:45am UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-transportserializationexception-failed-to-deserialize-exception-response-from-stream-when-one-node-is-still-starting/9738/1 "2012-11-16T10:45:03Z")

</div>

Hello,

I'm trying to setup two elasticsearch nodes in Amazon they are in the same  
region.  
My configuiration is:  
discovery.type: ec2  
cloud.aws.access\_key:   
cloud.aws.secret\_key:   
discovery.ec2.ping\_timeout: 5m  
cloud.aws.region: eu-west-1  
discovery.ec2.host\_type: private\_ip  
discovery.ec2.tag.communication: es\_test

They find each other and connect OK.

Then I stated testing failover. Here are my settings:

elasticsearch.hosts=host1,host2  
elasticsearch.indexName=index1  
elasticsearch.indexType=dv  
elasticsearch.cluster=AMZ\_TEST

and I start the transport client in my application:

private @Value("${elasticsearch.hosts}") String esHosts;  
private @Value("${elasticsearch.cluster}") String clusterName;  
private TransportClient client;

```
public Client initClient() {
    Settings settings = ImmutableSettings.settingsBuilder()
            .put("cluster.name", clusterName).build();

    client = new TransportClient(settings);

        for (String hostname : esHosts.split(",")) {
            client.addTransportAddress(new 

```

InetSocketTransportAddress(hostname, 9300));  
}

```
    return client;
}

```

It all works fine and if I stop one node everything works.  
The problem is when I start the node again. I get this exception when I try  
to do any query:

Exception in thread "main"  
org.elasticsearch.transport.TransportSerializationException: Failed to  
deserialize exception response from stream

A few seconds after the two nodes find each other everything is ok.  
Is there anything I should do not to have this downtime.

Thank you

--

---

<div class="post-metadata">

**Author:** ![Chris\_Male](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_male/32/2607_2.png) [@Chris\_Male](https://discuss.elastic.co/u/Chris_Male)\
**Post date:** [November 17, 2012, 9:35am UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-transportserializationexception-failed-to-deserialize-exception-response-from-stream-when-one-node-is-still-starting/9738/2 "2012-11-17T09:35:03Z")

</div>

Hi,

Are you able to share your logs around the Exception? Just so we can see  
what's going on leading up to it.

On Friday, November 16, 2012 11:45:03 PM UTC+13, Barbara Ferreira wrote:

> Hello,
> 
> I'm trying to setup two elasticsearch nodes in Amazon they are in the same  
> region.  
> My configuiration is:  
> discovery.type: ec2  
> cloud.aws.access\_key:   
> cloud.aws.secret\_key:   
> discovery.ec2.ping\_timeout: 5m  
> cloud.aws.region: eu-west-1  
> discovery.ec2.host\_type: private\_ip  
> discovery.ec2.tag.communication: es\_test
> 
> They find each other and connect OK.
> 
> Then I stated testing failover. Here are my settings:
> 
> elasticsearch.hosts=host1,host2  
> elasticsearch.indexName=index1  
> elasticsearch.indexType=dv  
> elasticsearch.cluster=AMZ\_TEST
> 
> and I start the transport client in my application:
> 
> private @Value("${elasticsearch.hosts}") String esHosts;  
> private @Value("${elasticsearch.cluster}") String clusterName;  
> private TransportClient client;
> 
> ```
> public Client initClient() {
> Settings settings = ImmutableSettings.settingsBuilder()
> .put("cluster.name", clusterName).build();
> 
> client = new TransportClient(settings);
> 
> for (String hostname : esHosts.split(",")) {
> client.addTransportAddress(new 
> 
> ```
> 
> InetSocketTransportAddress(hostname, 9300));  
> }
> 
> ```
> return client;
> }
> 
> ```
> 
> It all works fine and if I stop one node everything works.  
> The problem is when I start the node again. I get this exception when I  
> try to do any query:
> 
> Exception in thread "main"  
> org.elasticsearch.transport.TransportSerializationException: Failed to  
> deserialize exception response from stream
> 
> A few seconds after the two nodes find each other everything is ok.  
> Is there anything I should do not to have this downtime.
> 
> Thank you

--

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 17, 2012, 6:10pm UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-transportserializationexception-failed-to-deserialize-exception-response-from-stream-when-one-node-is-still-starting/9738/3 "2012-11-17T18:10:12Z")

</div>

Hi,

this error usually occurs if you have different JVM versions between server  
and client, or, if a plugin throws a custom exception at server side which  
is not present at the client, so it fails to decode the exception.

Jörg

--

---

<div class="post-metadata">

**Author:** ![npathan](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@npathan](https://discuss.elastic.co/u/npathan)\
**Post date:** [July 10, 2013, 11:01pm UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-transportserializationexception-failed-to-deserialize-exception-response-from-stream-when-one-node-is-still-starting/9738/4 "2013-07-10T23:01:25Z")

</div>

Hi Jorg,

Can you please tell how to solve it?

Thanks

---

<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:** [July 6, 2017, 2:27am UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-transportserializationexception-failed-to-deserialize-exception-response-from-stream-when-one-node-is-still-starting/9738/5 "2017-07-06T02:27:03Z")

</div>


