OpenHands
OpenHands copied to clipboard
[Bug]: docker build error in build from source startup v0.12.3
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Describe the bug and reproduction steps
No local docker images, sources are as of right now, main branch, ran make build and make run (Ubuntu 23.04 in WSL). Opened webpage, entered "what poetry version is installed?" in hero page prompt and OH started image creation, but fails after couple of seconds:
20:48:54 - openhands:ERROR: agent_session.py:197 - Runtime initialization failed: Command '['docker', 'buildx', 'build', '--progress=plain', '--build-arg=OPENHANDS_RUNTIME_VERSION=0.12.3', '--build-arg=OPENHANDS_RUNTIME_BUILD_TIME=2024-11-08T20:48:42.303720', '--tag=ghcr.io/all-hands-ai/runtime:oh_v0.12.3_rzthzrruf4nl4ih5_n1ymk823ynfjmq8i', '--load', '/tmp/tmpgn3bmnwu']' returned non-zero exit status 1.
Traceback (most recent call last):
File "/mnt/d/github/OpenDevin/openhands/server/session/agent_session.py", line 195, in _create_runtime
await self.runtime.connect()
File "/mnt/d/github/OpenDevin/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 199, in connect
self.runtime_container_image = build_runtime_image(
^^^^^^^^^^^^^^^^^^^^
File "/mnt/d/github/OpenDevin/openhands/runtime/utils/runtime_build.py", line 134, in build_runtime_image
result = build_runtime_image_in_folder(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/d/github/OpenDevin/openhands/runtime/utils/runtime_build.py", line 225, in build_runtime_image_in_folder
_build_sandbox_image(
File "/mnt/d/github/OpenDevin/openhands/runtime/utils/runtime_build.py", line 352, in _build_sandbox_image
image_name = runtime_builder.build(
^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/d/github/OpenDevin/openhands/runtime/builder/docker.py", line 114, in build
raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command '['docker', 'buildx', 'build', '--progress=plain', '--build-arg=OPENHANDS_RUNTIME_VERSION=0.12.3', '--build-arg=OPENHANDS_RUNTIME_BUILD_TIME=2024-11-08T20:48:42.303720', '--tag=ghcr.io/all-hands-ai/runtime:oh_v0.12.3_rzthzrruf4nl4ih5_n1ymk823ynfjmq8i', '--load', '/tmp/tmpgn3bmnwu']' returned non-zero exit status 1.
ERROR:asyncio:Future exception was never retrieved
future: <Future finished exception=CalledProcessError(1, ['docker', 'buildx', 'build', '--progress=plain', '--build-arg=OPENHANDS_RUNTIME_VERSION=0.12.3', '--build-arg=OPENHANDS_RUNTIME_BUILD_TIME=2024-11-08T20:48:42.303720', '--tag=ghcr.io/all-hands-ai/runtime:oh_v0.12.3_rzthzrruf4nl4ih5_n1ymk823ynfjmq8i', '--load', '/tmp/tmpgn3bmnwu'])>
Traceback (most recent call last):
File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/d/github/OpenDevin/openhands/server/session/agent_session.py", line 92, in _start_thread
asyncio.run(self._start(*args), debug=True)
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/mnt/d/github/OpenDevin/openhands/server/session/agent_session.py", line 108, in _start
await self._create_runtime(
File "/mnt/d/github/OpenDevin/openhands/server/session/agent_session.py", line 195, in _create_runtime
await self.runtime.connect()
File "/mnt/d/github/OpenDevin/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 199, in connect
self.runtime_container_image = build_runtime_image(
^^^^^^^^^^^^^^^^^^^^
File "/mnt/d/github/OpenDevin/openhands/runtime/utils/runtime_build.py", line 134, in build_runtime_image
result = build_runtime_image_in_folder(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/d/github/OpenDevin/openhands/runtime/utils/runtime_build.py", line 225, in build_runtime_image_in_folder
_build_sandbox_image(
File "/mnt/d/github/OpenDevin/openhands/runtime/utils/runtime_build.py", line 352, in _build_sandbox_image
image_name = runtime_builder.build(
^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/d/github/OpenDevin/openhands/runtime/builder/docker.py", line 114, in build
raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command '['docker', 'buildx', 'build', '--progress=plain', '--build-arg=OPENHANDS_RUNTIME_VERSION=0.12.3', '--build-arg=OPENHANDS_RUNTIME_BUILD_TIME=2024-11-08T20:48:42.303720', '--tag=ghcr.io/all-hands-ai/runtime:oh_v0.12.3_rzthzrruf4nl4ih5_n1ymk823ynfjmq8i', '--load', '/tmp/tmpgn3bmnwu']' returned non-zero exit status 1.
OpenHands Installation
Development workflow
OpenHands Version
0.12.3
Operating System
WSL on Windows
Logs, Errors, Screenshots, and Additional Context
No response
I see that you mentioned Development Workflow and you prefer running it like that, but does the docker command work on WSL at least?
Yes, the docker command seems to work. Strangely, putting a simple "ls -al" into terminal made the terminal hang till I issued another command in chat.
+1 on this; using MacOS
I'm facing this issue too (running WSL and development workflow)
Anyone with WSL able to tackle this issue? Development workflow seems broken on WSL.
Running rm ~/.docker/config.json, restarting docker, and rebuilding Openhands resolved this issue for me. I'm am, however, on MacOS.
I'm running into this using the development workflow (needed for the benchmarking scripts) in a Ubuntu 20.04 container.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Well, I faced a similar issue when running "poetry run python -m openhands.core.cli" in wsl.
I did a few things, don't really know which one solved the problem :-| but here they are:
1- I have changed my docker setting to the following image:
2- I've changed the following lines
3- I also changed the make file as follows:
Then after running again "poetry run python -m openhands.core.cli" in wsl after a few minutes the message "How can I help?" appeared
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for over 30 days with no activity.