Closed zuomengjun closed 7 months ago
Elasticsearch does not return html pages in response to a request where a document or index is not found. It returns a 404 error with a json body that looks like this:
{
"_id": "42",
"_index": "foo",
"found": false
}
This can be parsed by the Elasticsearch client.
It seems that in your server setup - you did not write where this is hosted - there is some process in between the client and the Elasticsearch service that intercepts this message and converts it to a web page, which of course cannot be processed by the Elasticsearch client.
Understood, thank you very much for your answer!
Caused by: org.elasticsearch.ElasticsearchStatusException: Unable to parse response body at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2464) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2181) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:2137) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:2105) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestHighLevelClient.get(RestHighLevelClient.java:986) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.lambda$doExists$4(ElasticsearchRestTemplate.java:229) ~[spring-data-elasticsearch-4.4.12.jar!/:4.4.12] at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:582) ~[spring-data-elasticsearch-4.4.12.jar!/:4.4.12] ... 110 common frames omitted Suppressed: java.lang.IllegalStateException: Unsupported Content-Type: text/html at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2481) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2461) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] ... 116 common frames omitted Caused by: org.elasticsearch.client.ResponseException: method [GET], host [http://10.1.19.162:9200], URI [/task_job_current_gdh/_doc/de4d0440-ce99-4db9-bebd-3d1e81ffc7fb?_source=false], status line [HTTP/1.1 404 Not Found] Sorry, Page Not Found at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:346) ~[elasticsearch-rest-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestClient.performRequest(RestClient.java:312) ~[elasticsearch-rest-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestClient.performRequest(RestClient.java:287) ~[elasticsearch-rest-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2699) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2171) ~[elasticsearch-rest-high-level-client-7.17.3.jar!/:7.17.3] ... 115 common frames omitted