OpenHands
OpenHands copied to clipboard
[Bug]: urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=38950): Max retries exceeded with url: /alive (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7300d8787f80>, 'Connection to host.docker.internal timed out. (connect timeout=None)'))
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Describe the bug and reproduction steps
Why I am getting this error while I am running openhands in my local PC,
` ERROR:asyncio:Future exception was never retrieved future: <Future finished exception=ConnectTimeout(MaxRetryError("HTTPConnectionPool(host='host.docker.internal', port=38950): Max retries exceeded with url: /alive (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7300d8787f80>, 'Connection to host.docker.internal timed out. (connect timeout=None)'))"))> Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 199, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: [Errno 110] Connection timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request conn.request( File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 441, in request self.endheaders() File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output self.send(msg) File "/usr/local/lib/python3.12/http/client.py", line 1035, in send self.connect() File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 279, in connect self.sock = self._new_conn() ^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 208, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7300d8787f80>, 'Connection to host.docker.internal timed out. (connect timeout=None)')
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-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='host.docker.internal', port=38950): Max retries exceeded with url: /alive (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7300d8787f80>, 'Connection to host.docker.internal timed out. (connect timeout=None)'))
`
OpenHands Installation
Docker command in README
OpenHands Version
main
Operating System
Linux
Logs, Errors, Screenshots, and Additional Context
ERROR:asyncio:Future exception was never retrieved future: <Future finished exception=ConnectTimeout(MaxRetryError("HTTPConnectionPool(host='host.docker.internal', port=38950): Max retries exceeded with url: /alive (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7300d8787f80>, 'Connection to host.docker.internal timed out. (connect timeout=None)'))"))> Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 199, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: [Errno 110] Connection timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request conn.request( File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 441, in request self.endheaders() File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output self.send(msg) File "/usr/local/lib/python3.12/http/client.py", line 1035, in send self.connect() File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 279, in connect self.sock = self._new_conn() ^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 208, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7300d8787f80>, 'Connection to host.docker.internal timed out. (connect timeout=None)')
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-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='host.docker.internal', port=38950): Max retries exceeded with url: /alive (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7300d8787f80>, 'Connection to host.docker.internal timed out. (connect timeout=None)'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/openhands/server/session/agent_session.py", line 92, in _start_thread
asyncio.run(self._start(*args), debug=True)
File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/app/openhands/server/session/agent_session.py", line 108, in _start
await self._create_runtime(
File "/app/openhands/server/session/agent_session.py", line 196, in _create_runtime
await self.runtime.connect()
File "/app/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 248, in connect
await call_sync_from_async(self._wait_until_alive)
File "/app/openhands/utils/async_utils.py", line 18, in call_sync_from_async
result = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/openhands/utils/async_utils.py", line 17, in