domainaware / parsedmarc

A Python package and CLI for parsing aggregate and forensic DMARC reports
https://domainaware.github.io/parsedmarc/
Apache License 2.0
1.01k stars 217 forks source link

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

Closed robertomoutinho closed 2 years ago

robertomoutinho commented 2 years ago

Error Message when using OpenSearch (AWS)

elasticsearch.exceptions.UnsupportedProductError: The client noticed that the server is not a supported distribution of Elasticsearch
Traceback (most recent call last):
--
File "/opt/pypy/bin/parsedmarc", line 8, in <module>
sys.exit(_main())
File "/opt/pypy/lib/pypy3.9/site-packages/parsedmarc/cli.py", line 620, in _main
elastic.migrate_indexes(aggregate_indexes=[es_aggregate_index],
File "/opt/pypy/lib/pypy3.9/site-packages/parsedmarc/elastic.py", line 244, in migrate_indexes
if not Index(aggregate_index_name).exists():
File "/opt/pypy/lib/pypy3.9/site-packages/elasticsearch_dsl/index.py", line 414, in exists
return self._get_connection(using).indices.exists(index=self._name, **kwargs)
File "/opt/pypy/lib/pypy3.9/site-packages/elasticsearch/client/utils.py", line 347, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
File "/opt/pypy/lib/pypy3.9/site-packages/elasticsearch/client/indices.py", line 371, in exists
return self.transport.perform_request(
File "/opt/pypy/lib/pypy3.9/site-packages/elasticsearch/transport.py", line 421, in perform_request
_ProductChecker.raise_error(self._verified_elasticsearch)
File "/opt/pypy/lib/pypy3.9/site-packages/elasticsearch/transport.py", line 638, in raise_error
raise UnsupportedProductError(message)

Useful links:

https://github.com/elastic/elasticsearch-py/issues/1667 https://towardsaws.com/elasticsearch-the-server-is-not-a-supported-distribution-of-elasticsearch-252abc1bd92

robertomoutinho commented 2 years ago

PR : https://github.com/domainaware/parsedmarc/pull/297

kir-b commented 2 years ago

hi @robertomoutinho @seanthegeek Perhaps this PR didn't fix this issue completely. I tried with parsedmarc version 8.0.2 and it not connected to AWS OpenSearch.

 File "/usr/local/bin/parsedmarc", line 8, in <module>
   sys.exit(_main())
 File "/usr/local/lib/python3.8/dist-packages/parsedmarc/cli.py", line 686, in _main
   elastic.migrate_indexes(aggregate_indexes=[es_aggregate_index],
 File "/usr/local/lib/python3.8/dist-packages/parsedmarc/elastic.py", line 244, in migrate_indexes
   if not Index(aggregate_index_name).exists():
 File "/usr/local/lib/python3.8/dist-packages/elasticsearch_dsl/index.py", line 414, in exists
   return self._get_connection(using).indices.exists(index=self._name, **kwargs)
 File "/usr/local/lib/python3.8/dist-packages/elasticsearch/client/utils.py", line 347, in _wrapped
   return func(*args, params=params, headers=headers, **kwargs)
 File "/usr/local/lib/python3.8/dist-packages/elasticsearch/client/indices.py", line 371, in exists
   return self.transport.perform_request(
 File "/usr/local/lib/python3.8/dist-packages/elasticsearch/transport.py", line 421, in perform_request
   _ProductChecker.raise_error(self._verified_elasticsearch)
 File "/usr/local/lib/python3.8/dist-packages/elasticsearch/transport.py", line 638, in raise_error
   raise UnsupportedProductError(message)
 elasticsearch.exceptions.UnsupportedProductError: The client noticed that the server is not a supported distribution of Elasticsearch

I used a workaround elasticsearch==7.13.4 and it fixed the issue.