# Failed to deserialize response from handler

**URL:** <https://discuss.elastic.co/t/failed-to-deserialize-response-from-handler/312282>\
**Category:** Elasticsearch\
**Created:** [August 17, 2022, 12:19pm UTC](https://discuss.elastic.co/t/failed-to-deserialize-response-from-handler/312282 "2022-08-17T12:19:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pspardeshi](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@pspardeshi](https://discuss.elastic.co/u/pspardeshi)\
**Post date:** [August 17, 2022, 12:19pm UTC](https://discuss.elastic.co/t/failed-to-deserialize-response-from-handler/312282/1 "2022-08-17T12:19:31Z")

</div>

I am using scala+java application and running it on jdk 11 and calling Elasticsearch api for searching text.  
Recently upgraded from elasticsearch 5.5 to 7.17 and while search text getting below error.

```auto
ERROR play.http.DefaultHttpErrorHandler -
! @7ojlf7lhb - Internal server error, for (POST) [/catalog/search/token?query=test&limit=10&consistencydate=%7B%7D&modifydate=%7B%7D] ->

play.api.UnexpectedException: Unexpected exception[SearchServerException: Invalid filters provided, error: Failed to deserialize response from handler [org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler/org.elasticsearch.action.ActionListenerResponseHandler@6b34c1/org.elasticsearch.client.transport.TransportClientNodesService$RetryListener@192cba31]]
    at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:340)
    at play.api.http.HttpErrorHandlerExceptions.throwableToUsefulException(HttpErrorHandler.scala)
    at play.http.DefaultHttpErrorHandler.throwableToUsefulException(DefaultHttpErrorHandler.java:227)
    at play.http.DefaultHttpErrorHandler.onServerError(DefaultHttpErrorHandler.java:182)
    at play.core.j.JavaHttpErrorHandlerAdapter.$anonfun$onServerError$1(JavaHttpErrorHandlerAdapter.scala:23)
    at play.core.j.JavaHelpers.$anonfun$invokeWithContext$1(JavaHelpers.scala:287)
    at play.core.j.JavaHelpers.withContext(JavaHelpers.scala:299)
Caused by: java.lang.IllegalArgumentException: Unknown NamedWriteable category [org.elasticsearch.persistent.PersistentTaskParams]
	at org.elasticsearch.common.io.stream.NamedWriteableRegistry.getReader(NamedWriteableRegistry.java:106)
	at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:36)
	at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:28)
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata$PersistentTask.<init>(PersistentTasksCustomMetadata.java:360)
	at org.elasticsearch.common.io.stream.StreamInput.readMap(StreamInput.java:654)
	at org.elasticsearch.common.io.stream.StreamInput.readMap(StreamInput.java:638)
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.<init>(PersistentTasksCustomMetadata.java:544)
	at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:37)
	at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:28)
	at org.elasticsearch.cluster.metadata.Metadata.readFrom(Metadata.java:1189)
	at org.elasticsearch.cluster.ClusterState.readFrom(ClusterState.java:760)
	at org.elasticsearch.action.admin.cluster.state.ClusterStateResponse.lambda$new$0(ClusterStateResponse.java:37)
	at org.elasticsearch.common.io.stream.StreamInput.readOptionalWriteable(StreamInput.java:1035)
	at org.elasticsearch.action.admin.cluster.state.ClusterStateResponse.<init>(ClusterStateResponse.java:37)
	at org.elasticsearch.action.ActionListenerResponseHandler.read(ActionListenerResponseHandler.java:58)
	at org.elasticsearch.action.ActionListenerResponseHandler.read(ActionListenerResponseHandler.java:25)
	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.read(TransportService.java:1462)
	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.read(TransportService.java:1449)
	at org.elasticsearch.transport.InboundHandler.handleResponse(InboundHandler.java:311)
	... 30 common frames omitted

```

Same call from application was working with elasticsearch 5.5.  
Elasticsearch is running fine and direct curl command to search text is working fine.  
Can anyone provide any solution or pointers why I am getting this.

---

<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:** [August 17, 2022, 12:19pm UTC](https://discuss.elastic.co/t/failed-to-deserialize-response-from-handler/312282/2 "2022-08-17T12:19:31Z")

</div>

elasticsearch 5.5 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

**Author:** ![pspardeshi](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@pspardeshi](https://discuss.elastic.co/u/pspardeshi)\
**Post date:** [August 18, 2022, 10:32am UTC](https://discuss.elastic.co/t/failed-to-deserialize-response-from-handler/312282/3 "2022-08-18T10:32:17Z")

</div>

So far what I figure out is, application is calling elasticsearch for cluster state and failing with HTTP GET.

ClusterState clusterState = getClient().admin().cluster().state(new ClusterStateRequest()).actionGet().getState();

---

<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:** [September 15, 2022, 10:32am UTC](https://discuss.elastic.co/t/failed-to-deserialize-response-from-handler/312282/4 "2022-09-15T10:32:45Z")

</div>

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