Opensearch - RequestError(400, 'no handler found for uri [/status44/elastalert_error] and method [POST]'
AryaDavidson opened this issue · 4 comments
Hello,
I got an error while running the command in the opensearch server( elastalert --config /home/ubuntu/elastalert2/examples/config.yaml --verbose --rule /home/ubuntu/elastalert2/examples/rules/example_frequency.yaml ). Anything to solve it?
root@ubuntu:/home/ubuntu/elastalert2# elastalert --config /home/ubuntu/elastalert2/examples/config.yaml --verbose --rule /home/ubuntu/elastalert2/examples/rules/example_frequency.yaml
1 rules loaded
/usr/local/lib/python3.8/dist-packages/elasticsearch/connection/http_requests.py:134: UserWarning: Connecting to https://localhost:9200 using SSL with verify_certs=False is insecure.
warnings.warn(
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
warnings.warn(
2022-07-05 03:19:48,697 INFO elastalert Starting up
2022-07-05 03:19:48,699 INFO elastalert Disabled rules are: []
2022-07-05 03:19:48,699 INFO elastalert Sleeping for 59.999778 seconds
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
warnings.warn(
2022-07-05 03:19:52,707 ERROR root Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 1269, in handle_rule_execution
num_matches = self.run_rule(rule, endtime, rule.get('initial_starttime'))
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 868, in run_rule
self.set_starttime(rule, endtime)
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 711, in set_starttime
last_run_end = self.get_starttime(rule)
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 692, in get_starttime
res = self.writeback_es.deprecated_search(index=index, doc_type=doc_type,
File "/usr/local/lib/python3.8/dist-packages/elasticsearch/client/utils.py", line 152, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
TypeError: deprecated_search() got an unexpected keyword argument 'headers'
2022-07-05 03:19:52,708 ERROR root Uncaught exception running rule Action_test_alert: deprecated_search() got an unexpected keyword argument 'headers'
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
warnings.warn(
2022-07-05 03:19:52,710 WARNING elasticsearch POST https://localhost:9200/status44/elastalert_error [status:400 request:0.002s]
2022-07-05 03:19:52,710 ERROR root Error writing alert info to Elasticsearch: RequestError(400, 'no handler found for uri [/status44/elastalert_error] and method [POST]', 'no handler found for uri [/status44/elastalert_error] and method [POST]')
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 1269, in handle_rule_execution
num_matches = self.run_rule(rule, endtime, rule.get('initial_starttime'))
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 868, in run_rule
self.set_starttime(rule, endtime)
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 711, in set_starttime
last_run_end = self.get_starttime(rule)
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 692, in get_starttime
res = self.writeback_es.deprecated_search(index=index, doc_type=doc_type,
File "/usr/local/lib/python3.8/dist-packages/elasticsearch/client/utils.py", line 152, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
TypeError: deprecated_search() got an unexpected keyword argument 'headers'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/elastalert/elastalert.py", line 1616, in writeback
res = self.writeback_es.index(index=index, doc_type=doc_type, body=body)
File "/usr/local/lib/python3.8/dist-packages/elasticsearch/client/utils.py", line 152, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/elasticsearch/client/init.py", line 398, in index
return self.transport.perform_request(
File "/usr/local/lib/python3.8/dist-packages/elasticsearch/transport.py", line 392, in perform_request
raise e
File "/usr/local/lib/python3.8/dist-packages/elasticsearch/transport.py", line 358, in perform_request
status, headers_response, data = connection.perform_request(
File "/usr/local/lib/python3.8/dist-packages/elasticsearch/connection/http_requests.py", line 199, in perform_request
self._raise_error(response.status_code, raw_data)
File "/usr/local/lib/python3.8/dist-packages/elasticsearch/connection/base.py", line 315, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.RequestError: RequestError(400, 'no handler found for uri [/status44/elastalert_error] and method [POST]', 'no handler found for uri [/status44/elastalert_error] and method [POST]')
2022-07-05 03:19:52,713 INFO elastalert Rule Action_test_alert disabled
elastalert is no longer maintained
yelp/elastalert does not support OpenSearch
Did you understand?