Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create client connection to Elasticsearch #1614

Closed
Jayabalk opened this issue Aug 11, 2021 · 15 comments
Closed

Unable to create client connection to Elasticsearch #1614

Jayabalk opened this issue Aug 11, 2021 · 15 comments

Comments

@Jayabalk
Copy link

Jayabalk commented Aug 11, 2021

I am using curator to rollover the elastic-search indices.

My curator version = 5.7
Elasticsearch version = 7.5.0

I am getting the below exception

Traceback (most recent call last):
File "/usr/local/bin/curator", line 8, in
sys.exit(cli())
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/curator/cli.py", line 218, in cli
run(config, action_file, dry_run)
File "/usr/local/lib/python3.7/site-packages/curator/cli.py", line 165, in run
client = get_client(**client_args)
File "/usr/local/lib/python3.7/site-packages/curator/utils.py", line 906, in get_client
'Error: {0}'.format(e)
elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch. Error: The client noticed that the server is not a supported distribution of Elasticsearch

@untergeek
Copy link
Member

How did you install Curator? I'm guessing a pip install since that error message indicates that you are using a newer version of the Elasticsearch python client library (7.14.0?).

Also, Curator's most recent release is 5.8.4. Curator 5.7 is rather old, and may not support the 7.x releases of Elasticsearch very well.

@untergeek
Copy link
Member

We can ascertain what the error messages mean.

What response do you get if you submit a curl call to your Elasticsearch endpoint?

curl -X GET -u USER -p https://name.domain.tld:9200/

The response will likely look something like:

{
  "name" : "instance-0000000002",
  "cluster_name" : "2c3954576c5a4ae9aabcbe7face735b6",
  "cluster_uuid" : "8MXtM371R1ikgO8fDckKbQ",
  "version" : {
    "number" : "7.14.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "dd5a0a2acaa2045ff9624f3729fc8a6f40835aa1",
    "build_date" : "2021-07-29T20:49:32.864135063Z",
    "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"
}

@Jayabalk
Copy link
Author

Yes @untergeek, I am using pip to install curator. I saw the version compatibly matrix - https://www.elastic.co/guide/en/elasticsearch/client/curator/current/version-compatibility.html It says curator 5.7+ supports elasticsearch 7.x. Does the latest curator version solves this problem?

While searching found this - elastic/elasticsearch-py#1623
https://www.theregister.com/2021/08/09/elasticsearch_python_client_change/

Is this issue related to this?

@Jayabalk
Copy link
Author

Also I am able to get the response from elasticsearch

curl http://elasticsearch:9200
{
"name" : "elasticsearch-xxxxx",
"cluster_name" : "elasticsearch-cluster",
"cluster_uuid" : "7qA72gXuRya3ZoA50Kl5ug",
"version" : {
"number" : "7.5.0",
"build_flavor" : "oss",
"build_type" : "docker",
"build_hash" : "e9ccaed468e2fac2275a3761849cbee64b39519f",
"build_date" : "2019-11-26T01:06:52.518245Z",
"build_snapshot" : false,
"lucene_version" : "8.3.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

@Jayabalk
Copy link
Author

After using the elasticsearch client < 7.14. it's working fine. Thanks @untergeek for your response.

@raducostea
Copy link

Having the same issue here

{
  "name" : "a3b8c2ed1758d0d4e98b37f76b7a5fc7",
  "cluster_name" : "764354061506:es-aid-dev",
  "cluster_uuid" : "zUXGzYMSQ8WMxm26RKrkXA",
  "version" : {
    "number" : "7.10.2",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "unknown",
    "build_date" : "2021-05-21T20:25:46.519671Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Curator

curator, version 5.8.4

Message

2021-09-07 09:29:18,726 ERROR     Unable to connect to Elasticsearch cluster. Error: The client noticed that the server is not a supported distribution of Elasticsearch

@berserker5000
Copy link

Same issue here.
{
"name" : "",
"cluster_name" : "",
"cluster_uuid" : "",
"version" : {
"number" : "7.6.1",
"build_flavor" : "oss",
"build_type" : "tar",
"build_hash" : "aa751e09be0a5072e8570670309b1f12348f023b",
"build_date" : "2020-02-29T00:15:25.529771Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

ES version is 7.6.1
curator, version 5.8.4

Unable to connect to Elasticsearch cluster. Error: The client noticed that the server is not a supported distribution of Elasticsearch

Any suggestions?

@untergeek
Copy link
Member

@berserker5000

Use Curator 5.8.3 or older, or if installing via source, change the dependency to use the ES client library older than 7.14.

@berserker5000
Copy link

@berserker5000

Use Curator 5.8.3 or older, or if installing via source, change the dependency to use the ES client library older than 7.14.

@untergeek, thanks for your reply, as you can see I'm using the latest version of curator for today. I'm installing it via pip (apk add py3-pip &&
pip install --upgrade pip &&
pip install -U elasticsearch-curator==5.8.4)
Unfortunately it doesn't work

@untergeek
Copy link
Member

@berserker5000

Force override the dependency on the elasticsearch 7.14.0 by pip install -U elasticsearch==7.1.0 (used in Curator 5.8.2).

If you re-install Curator 5.8.4, it will attempt to install the elasticsearch python module at 7.14.0 again, but doing this after the fact should work.

@berserker5000
Copy link

@untergeek

Thanks, will try this trick but the only problem is I'm creating a brand new docker image based on alpine:3.15.0 and with only commands:

apk add py3-pip && \
    pip install --upgrade pip && \
    pip install -U elasticsearch-curator==5.8.4

so there shouldn't be any previous version of python libs.

But I'll try to do next:

apk add py3-pip && \
    pip install --upgrade pip && \
    pip install -U elasticsearch-curator==5.8.4 && \
    pip install -U elasticsearch==7.1.0 && \
    pip install -U elasticsearch-curator==5.8.4

Hope it'll work

@untergeek
Copy link
Member

untergeek commented Oct 11, 2022 via email

@untergeek
Copy link
Member

Stale

@zishiguo
Copy link

zishiguo commented Jun 6, 2023

elasticsearch-curator==5.8.4 install elasticsearch-7.17.9
elasticsearch-curator==5.8.3 install elasticsearch-7.1.0

@ilikevenkat
Copy link

We have ElasticSearch 5.6.16. Worked using following version combination:

Python 2.7

pip install voluptuous==0.11.7
pip install urllib3==1.24.3
pip install elasticsearch==7.5.1
pip install elasticsearch-curator==5.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants