OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: docker build error in build from source startup v0.12.3

Open tobitege opened this issue 1 year ago • 7 comments

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

tobitege avatar Nov 08 '24 19:11 tobitege

I see that you mentioned Development Workflow and you prefer running it like that, but does the docker command work on WSL at least?

mamoodi avatar Nov 08 '24 20:11 mamoodi

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.

tobitege avatar Nov 08 '24 20:11 tobitege

+1 on this; using MacOS

malhotra5 avatar Nov 10 '24 21:11 malhotra5

I'm facing this issue too (running WSL and development workflow)

Srishti-Chouhan avatar Nov 11 '24 13:11 Srishti-Chouhan

Anyone with WSL able to tackle this issue? Development workflow seems broken on WSL.

mamoodi avatar Nov 11 '24 14:11 mamoodi

Running rm ~/.docker/config.json, restarting docker, and rebuilding Openhands resolved this issue for me. I'm am, however, on MacOS.

malhotra5 avatar Nov 11 '24 15:11 malhotra5

I'm running into this using the development workflow (needed for the benchmarking scripts) in a Ubuntu 20.04 container.

csmith49 avatar Nov 21 '24 19:11 csmith49

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.

github-actions[bot] avatar Dec 22 '24 02:12 github-actions[bot]

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: docker

2- I've changed the following lines image

3- I also changed the make file as follows: image

Then after running again "poetry run python -m openhands.core.cli" in wsl after a few minutes the message "How can I help?" appeared image

DsDastgheib avatar Dec 22 '24 16:12 DsDastgheib

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.

github-actions[bot] avatar Feb 01 '25 01:02 github-actions[bot]

This issue was closed because it has been stalled for over 30 days with no activity.

github-actions[bot] avatar Feb 09 '25 02:02 github-actions[bot]