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

ProductNotSupportedError for elasticsearch-js-mock >=v0.3.1 <=1.0.0 and @elasticsearch/elasticsearch >7.13.0 <= 7.17.0 #31

Open
iacondios opened this issue Jun 14, 2023 · 0 comments

Comments

@iacondios
Copy link

We have a set of Elasticsearch client unit tests which make use of the mock interface. These tests were previously working using elasticsearch-js-mock v0.3.1 and an old version of Elasticsearchclient 7.6.1. Upon upgrading to the latest ES client 7.17, we also brought up the mock version to 1.0.0 (as it says it works with ES 7 clients). However, this causes the error:

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

to appear when the client getMapping endpoint is called. Further investigation shows that this error occurs for both elasticsearch-js-mock v0.3.1 and v1.0.0, with all elasticsearch 7 clients greater than 7.13.0. It appears that this problem was addressed a while ago for earlier versions of Elasticsearch, and thus 0.3.1 was born; could something have happened to break this version check with the latest versions of the Elasticsearchclient?

Full stack trace:
`
ProductNotSupportedError: The client noticed that the server is not Elasticsearch and we do not support this unknown product.

  75 | function getMappingFromElastic(params) {
  76 |     return __awaiter(this, void 0, void 0, function* () {
> 77 |         return client.indices.getMapping(params);
     |                               ^
  78 |     });
  79 | }
  80 | exports.getMappingFromElastic = getMappingFromElastic;

  at Transport.request (node_modules/@elastic/elasticsearch/lib/Transport.js:477:19)
  at IndicesApi.indicesGetMappingApi [as getMapping] (node_modules/@elastic/elasticsearch/api/api/indices.js:845:25)
  at getMapping (build/elasticsearch/elasticsearchClient.js:77:31)
  at next (build/elasticsearch/elasticsearchClient.js:8:71)
  at Object.<anonymous>.__awaiter (build/elasticsearch/elasticsearchClient.js:4:12)
  at __awaiter (build/elasticsearch/elasticsearchClient.js:76:12)
  at ElasticsearchMappingHelper.<anonymous> (build/elasticsearch/elasticsearchMappingHelper.js:35:83)
  at next (build/elasticsearch/elasticsearchMappingHelper.js:8:71)
  at Object.<anonymous>.__awaiter (build/elasticsearch/elasticsearchMappingHelper.js:4:12)
  at ElasticsearchMappingHelper.__awaiter [as getFieldNames] (build/elasticsearch/elasticsearchMappingHelper.js:29:16)
  at getFieldNames (build/elasticsearch/__testing__/elasticsearchMappingHelper.test.js:43:24)
  at next (build/elasticsearch/__testing__/elasticsearchMappingHelper.test.js:8:71)
  at Object.<anonymous>.__awaiter (build/elasticsearch/__testing__/elasticsearchMappingHelper.test.js:4:12)
  at Object.__awaiter (build/elasticsearch/__testing__/elasticsearchMappingHelper.test.js:42:40)

`

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

1 participant