elastalert can't connect to AWS elasticsearch, error message appears to log bug

Created on 20 Feb 2019  路  2Comments  路  Source: Yelp/elastalert

I have tried to set the es_host and es_port both using the config file and passing --config to elastalert-create-index and I have tried feeding the host and port to the elastalert-create-index cli, and both times I get the following error:

Traceback (most recent call last): File "/usr/bin/elastalert-create-index", line 11, in <module> load_entry_point('elastalert==0.1.38', 'console_scripts', 'elastalert-create-index')() File "/usr/lib/python2.7/site-packages/elastalert/create_index.py", line 129, in main esversion = es.info()["version"]["number"] File "/usr/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 76, in _wrapped return func(*args, params=params, **kwargs) File "/usr/lib/python2.7/site-packages/elasticsearch/client/__init__.py", line 241, in info return self.transport.perform_request('GET', '/', params=params) File "/usr/lib/python2.7/site-packages/elasticsearch/transport.py", line 318, in perform_request status, headers_response, data = connection.perform_request(method, url, params, body, headers=headers, ignore=ignore, timeout=timeout) File "/usr/lib/python2.7/site-packages/elasticsearch/connection/http_requests.py", line 85, in perform_request raise ConnectionError('N/A', str(e), e) elasticsearch.exceptions.ConnectionError: ConnectionError(HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //vpc-****************************-east-1.es.amazonaws.com:443/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3f8ab43450>: Failed to establish a new connection: [Errno -2] Name or service not known',))) caused by: ConnectionError(HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //vpc-****************************-east-1.es.amazonaws.com:443 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3f8ab43450>: Failed to establish a new connection: [Errno -2] Name or service not known',)))

I am confused why it is setting the host to 'https' and port to '80' at the HTTPConnectionPool function, because I explicitly set the host to the aws elasticsearch host and the port to 443. It seems like it's breaking the host url up and mistakenly setting it as 'https' while the url is being set to the rest of the host url. And I'm not sure why the port is being set to 80 because this is incorrect and not the port I provided. I can successfully curl the elasticsearch host.

Most helpful comment

Don't include https:// in the es_host settings. That should only include the hostname. IE: vpc-****************************-east-1.es.amazonaws.com. es_port is where you'd set 443 as well, and use_ssl: true.

All 2 comments

Don't include https:// in the es_host settings. That should only include the hostname. IE: vpc-****************************-east-1.es.amazonaws.com. es_port is where you'd set 443 as well, and use_ssl: true.

@Qmando this worked, thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaximilianKaltner picture MaximilianKaltner  路  3Comments

abhishekjiitr picture abhishekjiitr  路  3Comments

vaibhavtupe picture vaibhavtupe  路  4Comments

shortstack picture shortstack  路  3Comments

PMDubuc picture PMDubuc  路  3Comments