# org.elasticsearch.ElasticsearchException: Failed to parse info response. Check logs for detailed information - Unsupported Content-Type: text/html

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417>\
**Category:** Elasticsearch\
**Tags:** docker, language-clients\
**Created:** [January 26, 2022, 4:15am UTC](https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417 "2022-01-26T04:15:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sumit\_Jha1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sumit_jha1/32/100878_2.png) [@Sumit\_Jha1](https://discuss.elastic.co/u/Sumit_Jha1)\
**Post date:** [January 26, 2022, 4:15am UTC](https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417/1 "2022-01-26T04:15:39Z")

</div>

I am using Elastic Search High Level REST API 7.15.0 (Java) and the version of ES deployed on [elastic.co](http://elastic.co) is 7.15.2

When making any request using the client, in the logs I can see, the client first makes call to cluster info endpoint (perhaps to do version validation). In this request, the client seems to be passing invalid content type:

Request:

```auto
2022-01-26 09:04:44,319 TRACE [I/O dispatcher 1] tracer [RequestLogger.java:83] curl -iX GET 'https://HOST:PORT/'
# HTTP/1.1 200 OK
# Accept-Ranges: bytes
# Cache-Control: private, no-cache, no-store, must-revalidate
# Content-Length: 145060
# Content-Security-Policy: script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'
# Content-Type: text/html; charset=utf-8
# Date: Wed, 26 Jan 2022 03:19:42 GMT
# Kbn-License-Sig: 289eb19369e758110d5ebea187df9fb14630b5dcc93f827dbe9f72f57a6701eb
# Kbn-Name: 6d4a35ef78c8
# Referrer-Policy: no-referrer-when-downgrade
# Vary: accept-encoding
# X-Cloud-Request-Id: nDBzRS9aRxiH-VMr_cNi_A
# X-Content-Type-Options: nosniff
# X-Found-Handling-Cluster: a62429edfa6148b4918d1911f8287e9e
# X-Found-Handling-Instance: instance-0000000000

```

Since the `Content-Type` for above request is `text/html; charset=utf-8`, the server returns HTML response, which the client is not able to parse.

Response:

```auto

# <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="viewport" content="width=device-width"/><title>Elastic</title><style>
#         
# <more HTMLs>
#         
# <h2 class="kbnWelcomeTitle">Please upgrade your browser</h2><div class="kbnWelcomeText">This Elastic installation has strict security requirements enabled that your current browser does not meet.</div></div><script>
# // Since this is an unsafe inline script, this code will not run
# // in browsers that support content security policy(CSP). This is
# // intentional as we check for the existence of __kbnCspNotEnforced__ in
# // bootstrap.
# window. __kbnCspNotEnforced__ = true;
# </script><script src="/bootstrap.js"></script></body></html>
# 

```

This throws the following error:

> org.elasticsearch.ElasticsearchException: Failed to parse info response. Check logs for detailed information - Unsupported Content-Type: text/html; charset=utf-8  
> at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2084)  
> at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1732)  
> at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1702)

As mentioned in the last line of server's response, does it have something to do with security ? Why would the client make request to the server with invalid content type ?

Here is the response for `GET /`from kibana console:

```auto
{
  "name" : "instance-0000000000",
  "cluster_name" : "7ae08a52199c4ff8a7def04f318276a6",
  "cluster_uuid" : "24X8eOCzREyoxO9ZpmL7IA",
  "version" : {
    "number" : "7.15.2",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "93d5a7f6192e8a1a12e154a2b81bf6fa7309da0c",
    "build_date" : "2021-11-04T14:04:42.515624022Z",
    "build_snapshot" : false,
    "lucene_version" : "8.9.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

```

Any help on this ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 26, 2022, 6:21am UTC](https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417/2 "2022-01-26T06:21:12Z")

</div>

Welcome!

It sounds like you are trying to connect to Kibana with the Elasticsearch client instead of connecting to Elasticsearch.

Could you confirm?

---

<div class="post-metadata">

**Author:** ![Sumit\_Jha1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sumit_jha1/32/100878_2.png) [@Sumit\_Jha1](https://discuss.elastic.co/u/Sumit_Jha1)\
**Post date:** [January 26, 2022, 7:14am UTC](https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417/3 "2022-01-26T07:14:07Z")

</div>

No. I am trying to connect to Elasticsearch only using Java high level rest client from a spring boot application.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 26, 2022, 7:27am UTC](https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417/4 "2022-01-26T07:27:59Z")

</div>

> [@Sumit\_Jha1](#):
>
> `class="kbnWelcomeTitle">`

That response seems to be coming from Kibana, so I would recommend you check your connections. Elasticsearch does not serve any HTML.

Are you connecting directly to the nodes or perhaps going through some load balancer?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 26, 2022, 8:27am UTC](https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417/5 "2022-01-26T08:27:04Z")

</div>

Could you share the code which creates the connection to Elasticsearch? What is the URL you are using?

---

<div class="post-metadata">

**Author:** ![Sumit\_Jha1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sumit_jha1/32/100878_2.png) [@Sumit\_Jha1](https://discuss.elastic.co/u/Sumit_Jha1)\
**Post date:** [January 26, 2022, 11:22am UTC](https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417/6 "2022-01-26T11:22:58Z")

</div>

Thanks a lot @Christian_Dahlqvist @dadoonet !  
Indeed had been using kibana endpoint instead of ES all this time !

Kibana endpoint: `<cluster_name>.kb.us-east-1.aws.found.io:9243`  
ES endpoint: `<cluster_name>.es.us-east-1.aws.found.io:9243`

---

<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:** [February 23, 2022, 11:23am UTC](https://discuss.elastic.co/t/org-elasticsearch-elasticsearchexception-failed-to-parse-info-response-check-logs-for-detailed-information-unsupported-content-type-text-html/295417/7 "2022-02-23T11:23:20Z")

</div>

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