Unable to Parse response body error

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
1.3.9 and 1.3.4

Describe the issue:
We are evaluating migration of Elasticsearch(7.17.0) to Opensearch(1.3.9/1.3.4), high level rest REST client(1.3.9/1.3.4) and 1.0.0 of Opensearch test container.
While creating index using the high level REST client for the below API call
curl -X PUT -H “Content-Type: application/json” /index/_doc/document-id? -d ‘{payload}’
we get error java.io.IOException: Unable to parse response body for Response{requestLine=PUT /?timeout=1m HTTP/1.1, host=http://localhost:32802, response=HTTP/1.1 201 Created}
In the stacktrace we notice that it complains type attribute to be null in DocWriteResponse constructor
we understand that in Elasticsearch this error occurs when we use REST client of version 7.x to access Server of version 8.x
However we are unable to figure how to resolve this issue with Opensearch.

Configuration:

Relevant Logs or Screenshots:

1 Like

Have you considered using the opensearch-java client? The HLRC is on track for deprecation in favor of the opensearch-java client.

Any solution ? I am also facing the same error

@balajee333 Can you take a look at opensearch-java?

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