Elastalert: ElastAlert not starting: "ElasticSearchClient object has no attritbute 'ccr'"

Created on 20 Jan 2020  路  2Comments  路  Source: Yelp/elastalert

Hi,

I'm new to ElastAlert. I tried to install it using the follwing steps:

sudo git clone https://github.com/Yelp/elastalert.git
sudo pip3 install "setuptools>=11.3"
sudo python3 setup.py install
sudo pip3 install "elasticsearch>=5.0.0"

When I try to run just the command "elastalert" i get the follwing error:

Traceback (most recent call last):
File "/home/fpadmin/.local/bin/elastalert", line 11, in
sys.exit(main())
File "/home/fpadmin/.local/lib/python3.6/site-packages/elastalert/elastalert.py", line 2034, in main
client = ElastAlerter(args)
File "/home/fpadmin/.local/lib/python3.6/site-packages/elastalert/elastalert.py", line 138, in __init__
self.rules = self.rules_loader.load(self.conf, self.args)
File "/home/fpadmin/.local/lib/python3.6/site-packages/elastalert/loaders.py", line 125, in load
raise EAException('Error loading file %s: %s' % (rule_file, e))
elastalert.util.EAException: Error loading file example_rules/example_new_term.yaml: Error initializing rule Example new term rule: Error searching for existing terms: AttributeError("'ElasticSearchClient' object has no attribute 'ccr'",)

I'm a little bit lost here so any help would be greatly appreciated.
I'm running ubuntu 18.04 and python 3.6.7.

Most helpful comment

I have a similar issue that just started today:

AttributeError: 'ElasticSearchClient' object has no attribute 'ccr'
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/elastalert/elastalert/elastalert/elastalert.py", line 2056, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/elastalert/elastalert/elastalert/elastalert.py", line 2050, in main
    client = ElastAlerter(args)
  File "/home/elastalert/elastalert/elastalert/elastalert.py", line 169, in __init__
    self.writeback_es = elasticsearch_client(self.conf)
  File "/home/elastalert/elastalert/elastalert/util.py", line 327, in elasticsearch_client
    return ElasticSearchClient(es_conn_conf)
  File "/home/elastalert/elastalert/elastalert/__init__.py", line 30, in __init__
    client_key=conf['client_key'])
  File "/home/elastalert/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py", line 239, in __init__
    self.xpack = XPackClient(self)
  File "/home/elastalert/.local/lib/python3.6/site-packages/elasticsearch/client/xpack/__init__.py", line 42, in __init__
    setattr(self, namespace, getattr(self.client, namespace))

I was able to get Elastalert to work by commenting out the following lines in /home/elastalert/.local/lib/python3.6/site-packages/elasticsearch/client/xpack/__init__.py:

#        for namespace in XPACK_NAMESPACES:
#            setattr(self, namespace, getattr(self.client, namespace))

This makes me wonder if this is an underlying problem with the elasticsearch module for Python.

All 2 comments

I have a similar issue that just started today:

AttributeError: 'ElasticSearchClient' object has no attribute 'ccr'
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/elastalert/elastalert/elastalert/elastalert.py", line 2056, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/elastalert/elastalert/elastalert/elastalert.py", line 2050, in main
    client = ElastAlerter(args)
  File "/home/elastalert/elastalert/elastalert/elastalert.py", line 169, in __init__
    self.writeback_es = elasticsearch_client(self.conf)
  File "/home/elastalert/elastalert/elastalert/util.py", line 327, in elasticsearch_client
    return ElasticSearchClient(es_conn_conf)
  File "/home/elastalert/elastalert/elastalert/__init__.py", line 30, in __init__
    client_key=conf['client_key'])
  File "/home/elastalert/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py", line 239, in __init__
    self.xpack = XPackClient(self)
  File "/home/elastalert/.local/lib/python3.6/site-packages/elasticsearch/client/xpack/__init__.py", line 42, in __init__
    setattr(self, namespace, getattr(self.client, namespace))

I was able to get Elastalert to work by commenting out the following lines in /home/elastalert/.local/lib/python3.6/site-packages/elasticsearch/client/xpack/__init__.py:

#        for namespace in XPACK_NAMESPACES:
#            setattr(self, namespace, getattr(self.client, namespace))

This makes me wonder if this is an underlying problem with the elasticsearch module for Python.

can you Please help me is kibna elastalert plugin and elastlaert server both need for alert?

Was this page helpful?
0 / 5 - 0 ratings