# newResponse returning failed shard responses

**URL:** https://discuss.elastic.co/t/newresponse-returning-failed-shard-responses/80520
**Category:** Elasticsearch
**Created:** [March 29, 2017, 4:05pm UTC](https://discuss.elastic.co/t/newresponse-returning-failed-shard-responses/80520 "2017-03-29T16:05:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![m6800](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@m6800](https://discuss.elastic.co/u/m6800)
#### Post date: [March 29, 2017, 4:05pm UTC](https://discuss.elastic.co/t/newresponse-returning-failed-shard-responses/80520/1 "2017-03-29T16:05:42Z")

</div>

I am experimenting with custom Action plugins in Elasticsearch 2.4.4 using Java. I'm creating an index with 10000 documents spread out over 5 shards. I am trying to generate a list of documents at the shard level, and then aggregate the result from each shard response. About 90% of the time, I receive at least one failed shard response. 10% of the time all 5 shards return a List to the newResponse method, where I can then aggregate to a single List as expected. I am doing my testing using JUnits integration testing for elasticsearch.

I'm following examples from the Elasticsearch Cookbook to guide me in this task. Any ideas or pointers in debugging my code?

---

<div class="post-metadata">

### Author: ![venkata\_sreekanth\_bh](https://avatars.discourse-cdn.com/v4/letter/v/65b543/32.png) [@venkata\_sreekanth\_bh](https://discuss.elastic.co/u/venkata_sreekanth_bh)
#### Post date: [March 29, 2017, 5:42pm UTC](https://discuss.elastic.co/t/newresponse-returning-failed-shard-responses/80520/2 "2017-03-29T17:42:22Z")

</div>

> [@m6800](#):
>
> lowing examples from the Elasticsearch Cookbook to guide me in this task. Any ideas or pointers in debugging my code?

can you post the message you receive when you have failed shard response

---

<div class="post-metadata">

### Author: ![m6800](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@m6800](https://discuss.elastic.co/u/m6800)
#### Post date: [March 29, 2017, 6:59pm UTC](https://discuss.elastic.co/t/newresponse-returning-failed-shard-responses/80520/3 "2017-03-29T18:59:49Z")

</div>

Yes, I'm receiving:  
[ellipse][[ellipse][2]] BroadcastShardOperationFailedException[]; nested: RemoteTransportException[[node\_s0][local[1]][consolidateAction[s]]]; nested: NotSerializableExceptionWrapper[i\_o\_exception: Can't write type [class com.project.elasticsearch.test.CustomGeoPoint]];  
at org.elasticsearch.action.support.broadcast.TransportBroadcastAction$AsyncBroadcastAction.setFailure(TransportBroadcastAction.java:256)  
at org.elasticsearch.action.support.broadcast.TransportBroadcastAction$AsyncBroadcastAction.onOperation(TransportBroadcastAction.java:216)  
at org.elasticsearch.action.support.broadcast.TransportBroadcastAction$AsyncBroadcastAction$1.handleException(TransportBroadcastAction.java:193)  
at org.elasticsearch.transport.local.LocalTransport.handleException(LocalTransport.java:379)  
at org.elasticsearch.transport.local.LocalTransport.handleResponseError(LocalTransport.java:370)  
at org.elasticsearch.transport.local.LocalTransport.messageReceived(LocalTransport.java:252)  
at org.elasticsearch.transport.local.LocalTransportChannel$1.run(LocalTransportChannel.java:102)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)  
Caused by: RemoteTransportException[[node\_s0][local[1]][consolidateAction[s]]]; nested: NotSerializableExceptionWrapper[i\_o\_exception: Can't write type [class com.project.elasticsearch.test.CustomGeoPoint]];  
Caused by: NotSerializableExceptionWrapper[i\_o\_exception: Can't write type [class com.project.elasticsearch.test.CustomGeoPoint]]  
at org.elasticsearch.common.io.stream.StreamOutput.writeGenericValue(StreamOutput.java:436)  
at org.elasticsearch.common.io.stream.StreamOutput.writeGenericValue(StreamOutput.java:376)  
at com.project.elasticsearch.test.consolidate.ShardConsolidateResponse.writeTo(ShardConsolidateResponse.java:75)  
at org.elasticsearch.transport.local.LocalTransportChannel.sendResponse(LocalTransportChannel.java:81)  
at org.elasticsearch.transport.local.LocalTransportChannel.sendResponse(LocalTransportChannel.java:70)  
at org.elasticsearch.transport.DelegatingTransportChannel.sendResponse(DelegatingTransportChannel.java:58)  
at org.elasticsearch.transport.RequestHandlerRegistry$TransportChannelWrapper.sendResponse(RequestHandlerRegistry.java:140)  
at org.elasticsearch.action.support.broadcast.TransportBroadcastAction$ShardTransportHandler.messageReceived(TransportBroadcastAction.java:282)  
at org.elasticsearch.action.support.broadcast.TransportBroadcastAction$ShardTransportHandler.messageReceived(TransportBroadcastAction.java:278)  
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:77)  
at org.elasticsearch.transport.local.LocalTransport$3.doRun(LocalTransport.java:304)  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)

I have a List of objects of type CustomGeoPoint which is a class I've made. Thanks!

---

<div class="post-metadata">

### Author: ![m6800](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@m6800](https://discuss.elastic.co/u/m6800)
#### Post date: [March 30, 2017, 3:34pm UTC](https://discuss.elastic.co/t/newresponse-returning-failed-shard-responses/80520/4 "2017-03-30T15:34:14Z")

</div>

It looks like StreamOutput.writeGenericValues does not support custom objects.

> [@Java Api for UpdateByQuery requests](https://discuss.elastic.co/t/java-api-for-updatebyquery-requests/60820/3):
>
> OK, that was a bit of magic sauce I wasn't aware of. It got me a little further. Now getting write exception when attempting to write my custom objects. How do I pass the structures I want to update down to the script? Even if it's serializable, the script won't have access to the class itself. In the Sense playground, I can just create the JSON and magic happens. I tried turning it into JSON first, but then groovy script complains about strings not having the fields I'm looking for. What's the …

---

<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 27, 2017, 3:34pm UTC](https://discuss.elastic.co/t/newresponse-returning-failed-shard-responses/80520/5 "2017-04-27T15:34:18Z")

</div>

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