Search code examples
node.jselasticsearchegg

Getting ProductNotSupportedError: The client noticed that the server is not Elasticsearch and we do not support this unknown product


Upgraded the midwayjs service from v2 to v3 but now I am unable to connect to elasticsearch. Below is the package.json dependencies:

"@elastic/elasticsearch": "7.12.0",
"egg": "^3.3.3",
"egg-elasticsearch-ts": "^1.1.1"

Getting below error:

fetch fs status error ProductNotSupportedError: The client noticed that the server is not Elasticsearch and we do not support this unknown product. at Transport.request

meta: { body: null, statusCode: null, headers: null, meta: { context: null, request: [Object], name: 'elasticsearch-js', connection: null, attempts: 0, aborted: false } } }


Solution

  • As you are using 7.10 version of ElasticSearch and elastic client is 7.12 hence it is throwing this exception.

    Please remove the ElasticSearch client 7.12 and install ElasticSearch client 7.10 version which will resolved your issue.

    Also, my understanding is that you are using AWS ElasticSearch service which is now AWS OpenSearch.

    Update:

    As you mentioned in comment that you are using Opensearch 2.0.1 version hence you need to use Opensearch Javascript client insted of Elasticsearch client.