[Bug]: UI breaks when sandbox use_host_network = true
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Describe the bug and reproduction steps
On the conversation view, there are no workspace files shown when use_host_network is set to true, either via config.toml or via the Docker startup argument -e SANDBOX_USE_HOST_NETWORK=True.
There seems to be no error in the logs other than Max retries exceeded with url: /alive. This error only appears when the sandbox is in host networking mode.
OpenHands Installation
Docker command in README
OpenHands Version
0.17.0 and main
Operating System
Linux
Logs, Errors, Screenshots, and Additional Context
Actions taken so far:
- Initially ran the
make runcommand - Opened a new browser tab and navigated to
http://172.16.31.36:3000/ - Under "Open a Repo", selected the repo I'm testing with
- Waited a minute for the sandbox to start up
- Waited a few more minutes for the
/aliveerror to appear - No other actions taken (UI clicks, etc.)
Config.toml
root@debian:~# cd OpenHands-0.17.0/
root@debian:~/OpenHands-0.17.0# cat config.toml
[core]
debug = true
workspace_base="/root/workspace"
[llm]
model="claude-3-5-sonnet-20240620"
api_key="sk-ant-api03-REDACTED"
embedding_model="openai"
[sandbox]
use_host_network = true
# This seems to not do anything. Ports not exposed, and connection refused when I ask the LLM to host an HTML on 0.0.0.0:8080 (I try to open it via the host's IP http://172.16.31.36:8080)
# Only use_host_network = true takes this work, but causes this UI bug.
#runtime_extra_build_args = ["-p 80:80", "-p 443:443", "-p 8080:8080", "--add-host=host.docker.internal:host-gateway"]
base_container_image = "docker.all-hands.dev/all-hands-ai/runtime:0.17-nikolaik"
user_id = 1000
root@debian:~/OpenHands-0.17.0#
Logs from when I initially run the command.
root@debian:~/OpenHands-0.17.0# export SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.17-nikolaik && make run
Running the app...
Starting backend server...
Waiting for the backend to start...
10:04:34 - openhands:INFO: openhands_config.py:45 - Using config class None
INFO: Started server process [84869]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)
Backend started successfully.
Starting frontend...
> [email protected] dev
> npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev --port 3001 --host 0.0.0.0
> [email protected] make-i18n
> node scripts/make-i18n-translations.cjs
➜ Local: http://localhost:3001/
➜ Network: http://172.16.31.36:3001/
➜ press h + enter to show help
INFO: 100.68.1.254:33684 - "GET / HTTP/1.1" 200 OK
INFO: 100.68.1.254:33684 - "GET /assets/root-ylwWBjxm.css HTTP/1.1" 200 OK
INFO: 100.68.1.254:33689 - "GET /assets/react-redux-J4J19tVa.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33688 - "GET /assets/user-prefs-context-ALUTwN5Q.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33685 - "GET /assets/manifest-3f8e9d1f.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33686 - "GET /assets/entry.client-DIcdkeUx.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33687 - "GET /assets/chunk-7R3XDUXW-URnwwGkp.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33684 - "GET /assets/open-hands-Lultsy7H.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33686 - "GET /assets/index-DwvdE0vs.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33689 - "GET /assets/mutation-DvvF6Vri.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33685 - "GET /assets/infiniteQueryBehavior-BSEvPUo5.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33688 - "GET /assets/store-Bmp12mKl.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33687 - "GET /assets/index-Bwy_YTFf.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33685 - "GET /assets/with-props-Cxq9eg57.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33684 - "GET /assets/auth-context-BZTkkKaW.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33687 - "GET /assets/root-D69xtlqo.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33686 - "GET /assets/browser-slice-CINbvrcl.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33689 - "GET /assets/initial-query-slice-CSE8L-ER.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33687 - "GET /locales/en/translation.json HTTP/1.1" 200 OK
INFO: 100.68.1.254:33686 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 100.68.1.254:33689 - "GET /assets/route-B7fC1y02.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33687 - "GET /assets/route-C6ulZeGi.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33686 - "GET /assets/upload-image-input-dmWvAyc8.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33684 - "GET /assets/useMutation-CUdmGtpR.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33687 - "GET /assets/chunk-VHPYXGWP-CLnBs4E7.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33689 - "GET /assets/github-logo-B-uB5HV7.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33685 - "GET /assets/chunk-DBLREEYE-C53uG3fF.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33688 - "GET /assets/declaration-BM4JyF2q.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33689 - "GET /assets/use-end-session-Djkspvge.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33684 - "GET /assets/arrow-send-DSD2mgem.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33684 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 100.68.1.254:33685 - "GET /api/options/models HTTP/1.1" 200 OK
INFO: 100.68.1.254:33685 - "GET /api/options/agents HTTP/1.1" 200 OK
INFO: 100.68.1.254:33685 - "GET /api/options/security-analyzers HTTP/1.1" 200 OK
INFO: 100.68.1.254:33685 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 100.68.1.254:33689 - "GET /api/github/repositories?sort=pushed&page=1&per_page=100 HTTP/1.1" 200 OK
INFO: 100.68.1.254:33689 - "GET /api/github/repositories?sort=pushed&page=2&per_page=100 HTTP/1.1" 200 OK
10:05:10 - openhands:INFO: manager.py:308 - maybe_start_agent_loop:81c4fd1278c640d4ba0d9edc46c38c9a
10:05:10 - openhands:INFO: manager.py:311 - start_agent_loop:81c4fd1278c640d4ba0d9edc46c38c9a
10:05:10 - openhands:INFO: manager.py:325 - _get_event_stream:81c4fd1278c640d4ba0d9edc46c38c9a
10:05:10 - openhands:INFO: manager.py:328 - found_local_agent_loop:81c4fd1278c640d4ba0d9edc46c38c9a
INFO: 100.68.1.254:33707 - "POST /api/conversations HTTP/1.1" 200 OK
INFO: 100.68.1.254:33707 - "GET /assets/route-CI2AQ5Mv.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33709 - "GET /assets/route-Cy_TCC_n.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33709 - "GET /assets/route-C4qqPFdq.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33707 - "GET /assets/toast-8989aPnj.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33711 - "GET /assets/scroll-to-bottom-button-CSGgoOXc.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33710 - "GET /assets/iconBase-x3IajY64.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33712 - "GET /assets/index-DPnOFSrA.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33709 - "GET /assets/terminal-CkusbHbk.js HTTP/1.1" 200 OK
INFO: 100.68.1.254:33711 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: ('100.68.1.254', 33713) - "WebSocket /socket.io/?latest_event_id=-1&conversation_id=81c4fd1278c640d4ba0d9edc46c38c9a&EIO=4&transport=websocket" [accepted]
10:05:10 - openhands:INFO: listen_socket.py:27 - sio:connect: jWoOLN5COcAZnMbJAAAB
10:05:10 - openhands:INFO: manager.py:182 - join_conversation:81c4fd1278c640d4ba0d9edc46c38c9a:jWoOLN5COcAZnMbJAAAB
10:05:10 - openhands:INFO: manager.py:325 - _get_event_stream:81c4fd1278c640d4ba0d9edc46c38c9a
10:05:10 - openhands:INFO: manager.py:328 - found_local_agent_loop:81c4fd1278c640d4ba0d9edc46c38c9a
10:05:11 - openhands:INFO: eventstream_runtime.py:182 - [runtime 81c4fd1278c640d4ba0d9edc46c38c9a] Starting runtime with image: docker.all-hands.dev/all-hands-ai/runtime:0.17-nikolaik
10:05:11 - openhands:WARNING: eventstream_runtime.py:248 - [runtime 81c4fd1278c640d4ba0d9edc46c38c9a] Using host network mode. If you are using MacOS, please make sure you have the latest version of Docker Desktop and enabled host network feature: https://docs.docker.com/network/drivers/host/#docker-desktop
10:05:11 - openhands:INFO: eventstream_runtime.py:186 - [runtime 81c4fd1278c640d4ba0d9edc46c38c9a] Container started: openhands-runtime-81c4fd1278c640d4ba0d9edc46c38c9a. VSCode URL: None
10:05:11 - openhands:INFO: eventstream_runtime.py:194 - [runtime 81c4fd1278c640d4ba0d9edc46c38c9a] Waiting for client to become ready at http://localhost:38130...
10:05:50 - openhands:INFO: eventstream_runtime.py:200 - [runtime 81c4fd1278c640d4ba0d9edc46c38c9a] Runtime is ready.
10:05:50 - openhands:INFO: base.py:216 - [runtime 81c4fd1278c640d4ba0d9edc46c38c9a] Cloning repo: pandalion98/openhands-test
10:05:50 - openhands:ERROR: base.py:231 - [runtime 81c4fd1278c640d4ba0d9edc46c38c9a] Failed to read openhands_instructions
10:05:50 - openhands:INFO: base.py:239 - [runtime 81c4fd1278c640d4ba0d9edc46c38c9a] Found 0 custom microagents.
10:05:50 - openhands:INFO: agent_controller.py:204 - [Agent Controller 81c4fd1278c640d4ba0d9edc46c38c9a] Starting step loop...
10:05:50 - openhands:INFO: agent_controller.py:347 - [Agent Controller 81c4fd1278c640d4ba0d9edc46c38c9a] Setting agent(CodeActAgent) state from AgentState.LOADING to AgentState.INIT
INFO: 100.68.1.254:33750 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 100.68.1.254:33750 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 100.68.1.254:33772 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 100.68.1.254:33740 - "GET /api/conversations/81c4fd1278c640d4ba0d9edc46c38c9a/vscode-url HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
+ Exception Group Traceback (most recent call last):
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 76, in collapse_excgroups
| yield
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 186, in __call__
| async with anyio.create_task_group() as task_group:
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 763, in __aexit__
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/engineio/async_drivers/asgi.py", line 75, in __call__
| await self.other_asgi_app(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
| await super().__call__(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
| await self.middleware_stack(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
| raise exc
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
| await self.app(scope, receive, _send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
| with collapse_excgroups():
| File "/usr/local/lib/python3.12/contextlib.py", line 155, in __exit__
| self.gen.throw(value)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
| raise exc
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
| response = await self.dispatch_func(request, call_next)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/server/middleware.py", line 157, in __call__
| response = await self._attach_conversation(request)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/server/middleware.py", line 137, in _attach_conversation
| request.state.conversation = await session_manager.attach_to_conversation(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/server/session/manager.py", line 170, in attach_to_conversation
| await c.connect()
| File "/root/OpenHands-0.17.0/openhands/server/session/conversation.py", line 43, in connect
| await self.runtime.connect()
| File "/root/OpenHands-0.17.0/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 197, in connect
| await call_sync_from_async(self._wait_until_alive)
| File "/root/OpenHands-0.17.0/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 "/root/OpenHands-0.17.0/openhands/utils/async_utils.py", line 17, in <lambda>
| coro = loop.run_in_executor(None, lambda: fn(*args, **kwargs))
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
| return copy(f, *args, **kw)
| ^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
| do = self.iter(retry_state=retry_state)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
| result = action(retry_state)
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 418, in exc_check
| raise retry_exc.reraise()
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 185, in reraise
| raise self.last_attempt.result()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
| return self.__get_result()
| ^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
| raise self._exception
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
| result = fn(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 380, in _wait_until_alive
| with send_request(
| ^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/runtime/utils/request.py", line 28, in send_request
| response = session.request(method, url, timeout=timeout, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
| resp = self.send(prep, **send_kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
| r = adapter.send(request, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
| raise ConnectionError(e, request=request)
| requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f52f4a88e00>: 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 "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/engineio/async_drivers/asgi.py", line 75, in __call__
await self.other_asgi_app(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
await super().__call__(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
await self.middleware_stack(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
raise exc
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
await self.app(scope, receive, _send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
with collapse_excgroups():
File "/usr/local/lib/python3.12/contextlib.py", line 155, in __exit__
self.gen.throw(value)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
raise exc
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
response = await self.dispatch_func(request, call_next)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/server/middleware.py", line 157, in __call__
response = await self._attach_conversation(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/server/middleware.py", line 137, in _attach_conversation
request.state.conversation = await session_manager.attach_to_conversation(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/server/session/manager.py", line 170, in attach_to_conversation
await c.connect()
File "/root/OpenHands-0.17.0/openhands/server/session/conversation.py", line 43, in connect
await self.runtime.connect()
File "/root/OpenHands-0.17.0/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 197, in connect
await call_sync_from_async(self._wait_until_alive)
File "/root/OpenHands-0.17.0/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 "/root/OpenHands-0.17.0/openhands/utils/async_utils.py", line 17, in <lambda>
coro = loop.run_in_executor(None, lambda: fn(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 418, in exc_check
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 185, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 380, in _wait_until_alive
with send_request(
^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/runtime/utils/request.py", line 28, in send_request
response = session.request(method, url, timeout=timeout, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f52f4a88e00>: Failed to establish a new connection: [Errno 111] Connection refused'))
INFO: 100.68.1.254:33819 - "GET /api/options/config HTTP/1.1" 200 OK
Docker logs
root@debian:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f36da003d9c7 docker.all-hands.dev/all-hands-ai/runtime:0.17-nikolaik "/openhands/micromam…" 6 minutes ago Up 6 minutes openhands-runtime-81c4fd1278c640d4ba0d9edc46c38c9a
root@debian:~# docker logs f36da003d9c7
DEBUG:openhands:DEBUG mode enabled.
02:05:13 - openhands:DEBUG: logger.py:267 - Logging initialized
02:05:13 - openhands:DEBUG: logger.py:279 - Logging to file in: /openhands/code/logs
2025-01-02 02:05 - openhands_aci:DEBUG - Logger initialized
02:05:27 - openhands:DEBUG: action_execution_server.py:709 - Starting action execution API on port 38130
INFO: Started server process [8]
INFO: Waiting for application startup.
02:05:28 - openhands:DEBUG: runtime_init.py:36 - Client working directory: /workspace
02:05:28 - openhands:DEBUG: runtime_init.py:48 - Created working directory. Output: []
02:05:28 - openhands:DEBUG: runtime_init.py:76 - User `openhands` does not exist. Proceeding with user creation.
02:05:29 - openhands:DEBUG: runtime_init.py:88 - Added sudoer successfully. Output: []
02:05:29 - openhands:DEBUG: runtime_init.py:96 - Added user `openhands` successfully with UID 1000. Output: []
02:05:30 - openhands:DEBUG: bash.py:121 - Bash initialized. Working directory: /workspace. Output: []
02:05:30 - openhands:DEBUG: browser_env.py:60 - Starting browser env...
DEBUG:openhands:DEBUG mode enabled.
02:05:30 - openhands:DEBUG: logger.py:267 - Logging initialized
02:05:30 - openhands:DEBUG: logger.py:279 - Logging to file in: /openhands/code/logs
2025-01-02 02:05 - openhands_aci:DEBUG - Logger initialized
02:05:39 - openhands:DEBUG: browser_env.py:107 - Browser env started.
02:05:39 - openhands:DEBUG: shutdown_listener.py:37 - _register_signal_handlers
02:05:39 - openhands:DEBUG: shutdown_listener.py:41 - _register_signal_handlers:main_thread
02:05:39 - openhands:DEBUG: action_execution_server.py:145 - Initializing plugin: agent_skills
02:05:39 - openhands:DEBUG: shutdown_listener.py:37 - _register_signal_handlers
02:05:39 - openhands:DEBUG: shutdown_listener.py:41 - _register_signal_handlers:main_thread
02:05:39 - openhands:DEBUG: __init__.py:51 - Jupyter kernel gateway started at port 40164. Output:
su - openhands -s /bin/bash << 'EOF'
sudo chown -R openhands:openhands /openhands/.openvscode-server
cd /workspace
exec /openhands/.openvscode-server/bin/openvscode-server --host 0.0.0.0 --connection-token 4708af07-ff83-4c31-9561-6e7d116f6cbe --port 38131
EOF
02:05:39 - openhands:DEBUG: __init__.py:49 - VSCode server started at port 38131. Output:
02:05:39 - openhands:DEBUG: action_execution_server.py:145 - Initializing plugin: vscode
chown: invalid group: 'openhands:openhands'
Server bound to 0.0.0.0:38131 (IPv4)
Extension host agent listening on 38131
[02:05:39]
Web UI available at http://localhost:38131?tkn=4708af07-ff83-4c31-9561-6e7d116f6cbe
[02:05:39] Extension host agent started.
[02:05:39] Started initializing default profile extensions in extensions installation folder. file:///home/openhands/.openvscode-server/extensions
[02:05:39] Completed initializing default profile extensions in extensions installation folder. file:///home/openhands/.openvscode-server/extensions
[I 2025-01-02 02:05:41.593 KernelGatewayApp] Writing Jupyter server cookie secret to /home/openhands/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2025-01-02 02:05:41.595 KernelGatewayApp] Jupyter Kernel Gateway 3.0.1 is available at http://0.0.0.0:40164
[I 2025-01-02 02:05:43.565 KernelGatewayApp] Kernel started: 6d9ed7b3-88b5-4b88-b306-512242a5e6fb
[I 250102 02:05:43 web:2348] 201 POST /api/kernels (127.0.0.1) 1400.30ms
[W 2025-01-02 02:05:43.572 KernelGatewayApp] No session ID specified
[I 250102 02:05:45 web:2348] 101 GET /api/kernels/6d9ed7b3-88b5-4b88-b306-512242a5e6fb/channels (127.0.0.1) 1620.06ms
[I 2025-01-02 02:05:45.190 KernelGatewayApp] Connecting to kernel 6d9ed7b3-88b5-4b88-b306-512242a5e6fb.
02:05:45 - openhands:DEBUG: action_execution_server.py:145 - Initializing plugin: jupyter
02:05:45 - openhands:DEBUG: action_execution_server.py:190 - /workspace != None -> reset Jupyter PWD
02:05:45 - openhands:DEBUG: action_execution_server.py:200 - Changed working directory in IPython to: /workspace. Output: **IPythonRunCellObservation**
[Code executed successfully with no output]
02:05:49 - openhands:DEBUG: action_execution_server.py:137 - AgentSkills initialized: **IPythonRunCellObservation**
[Code executed successfully with no output]
[Jupyter current working directory: /workspace]
[Jupyter Python interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.12/bin/python]
02:05:49 - openhands:DEBUG: action_execution_server.py:155 - Initializing by running 1 bash commands...
02:05:49 - openhands:DEBUG: action_execution_server.py:159 - Executing init command: git config --global user.name "openhands" && git config --global user.email "[email protected]" && alias git="git --no-pager"
02:05:49 - openhands:DEBUG: bash.py:51 - BASH PARSING command: git config --global user.name "openhands" && git config --global user.email "[email protected]" && alias git="git --no-pager"
02:05:49 - openhands:DEBUG: bash.py:58 - BASH PARSING remaining:
02:05:49 - openhands:DEBUG: bash.py:170 - Executing command: git config --global user.name "openhands" && git config --global user.email "[email protected]" && alias git="git --no-pager"
02:05:49 - openhands:DEBUG: bash.py:253 - Continuing bash with timeout=300
02:05:49 - openhands:DEBUG: bash.py:261 - Requesting exit code...
02:05:49 - openhands:DEBUG: action_execution_server.py:162 - Init command outputs (exit code: 0):
02:05:49 - openhands:DEBUG: action_execution_server.py:167 - Bash init commands completed
02:05:49 - openhands:DEBUG: action_execution_server.py:140 - Runtime client initialized.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:38130 (Press CTRL+C to quit)
INFO: 127.0.0.1:44632 - "GET /alive HTTP/1.1" 200 OK
02:05:50 - openhands:DEBUG: action_execution_server.py:172 - Running action:
**IPythonRunCellAction**
CODE:
import os
02:05:50 - openhands:DEBUG: action_execution_server.py:174 - Action output:
**IPythonRunCellObservation**
[Code executed successfully with no output]
[Jupyter current working directory: /workspace]
[Jupyter Python interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.12/bin/python]
INFO: 127.0.0.1:44632 - "POST /execute_action HTTP/1.1" 200 OK
02:05:50 - openhands:DEBUG: action_execution_server.py:172 - Running action:
**CmdRunAction (source=None)**
COMMAND:
git clone https://ghp_[REDACTED]@github.com/pandalion98/openhands-test.git openhands-test ; cd openhands-test ; git checkout -b openhands-workspace-j4ij3qsj
02:05:50 - openhands:DEBUG: bash.py:51 - BASH PARSING command: git clone https://ghp_[REDACTED]@github.com/pandalion98/openhands-test.git openhands-test ; cd openhands-test ; git checkout -b openhands-workspace-j4ij3qsj
02:05:50 - openhands:DEBUG: bash.py:58 - BASH PARSING remaining:
02:05:50 - openhands:DEBUG: bash.py:170 - Executing command: git clone https://ghp_[REDACTED]@github.com/pandalion98/openhands-test.git openhands-test ; cd openhands-test ; git checkout -b openhands-workspace-j4ij3qsj
02:05:50 - openhands:DEBUG: bash.py:253 - Continuing bash with timeout=120
02:05:50 - openhands:DEBUG: bash.py:261 - Requesting exit code...
02:05:50 - openhands:DEBUG: action_execution_server.py:174 - Action output:
**CmdOutputObservation (source=None, exit code=0)**
fatal: destination path 'openhands-test' already exists and is not an empty directory.
Switched to a new branch 'openhands-workspace-j4ij3qsj'
INFO: 127.0.0.1:44632 - "POST /execute_action HTTP/1.1" 200 OK
02:05:50 - openhands:DEBUG: action_execution_server.py:172 - Running action:
FileReadAction(path='.openhands_instructions', start=0, end=-1, thought='', action='read', security_risk=None, impl_source='default', translated_ipython_code='')
02:05:50 - openhands:DEBUG: bash.py:170 - Executing command: pwd
02:05:50 - openhands:DEBUG: bash.py:253 - Continuing bash with timeout=60
02:05:50 - openhands:DEBUG: bash.py:261 - Requesting exit code...
02:05:50 - openhands:DEBUG: action_execution_server.py:174 - Action output:
**ErrorObservation**
File not found: /workspace/openhands-test/.openhands_instructions. Your current working directory is /workspace/openhands-test.
INFO: 127.0.0.1:44632 - "POST /execute_action HTTP/1.1" 200 OK
INFO: 127.0.0.1:44632 - "POST /list_files HTTP/1.1" 200 OK
02:05:50 - openhands:DEBUG: action_execution_server.py:172 - Running action:
**CmdRunAction (source=EventSource.USER)**
COMMAND:
export GITHUB_TOKEN='******'
02:05:50 - openhands:DEBUG: bash.py:51 - BASH PARSING command: export GITHUB_TOKEN='******'
02:05:50 - openhands:DEBUG: bash.py:58 - BASH PARSING remaining:
02:05:50 - openhands:DEBUG: bash.py:170 - Executing command: export GITHUB_TOKEN='******'
02:05:50 - openhands:DEBUG: bash.py:253 - Continuing bash with timeout=120
02:05:50 - openhands:DEBUG: bash.py:261 - Requesting exit code...
02:05:50 - openhands:DEBUG: action_execution_server.py:174 - Action output:
**CmdOutputObservation (source=None, exit code=0)**
INFO: 127.0.0.1:44632 - "POST /execute_action HTTP/1.1" 200 OK
root@debian:~#
Additional context: The workspace directory seems to be mounted properly. The test files are there.
I'm working with f36da003d9c7, same container as initial bug filing.
root@debian:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ea523ff0826b docker.all-hands.dev/all-hands-ai/runtime:0.17-nikolaik "/openhands/micromam…" 14 minutes ago Up 14 minutes openhands-runtime-91ec75871e37448594fd729a90530f7b
f36da003d9c7 docker.all-hands.dev/all-hands-ai/runtime:0.17-nikolaik "/openhands/micromam…" 25 minutes ago Up 25 minutes openhands-runtime-81c4fd1278c640d4ba0d9edc46c38c9a
root@debian:~# docker exec -it f36da003d9c7 /bin/bash
root@debian:/openhands/code#
root@debian:/openhands/code#
root@debian:/openhands/code#
root@debian:/openhands/code# ls /workspace
openhands-test server.log test.html test.txt test2.txt
root@debian:/openhands/code# ls /workspace/openhands-test/
index.html
root@debian:/openhands/code# exit
exit
root@debian:~#
After a few minutes, in addition to the logs that says /vscode-url HTTP/1.1" 500 Internal Server Error, /list-files HTTP/1.1" 500 Internal Server Error also appear.
INFO: 100.68.1.254:34545 - "GET /api/conversations/91ec75871e37448594fd729a90530f7b/list-files HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
+ Exception Group Traceback (most recent call last):
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 76, in collapse_excgroups
| yield
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 186, in __call__
| async with anyio.create_task_group() as task_group:
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 763, in __aexit__
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/engineio/async_drivers/asgi.py", line 75, in __call__
| await self.other_asgi_app(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
| await super().__call__(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
| await self.middleware_stack(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
| raise exc
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
| await self.app(scope, receive, _send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
| with collapse_excgroups():
| File "/usr/local/lib/python3.12/contextlib.py", line 155, in __exit__
| self.gen.throw(value)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
| raise exc
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
| response = await self.dispatch_func(request, call_next)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/server/middleware.py", line 157, in __call__
| response = await self._attach_conversation(request)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/server/middleware.py", line 137, in _attach_conversation
| request.state.conversation = await session_manager.attach_to_conversation(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/server/session/manager.py", line 170, in attach_to_conversation
| await c.connect()
| File "/root/OpenHands-0.17.0/openhands/server/session/conversation.py", line 43, in connect
| await self.runtime.connect()
| File "/root/OpenHands-0.17.0/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 197, in connect
| await call_sync_from_async(self._wait_until_alive)
| File "/root/OpenHands-0.17.0/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 "/root/OpenHands-0.17.0/openhands/utils/async_utils.py", line 17, in <lambda>
| coro = loop.run_in_executor(None, lambda: fn(*args, **kwargs))
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
| return copy(f, *args, **kw)
| ^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
| do = self.iter(retry_state=retry_state)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
| result = action(retry_state)
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 418, in exc_check
| raise retry_exc.reraise()
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 185, in reraise
| raise self.last_attempt.result()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
| return self.__get_result()
| ^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
| raise self._exception
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
| result = fn(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 380, in _wait_until_alive
| with send_request(
| ^^^^^^^^^^^^^
| File "/root/OpenHands-0.17.0/openhands/runtime/utils/request.py", line 28, in send_request
| response = session.request(method, url, timeout=timeout, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
| resp = self.send(prep, **send_kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
| r = adapter.send(request, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
| raise ConnectionError(e, request=request)
| requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f52f01169c0>: 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 "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/engineio/async_drivers/asgi.py", line 75, in __call__
await self.other_asgi_app(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
await super().__call__(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
await self.middleware_stack(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
raise exc
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
await self.app(scope, receive, _send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
with collapse_excgroups():
File "/usr/local/lib/python3.12/contextlib.py", line 155, in __exit__
self.gen.throw(value)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
raise exc
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
response = await self.dispatch_func(request, call_next)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/server/middleware.py", line 157, in __call__
response = await self._attach_conversation(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/server/middleware.py", line 137, in _attach_conversation
request.state.conversation = await session_manager.attach_to_conversation(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/server/session/manager.py", line 170, in attach_to_conversation
await c.connect()
File "/root/OpenHands-0.17.0/openhands/server/session/conversation.py", line 43, in connect
await self.runtime.connect()
File "/root/OpenHands-0.17.0/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 197, in connect
await call_sync_from_async(self._wait_until_alive)
File "/root/OpenHands-0.17.0/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 "/root/OpenHands-0.17.0/openhands/utils/async_utils.py", line 17, in <lambda>
coro = loop.run_in_executor(None, lambda: fn(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 418, in exc_check
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 185, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 380, in _wait_until_alive
with send_request(
^^^^^^^^^^^^^
File "/root/OpenHands-0.17.0/openhands/runtime/utils/request.py", line 28, in send_request
response = session.request(method, url, timeout=timeout, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-67ZneO0O-py3.12/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f52f01169c0>: Failed to establish a new connection: [Errno 111] Connection refused'))
INFO: 100.68.1.254:34699 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 100.68.1.254:34699 - "GET /api/options/config HTTP/1.1" 200 OK
Additional context:
It seems like the URLs
http://IP:3000/api/conversations/{conversation ID}/vscode-url
http://IP:3000/api/conversations/{conversation ID}/list-files
just hangs when the sandbox has use_host_network set to true. In Chrome developer tools, the status is just (pending).
Are you using this so that you can access the application that OpenHands runs inside the docker container?
Are you using this so that you can access the application that OpenHands runs inside the docker container?
Yes @mamoodi, that is exactly the use case. I have an external device that needs to communicate with the app inside the sandbox.
Ah yes that's been brought up a few times and the team is aware of it. Not sure why setting that flag breaks it but I think that flag isn't enough to access the app inside. There is likely more that needs to be done.
Let me see if I can get someone to explain what's needed and if it's possible at all.
Ah yes that's been brought up a few times and the team is aware of it. Not sure why setting that flag breaks it but I think that flag isn't enough to access the app inside. There is likely more that needs to be done.
Let me see if I can get someone to explain what's needed and if it's possible at all.
@mamoodi I can confirm that the flag is working as intended more or less. The sandboxed app is accessible from the outside, and the LLM can still do its thing.
I can ask it e.g. "Change the app's port from 8080 to 3300" and the app can then be accessed from [Host IP]:3300. The LLM can respond to chat, code, install programs, push to Github, and basically work.
So far, the only issues I encounter based on my usage is that the files list is empty, and that it hangs when I decide to download files (it's scanning files but stuck at 0). When I manually check the workspace directory on the host, the files are there, and this is the reason I concluded it's a UI bug.
Disclaimer: All of this is based on 0.17.0. I still haven't tested 0.18.0 or main branch since I'm traveling.
Oh okay! Interesting. I understand the issue now. I thought OpenHands was not working with that. Thanks for the clarification!
It looks like the backend thinks your runtime is running on port 80, which is suspicious...
HTTPConnectionPool(host='localhost', port=80)
The runtime is clearly on a normal 3xxxx port
Uvicorn running on http://0.0.0.0:38130
very confusing because we're pretty directly setting the same port in self.api_url in openhands/runtime/impl/docker/docker_runtime.py.
I'd add some debug logs to that file to figure out why api_url is getting port 80
For reference, it has the same behavior with the current main branch (as of writing, current version is 0.19).
From the perspective of the browser, the following URLs are hung ("pending" when using Chrome dev tools)
/api/conversations/xxx/list-files
/api/conversations/xxx/vscode-url
While the logs have
INFO: 172.16.31.36:47822 - "GET /api/conversations/xxx/vscode-url HTTP/1.1" 500 Internal Server Error
INFO: 172.16.31.36:47806 - "GET /api/conversations/xxx/list-files HTTP/1.1" 500 Internal Server Error
INFO: 172.16.31.36:47884 - "GET /api/conversations/c285a4367c1046c38af48197c9377b34/list-files HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
+ Exception Group Traceback (most recent call last):
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 76, in collapse_excgroups
| yield
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 186, in __call__
| async with anyio.create_task_group() as task_group:
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 767, in __aexit__
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/engineio/async_drivers/asgi.py", line 75, in __call__
| await self.other_asgi_app(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
| await super().__call__(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
| await self.middleware_stack(scope, receive, send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
| raise exc
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
| await self.app(scope, receive, _send)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
| with collapse_excgroups():
| File "/usr/local/lib/python3.12/contextlib.py", line 155, in __exit__
| self.gen.throw(value)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
| raise exc
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
| response = await self.dispatch_func(request, call_next)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-new/OpenHands-0.19/openhands/server/middleware.py", line 157, in __call__
| response = await self._attach_conversation(request)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-new/OpenHands-0.19/openhands/server/middleware.py", line 137, in _attach_conversation
| request.state.conversation = await session_manager.attach_to_conversation(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-new/OpenHands-0.19/openhands/server/session/manager.py", line 200, in attach_to_conversation
| await c.connect()
| File "/root/OpenHands-new/OpenHands-0.19/openhands/server/session/conversation.py", line 43, in connect
| await self.runtime.connect()
| File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/impl/docker/docker_runtime.py", line 160, in connect
| await call_sync_from_async(self._wait_until_alive)
| File "/root/OpenHands-new/OpenHands-0.19/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 "/root/OpenHands-new/OpenHands-0.19/openhands/utils/async_utils.py", line 17, in <lambda>
| coro = loop.run_in_executor(None, lambda: fn(*args, **kwargs))
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
| return copy(f, *args, **kw)
| ^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
| do = self.iter(retry_state=retry_state)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
| result = action(retry_state)
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
| self._add_action_func(lambda rs: rs.outcome.result())
| ^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
| return self.__get_result()
| ^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
| raise self._exception
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
| result = fn(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/impl/docker/docker_runtime.py", line 349, in _wait_until_alive
| self.check_if_alive()
| File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/impl/action_execution/action_execution_client.py", line 99, in check_if_alive
| with self._send_action_server_request(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/impl/action_execution/action_execution_client.py", line 96, in _send_action_server_request
| return send_request(self.session, method, url, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
| return copy(f, *args, **kw)
| ^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
| do = self.iter(retry_state=retry_state)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
| result = action(retry_state)
| ^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
| self._add_action_func(lambda rs: rs.outcome.result())
| ^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
| return self.__get_result()
| ^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
| raise self._exception
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
| result = fn(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^
| File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/utils/request.py", line 43, in send_request
| response = session.request(method, url, timeout=timeout, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 575, in request
| prep = self.prepare_request(req)
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 484, in prepare_request
| p.prepare(
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/requests/models.py", line 367, in prepare
| self.prepare_url(url, params)
| File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/requests/models.py", line 435, in prepare_url
| raise InvalidURL(*e.args)
| requests.exceptions.InvalidURL: Failed to parse: http://localhost:-1/alive
+------------------------------------
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/engineio/async_drivers/asgi.py", line 75, in __call__
await self.other_asgi_app(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
await super().__call__(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
await self.middleware_stack(scope, receive, send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
raise exc
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
await self.app(scope, receive, _send)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
with collapse_excgroups():
File "/usr/local/lib/python3.12/contextlib.py", line 155, in __exit__
self.gen.throw(value)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
raise exc
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
response = await self.dispatch_func(request, call_next)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-new/OpenHands-0.19/openhands/server/middleware.py", line 157, in __call__
response = await self._attach_conversation(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-new/OpenHands-0.19/openhands/server/middleware.py", line 137, in _attach_conversation
request.state.conversation = await session_manager.attach_to_conversation(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-new/OpenHands-0.19/openhands/server/session/manager.py", line 200, in attach_to_conversation
await c.connect()
File "/root/OpenHands-new/OpenHands-0.19/openhands/server/session/conversation.py", line 43, in connect
await self.runtime.connect()
File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/impl/docker/docker_runtime.py", line 160, in connect
await call_sync_from_async(self._wait_until_alive)
File "/root/OpenHands-new/OpenHands-0.19/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 "/root/OpenHands-new/OpenHands-0.19/openhands/utils/async_utils.py", line 17, in <lambda>
coro = loop.run_in_executor(None, lambda: fn(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/impl/docker/docker_runtime.py", line 349, in _wait_until_alive
self.check_if_alive()
File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/impl/action_execution/action_execution_client.py", line 99, in check_if_alive
with self._send_action_server_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/impl/action_execution/action_execution_client.py", line 96, in _send_action_server_request
return send_request(self.session, method, url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/root/OpenHands-new/OpenHands-0.19/openhands/runtime/utils/request.py", line 43, in send_request
response = session.request(method, url, timeout=timeout, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 575, in request
prep = self.prepare_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/requests/models.py", line 367, in prepare
self.prepare_url(url, params)
File "/root/.cache/pypoetry/virtualenvs/openhands-ai-vPGzf-5k-py3.12/lib/python3.12/site-packages/requests/models.py", line 435, in prepare_url
raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://localhost:-1/alive
Resolved by https://github.com/SmartManoj/Kevin/issues/163
Looks like you had another conflicting app running right? Closing but feel free to LMK if that was not the case.