Skip to content
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

Error while connecting to ES 6.4 #355

Closed
arsalan993 opened this issue Apr 28, 2021 · 15 comments
Closed

Error while connecting to ES 6.4 #355

arsalan993 opened this issue Apr 28, 2021 · 15 comments
Labels
question Further information is requested

Comments

@arsalan993
Copy link

I have two ES 6.4 databases. On one of it connects sucessfully while on other one it throws this error

elastalert_1  | 08:32:23.613Z  INFO elastalert-server: Router:  Listening for GET request on /config.
elastalert_1  | 08:32:23.617Z  INFO elastalert-server: ProcessController:  Starting ElastAlert
elastalert_1  | 08:32:23.617Z  INFO elastalert-server: ProcessController:  Creating index
elastalert_1  | 08:32:24.229Z ERROR elastalert-server:
elastalert_1  |     ProcessController:  Traceback (most recent call last):
elastalert_1  |       File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
elastalert_1  |         return _run_code(code, main_globals, None,
elastalert_1  |       File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
elastalert_1  |         exec(code, run_globals)
elastalert_1  |       File "/opt/elastalert/elastalert/create_index.py", line 268, in <module>
elastalert_1  |         main()
elastalert_1  |       File "/opt/elastalert/elastalert/create_index.py", line 250, in main
elastalert_1  |         es = Elasticsearch(
elastalert_1  |       File "/home/node/.local/lib/python3.8/site-packages/elasticsearch/client/__init__.py", line 206, in __init__
elastalert_1  |         self.transport = transport_class(_normalize_hosts(hosts), **kwargs)
elastalert_1  |       File "/home/node/.local/lib/python3.8/site-packages/elasticsearch/transport.py", line 108, in __init__
elastalert_1  |         self.set_connections(hosts)
elastalert_1  |       File "/home/node/.local/lib/python3.8/site-packages/elasticsearch/transport.py", line 157, in set_connections
elastalert_1  |         connections = list(zip(connections, hosts))
elastalert_1  |       File "/home/node/.local/lib/python3.8/site-packages/elasticsearch/transport.py", line 154, in _create_connection
elastalert_1  |         return self.connection_class(**kwargs)
elastalert_1  |       File "/home/node/.local/lib/python3.8/site-packages/elasticsearch/connection/http_requests.py", line 46, in __init__
elastalert_1  |         self.base_url = 'http%s://%s:%d%s' % (
elastalert_1  |     TypeError: %d format: a number is required, not str
elastalert_1  |     
elastalert_1  | 08:32:24.229Z ERROR elastalert-server: ProcessController:  Index create exited with code 1

Using ES python libraries i am able to connect to both and upload dataset and templates.. issue only comes with i connect via Elastalert via Praeco ..
for Elastalert i am using the docker image you shared

elastalert:
    image : 'praecoapp/elastalert-server:20200404_es6'
@nsano-rururu
Copy link
Collaborator

Do you mean that there are multiple ESs? .. I don't support it.

@nsano-rururu nsano-rururu added the question Further information is requested label Apr 28, 2021
@nsano-rururu
Copy link
Collaborator

nsano-rururu commented Apr 28, 2021

I'm thinking of stopping support for ES 6. Because I haven't used it at all.
It's not good to support not using it.

@nsano-rururu
Copy link
Collaborator

We do not support unsupported usage

@arsalan993
Copy link
Author

arsalan993 commented Apr 28, 2021

Definitely there are two seperate deployement of Paeco one for first ES server and other for 2nd ES server..
both ES servers are 6.4 .

Sir you are too agressive. I am asking questions respectfully and you take it too personal . Plz relax
I am just asking if it could be fix at your end.. as i mentioned earlier it run prefect for one server and when i connect to other server seperately it fail and put out the error i shared above

@nsano-rururu
Copy link
Collaborator

Isn't it strange that it can be fixed without being able to distinguish whether the setting is wrong or a bug? ..

@nsano-rururu
Copy link
Collaborator

Are you running on the same server? You can't tell without information about docker-compose and docker commands. I'm not a god.

@nsano-rururu
Copy link
Collaborator

What is a separate connection to another server? .. What kind of operation was done with what kind of setting? I don't know at all. Same docker container? Does that mean? .. Is it a connection to two ESs? What I don't understand at all is the real intention.

@nsano-rururu
Copy link
Collaborator

With only the current information, it seems that the connection is made in a strange way.

@arsalan993
Copy link
Author

arsalan993 commented Apr 28, 2021 via email

@nsano-rururu
Copy link
Collaborator

In the first place, elastalert-server does not support multiple elasticsearch connections. So is elastalert. When I searched for elastalert issues, I've seen the answer that HAProxy should be used for ES cluster configurations.

@arsalan993
Copy link
Author

arsalan993 commented Apr 28, 2021 via email

@nsano-rururu
Copy link
Collaborator

There is a pull request in elastalert for connecting multiple ESs, but there is currently no sign of being captured.
feat: suport for multi es instances #3109

@nsano-rururu
Copy link
Collaborator

Conclusion. ElastAlert and ElastAlertServer only support connecting to one ES. If it is supported, it cannot be supported unless both ElastAlert and ElastAlertServer are supported.

@nsano-rururu
Copy link
Collaborator

No matter how much I investigated, the implementation is so, so the current situation can not be helped.

@nsano-rururu
Copy link
Collaborator

By the way, maintenance of elastalert is stopped.

Repository owner locked and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants