Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch::UnsupportedProductError (The client noticed that the server is not a supported distribution of Elasticsearch

Getting this error when using searchkick with elasticsearch on mac.

Searchkick version: searchkick (4.5.2)

$ elasticsearch --version
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
Version: 7.10.2-SNAPSHOT, Build: oss/tar/unknown/2021-01-16T01:41:27.115673Z, JVM: 16.0.2

To reproduce

Product.reindex

like image 436
Siddhant Avatar asked Aug 12 '21 18:08

Siddhant


People also ask

Why am I getting unsupported product error in Elasticsearch?

I guess this problem is common across all elasticsearch clients Elasticsearch::UnsupportedProductError is raised when your Elasticsearch server version don't match with Ruby's Elasticsearch client ( gem elasticsearch ). In order to fix this properly you need a server that is up to date with latest Elasticsearch (ES) releases

Is the server a supported distribution of Elasticsearch?

The client noticed that the server is not a supported distribution of Elasticsearch. · Issue #1429 · elastic/elasticsearch-ruby · GitHub Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Why is my Elasticsearch client client not working?

Try downgrading your elasticsearch gem e.g. add gem elasticsearch, "< 7.14" to your Gemfile. It seems that 7.14 introduced these issues. Open Issue If you are using Python elasticsearch client, you need to downgrade or install version before 7.14.0.

What version of Elasticsearch do I need to upgrade to?

With the 7.11 release of Elasticsearch, we will no longer be releasing oss-only distributions, as stated in the FAQ on license change. The recommendation is to upgrade to the latest default distribution of Elasticsearch, which is free to use under Elastic License v2. Otherwise, you can pin the client version to <7.14. Sorry, something went wrong.


3 Answers

If you are using Python elasticsearch client, you need to downgrade or install version before 7.14.0.

pip install elasticsearch<7.14.0
like image 95
Buoy Rina Avatar answered Oct 17 '22 03:10

Buoy Rina


It worked fine after degrading to elastic search < 7.14. So basically added a gem to restrict the version upgrade

gem  elasticsearch, "< 7.14"
like image 15
Siddhant Avatar answered Oct 17 '22 03:10

Siddhant


Elasticsearch::UnsupportedProductError is raised when your Elasticsearch server version don't match with Ruby's Elasticsearch client (gem elasticsearch). In order to fix this properly you need a server that is up to date with latest Elasticsearch (ES) releases

that means if you are on ES provider like https://cloud.elastic.co/ where you work with latest versions of cluster it's easy peasy => server gets upgraded => this is not an issue

if you however work with provider that is slow to catch up with latest ES releases (like AWS Elasticsearch / AWS Opensearch where last version is 7.10 and will not get upgraded anytime soon) your only option is to use gem elasticsearch, "< 7.14" (Siddhant's answer in this discussion ...and yes this means no potential security updates

other solution may be to silence the verification by overriding method verify_with_version_or_header as proposed in https://github.com/elastic/elasticsearch-ruby/issues/1429#issuecomment-958162468

but reality is both of this solutions are just "not recommended" workarounds. The real fix is a server upgrade

like image 1
equivalent8 Avatar answered Oct 17 '22 02:10

equivalent8