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

4

18

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

Booth answered 12/8, 2021 at 18:49 Comment(1)
Try downgrading your elasticsearch gem e.g. add gem elasticsearch, "< 7.14" to your Gemfile. It seems that 7.14 introduced these issues. Open IssueFloatage
B
19

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

gem  elasticsearch, "< 7.14"
Booth answered 27/8, 2021 at 11:53 Comment(2)
I was having the same issue with fluentd elasticsearch-plugin , as suggested in here ,I did the gem downgrade and got my issue fixed ... I guess this problem is common across all elasticsearch clientsAeromancy
Discussion in details to why this is: github.com/elastic/elasticsearch-ruby/issues/1429Johiah
S
37

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

pip install elasticsearch<7.14.0
Solder answered 25/8, 2021 at 7:17 Comment(3)
See more detail about this here: github.com/elastic/elasticsearch-py/pull/1623 shocking, intentionally breaking move from elasticsearch, I'll be pushing to move our clusters to opensearchStare
related to this are discussion in github.com/elastic/elasticsearch-py/issues/1639 and github.com/toptal/chewy/pull/811/filesJohiah
worked for me pip3 install elasticsearch==7.13.4Temperamental
B
19

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

gem  elasticsearch, "< 7.14"
Booth answered 27/8, 2021 at 11:53 Comment(2)
I was having the same issue with fluentd elasticsearch-plugin , as suggested in here ,I did the gem downgrade and got my issue fixed ... I guess this problem is common across all elasticsearch clientsAeromancy
Discussion in details to why this is: github.com/elastic/elasticsearch-ruby/issues/1429Johiah
J
1

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

Johiah answered 27/4, 2022 at 15:3 Comment(0)
D
0

Bypass the check with a monkeypatch. For example in Rails:

# in config/initializers/elasticsearch.rb

module Elasticsearch
  class Client
    alias original_verify_with_version_or_header verify_with_version_or_header

    def verify_with_version_or_header(...)
      original_verify_with_version_or_header(...)
    rescue Elasticsearch::UnsupportedProductError => exception
      warn("Ignoring elasticsearch complaint: #{exception.message}")
    end
  end
end
Dipsomaniac answered 22/11, 2023 at 22:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.