Your distribution is broken

Running Elasticsearch with the following command

docker run -d --name elasticsearch --rm --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:6.8.4

I'm getting the following error on a basic INFO API request:

java.io.IOException: Unable to parse response body for Response{requestLine=GET / HTTP/1.1, host=http://localhost:9200, response=HTTP/1.1 200 OK}

    at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1275)
    at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1231)
    at org.elasticsearch.client.RestHighLevelClient.info(RestHighLevelClient.java:393)
    at io.test.ElasticTest.should get info(ElasticTest.groovy:40)
Caused by: org.elasticsearch.common.xcontent.XContentParseException: [15:3] [org.elasticsearch.action.main.MainResponse] failed to parse field [version]
    at org.elasticsearch.common.xcontent.ObjectParser.parseValue(ObjectParser.java:316)
    at org.elasticsearch.common.xcontent.ObjectParser.parseSub(ObjectParser.java:326)
    at org.elasticsearch.common.xcontent.ObjectParser.parse(ObjectParser.java:168)
    at org.elasticsearch.common.xcontent.ObjectParser.apply(ObjectParser.java:182)
    at org.elasticsearch.action.main.MainResponse.fromXContent(MainResponse.java:150)
    at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1406)
    at org.elasticsearch.client.RestHighLevelClient.lambda$performRequestAndParseEntity$9(RestHighLevelClient.java:1232)
    at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1273)
    ... 3 more
Caused by: java.lang.IllegalStateException: unexpected distribution type [docker]; your distribution is broken
    at org.elasticsearch.Build$Type.fromDisplayName(Build.java:106)
    at org.elasticsearch.action.main.MainResponse.lambda$static$4(MainResponse.java:140)
    at org.elasticsearch.common.xcontent.ObjectParser.lambda$declareField$1(ObjectParser.java:213)
    at org.elasticsearch.common.xcontent.ObjectParser.parseValue(ObjectParser.java:314)

Any clue what's wrong?

welcome!

What is the client version you are using?

Hi David, I've solved upgrading the client to the same version as Elasticsearch server. thanks!

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