-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Got an error with "TypeError: deprecated_search() got an unexpected keyword argument 'headers'" #2725
Comments
The same here with elastalert 0.2.1 and elasticsearch 7.6. Pip freeze: |
Thanks in advance, is there some input upon how to solve the problem? |
I also encounter same issue. |
Hi Team, I also got the same error. Couldn't find what's going wrong. Even the example rule in elastalert git folder(example_rules/example_percentage_match.yaml) itself is not working. Seems there is a bug in elastalert. Please let me know if any one found the problem/solution to proceed further. |
Same error, with the last version of elastalert:
|
Has anyone found any previous version which works fine without this error? Please let me know if anyone finds some way to proceed further. I'm also trying to find out a way to proceed further and will let you know if I find something. |
use elasticsearch==7.0.0, elasticsearch==7.6.1 will cause this error! |
Hi ThinkMo, We didn't get you what to use. Earlier I was using elasticsearch-7.6.1, after your comment I've downloaded elasticsearch-7.1.0 and started it. When I try to check existing example rule by below command: still I'm getting same error(TypeError: deprecated_search() got an unexpected keyword argument 'headers') Am I missing anything or doing anything wrong? Please help. |
sorry, try this i first pip install elasticsearch==7.1.0, same error as you |
I also got the same error with combination of So I version downed python elasticsearch library as below. After that, the problem was solved with combination of I guess there seems to be something wrong with combination of library |
Hi ThinkMo, Thank you. After trying with pip install elasticsearch=7.0.0, I didn't get that error after executing rules. Thanks a lot. Seems there is no link with the elasticsearch server we are running(whether it's 7.6.1 or 7.1.0). Only pip install elasticsearch=7.0.0 has to be installed and it worked. |
Hi All, I'm able to proceed further but when I try to use alert type as stomp, it's not working as expected. |
Running into the same error. I had some success in manually installing |
Tried with |
It appears that there were some breaking changes in Old definition: This specifically affects elastalert/elastalert/test_rule.py Line 86 in 4ebdabf
elastalert/elastalert/test_rule.py Line 156 in 4ebdabf
I'd guess that similar breaking changes were the reason behind the other errors referenced in this issue. |
hi so what to do in this case? The repository is not fixed, can send PR? |
any news on this case ? |
Has anyone resolved this? I get the same error with the combination of elastalert : 0.2.1 and elastic search 7.5.1 |
Please let me know if you know the situation. |
I tried it with elasticsearch-py 7.10.0 and ElastAlert 0.2.4. The correction method is as follows. test_rules.py Line86 res = es_client.search(index, size=1, body=query, ignore_unavailable=True) Line112 res = es_client.count(index, doc_type=doc_type, body=count_query, ignore_unavailable=True) Line 156 res = es_client.search(index, size=args.max_query_size, body=query, ignore_unavailable=True) |
When I created a new index, the following warning was output, but it did not affect the operation of Elast Alert. No warning was output in the environment where the index of ElastAlert has already been created.
|
Hello, |
I was trying to have a try with a simple alert, but go an error, searched with goole, without getting any result, the exception stack as following:
[root@elasticsearch ~]# elastalert-test-rule --config config.yaml /root/alert_rules/cpu_too_high.yaml
INFO:elastalert:Note: In debug mode, alerts will be logged to console but NOT actually sent.
To send them but remain verbose, use --verbose instead.
Error running your filter:
TypeError("search() got multiple values for argument 'body'",)
INFO:elastalert:Note: In debug mode, alerts will be logged to console but NOT actually sent.
To send them but remain verbose, use --verbose instead.
1 rules loaded
INFO:apscheduler.scheduler:Adding job tentatively -- it will be properly scheduled when the scheduler starts
Traceback (most recent call last):
File "/usr/local/bin/elastalert-test-rule", line 11, in
load_entry_point('elastalert==0.2.1', 'console_scripts', 'elastalert-test-rule')()
File "/usr/local/lib/python3.6/site-packages/elastalert/test_rule.py", line 445, in main
test_instance.run_rule_test()
File "/usr/local/lib/python3.6/site-packages/elastalert/test_rule.py", line 437, in run_rule_test
self.run_elastalert(rule_yaml, conf, args)
File "/usr/local/lib/python3.6/site-packages/elastalert/test_rule.py", line 318, in run_elastalert
client.run_rule(rule, endtime, starttime)
File "/usr/local/lib/python3.6/site-packages/elastalert/elastalert.py", line 883, in run_rule
if not self.run_query(rule, rule['starttime'], tmp_endtime):
File "/usr/local/lib/python3.6/site-packages/elastalert/elastalert.py", line 630, in run_query
data = self.get_hits_aggregation(rule, start, end, index, rule.get('query_key', None))
File "/usr/local/lib/python3.6/site-packages/elastalert/elastalert.py", line 564, in get_hits_aggregation
body=query, size=0, ignore_unavailable=True)
File "/usr/local/lib/python3.6/site-packages/elasticsearch/client/utils.py", line 92, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
TypeError: deprecated_search() got an unexpected keyword argument 'headers'
Environment information:
OS version: CentOS Linux release 7.7.1908 (Core)
Elasticsearch version: 7.6.1
Python version: 3.6.8
The text was updated successfully, but these errors were encountered: