OpenHands
OpenHands copied to clipboard
Docker unreachable error not reported by server on websocket connect
Describe the bug When starting the server with Docker stopped, the server throws a backtrace error indicating Docker is not reachable instead of a clear error message.
Steps to Reproduce
- Stop Docker.
- Execute the command:
$ uvicorn opendevin.server.listen:app --reload --port 3000
. - Attempt to connect via WebSocket:
websocat ws://127.0.0.1:3000/ws
.
Expected behavior The server should report a clear error message indicating Docker is down and a WebSocket connection cannot be established.
Actual behavior The server starts and accepts the WebSocket connection, but upon attempting any operation that requires Docker, it crashes with a backtrace error pointing to Docker connectivity issues. The error log is as follows:
$ uvicorn opendevin.server.listen:app --reload --port 3000
INFO: Will watch for changes in these directories: ['./OpenDevin-rbren/OpenDevin']
INFO: Uvicorn running on http://127.0.0.1:3000 (Press CTRL+C to quit)
INFO: Started reloader process [16775] using WatchFiles
INFO: Started server process [16779]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: ('127.0.0.1', 49231) - "WebSocket /ws" [accepted]
INFO: connection open
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 793, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request
conn.request(
File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connection.py", line 400, in request
self.endheaders()
File "/opt/homebrew/Cellar/[email protected]/3.11.7_2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1289, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/opt/homebrew/Cellar/[email protected]/3.11.7_2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1048, in _send_output
self.send(msg)
File "/opt/homebrew/Cellar/[email protected]/3.11.7_2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 986, in send
self.connect()
File "/opt/homebrew/lib/python3.11/site-packages/docker/transport/unixconn.py", line 27, in connect
sock.connect(self.unix_socket)