You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I got an error while analyzing a timeline using the Yeti analyzer in Timesketch, both running in Docker. Although they can ping each other, Timesketch shows a connection error when using the Yeti API, despite Yeti receiving authorized requests from Timesketch.
I am using Docker to manage both Timesketch and Yeti, I ensured both containers are on the same network and can ping each other.
I did configure the YETI API in the timesketch conf:
# URI root to Yeti's API, e.g. 'https://localhost:8000/api/v2'
YETI_API_ROOT = 'http://localhost:8000/api/v2'
# API key to authenticate requests
YETI_API_KEY = 'my_API_key'
I set up the Docker configuration for Yeti, using port 8000 for the Yeti API and port 80 for the frontend.
Connection Errors: Timesketch is unable to connect to the Yeti API, resulting in connection refused errors as below:
2025-02-01 15:37:05 yetiinvestigations
Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 199, in _new_conn sock = connection.create_connection( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 789, in urlopen response = self._make_request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 495, in _make_request conn.request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 441, in request self.endheaders() File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output self.send(msg) File "/usr/lib/python3.10/http/client.py", line 976, in send self.connect() File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 279, in connect self.sock = self._new_conn() File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 214, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fb0a4b7ee60>: Failed to establish a new connection: [Errno 111] Connection refused The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 843, in urlopen retries = retries.increment( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/retry.py", line 519, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v2/auth/api-token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb0a4b7ee60>: Failed to establish a new connection: [Errno 111] Connection refused')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/interface.py", line 1188, in run_wrapper result = self.run() File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 479, in run entities = self.get_entities(type_selector=self._TYPE_SELECTOR) File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 212, in get_entities data = self._get_entities_request({"query": query, "count": 0}) File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 180, in _get_entities_request results = self.authenticated_session.post( File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 113, in authenticated_session self.authenticate_session() File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 119, in authenticate_session response = self._yeti_session.post( File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 637, in post return self.request("POST", url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 700, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v2/auth/api-token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb0a4b7ee60>: Failed to establish a new connection: [Errno 111] Connection refused')) ERROR
Hey @Cap333333, this error probably comes from the fact that you're instructing yeti to connect to localhost but nothing is listening on that port on the docker container. You need to use the hostname that is attributed to the container in the docker network (the same one you used to test for ping connectivity)
Describe the bug
I got an error while analyzing a timeline using the Yeti analyzer in Timesketch, both running in Docker. Although they can ping each other, Timesketch shows a connection error when using the Yeti API, despite Yeti receiving authorized requests from Timesketch.
Steps of reproduce
Run example from https://yeti-platform.io/guides/indicators-timesketch/infrastructure-setup/
Connection Errors:
Timesketch is unable to connect to the Yeti API, resulting in connection refused errors as below:
2025-02-01 15:37:05 yetiinvestigations
Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 199, in _new_conn sock = connection.create_connection( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 789, in urlopen response = self._make_request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 495, in _make_request conn.request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 441, in request self.endheaders() File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output self.send(msg) File "/usr/lib/python3.10/http/client.py", line 976, in send self.connect() File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 279, in connect self.sock = self._new_conn() File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 214, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fb0a4b7ee60>: Failed to establish a new connection: [Errno 111] Connection refused The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 843, in urlopen retries = retries.increment( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/retry.py", line 519, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v2/auth/api-token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb0a4b7ee60>: Failed to establish a new connection: [Errno 111] Connection refused')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/interface.py", line 1188, in run_wrapper result = self.run() File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 479, in run entities = self.get_entities(type_selector=self._TYPE_SELECTOR) File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 212, in get_entities data = self._get_entities_request({"query": query, "count": 0}) File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 180, in _get_entities_request results = self.authenticated_session.post( File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 113, in authenticated_session self.authenticate_session() File "/usr/local/lib/python3.10/dist-packages/timesketch/lib/analyzers/yetiindicators.py", line 119, in authenticate_session response = self._yeti_session.post( File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 637, in post return self.request("POST", url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 700, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v2/auth/api-token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb0a4b7ee60>: Failed to establish a new connection: [Errno 111] Connection refused')) ERROR
Yeti frontend log:
Yeti API log:
Screenshots of timesketch error

Additional context
timesketch version: deploy docker through https://github.com/google/timesketch/blob/master/contrib/deploy_timesketch.sh
yeti version: deploy through https://github.com/yeti-platform/yeti-docker
The text was updated successfully, but these errors were encountered: