I am using NEST nuget package to communicate to elasticsearch api in a .net application.
This my application works fine with elastic search hosted on aws. In case of Azure deployment I am getting below exception from elastic search when trying to refresh index.
HTTP/1.1 400 Bad Request
content-type: application/json; charset=UTF-8
content-length: 357
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [POST /myindexname/_refresh] does not support having a body"}],"type":"illegal_argument_exception","reason":"request [POST /myindexname/_refresh] does not support having a body"},"status":400}
also if create same request using kibana-console I am getting same error on Azure but on AWS everything works fine
I would also guess that a proxy along the way may be removing this empty content. I noticed from the output that you are using NEST 7.4.1. The latest versions no longer send empty objects in the request body. The clients are backwards compatible with the previous 7.x versions of Elasticsearch, so I'd recommend updating to 7.13.2 which should resolve the issue here.
hi,
thanks for you replies. The issue was version of elastic search. On AWS installed version is 7.9.1. In this version _refresh api supports body.
On Azure I installed 7.11.1 and in this version body in _refresh api is not supported. To use 7.11.1, nuget packages must be updated. Latest nuget package is not sending empty body in _refresh api.
Currently to work with our code I installed elasticsearch 7.9.3. and this version also supports body in _refresh api.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.