Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error when building dev container: ERROR: failed to solve: process "/bin/sh -c /dev/pipes/EOF" did not complete successfully: exit code: 2 #6461

Closed
1 task done
kripper opened this issue Jan 26, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@kripper
Copy link
Contributor

kripper commented Jan 26, 2025

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

Reproduce

I tried to build de dev container with:

make docker-dev

Result

695.8 FFMPEG playwright build v1009 downloaded to /root/.cache/ms-playwright/ffmpeg-1009
695.9 mkdir: cannot create directory 'cache': Read-only file system
695.9 touch: cannot touch 'cache/playwright_chromium_is_installed.txt': No such file or directory
695.9 make: *** [Makefile:130: install-python-dependencies] Error 1
------
WARNING: current commit information was not captured by the build: failed to read current commit information with git rev-parse --is-inside-work-tree
Dockerfile:110
--------------------
 109 |     # cache build dependencies
 110 | >>> RUN \
 111 | >>>   --mount=type=bind,source=./,target=/app/ \
 112 | >>>   <<EOF
 113 | >>> #!/bin/bash
 114 | >>> make -s clean
 115 | >>> make -s check-dependencies
 116 | >>> make -s install-python-dependencies
 117 | >>>
 118 | >>> # NOTE
 119 | >>> # node_modules are .dockerignore-d therefore not mountable
 120 | >>> # make -s install-frontend-dependencies
 121 | >>> EOF
 122 |
--------------------
ERROR: failed to solve: process "/bin/sh -c /dev/pipes/EOF" did not complete successfully: exit code: 2

OpenHands Installation

Development workflow

OpenHands Version

main

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

@kripper kripper added the bug Something isn't working label Jan 26, 2025
@kripper
Copy link
Contributor Author

kripper commented Jan 26, 2025

I believe it fails because my docker version doesn't support HEREDOC syntaxis.

System is:
Red Hat Enterprise Linux release 8.9 (Ootpa)

$ docker -v
Docker version 26.1.3, build b72abbb

@kripper
Copy link
Contributor Author

kripper commented Jan 26, 2025

No. To solve HEREDOC support, just define export DOCKER_BUILDKIT=1

kripper pushed a commit to kripper/OpenHands that referenced this issue Jan 26, 2025
kripper added a commit to kripper/OpenHands that referenced this issue Jan 26, 2025
@piojanu
Copy link

piojanu commented Feb 7, 2025

Hi! I've bumped into it too on Mac. Did you resolve it or found a work around?

@kripper
Copy link
Contributor Author

kripper commented Feb 7, 2025

Yes. Solved. See above.

@piojanu
Copy link

piojanu commented Feb 10, 2025

For me the solutions seems to be simply adding rw option at the end of the --mount like this: --mount=type=bind,source=./,target=/app/,rw.

@kripper
Copy link
Contributor Author

kripper commented Feb 10, 2025

For me the solutions seems to be simply adding rw option at the end of the --mount like this: --mount=type=bind,source=./,target=/app/,rw.

Are you sure this solves the same issue (ERROR: failed to solve: process "/bin/sh -c /dev/pipes/EOF")?
HEREDOC (<<EOF ... EOF) only works with DOCKER_BUILDKIT.

@kripper kripper closed this as completed Feb 10, 2025
@piojanu
Copy link

piojanu commented Feb 10, 2025

@kripper I think the error you reference further says, that it was executed, but did not complete successfully (full error: failed to solve: process "/bin/sh -c /dev/pipes/EOF" **did not complete successfully**: exit code: 2). So then I look higher and see that the actual problem is: 695.9 mkdir: cannot create directory 'cache': Read-only file system. This directory is being created by the install-python-dependencies make recipe:

install-python-dependencies:
	...
	else \
		if [ ! -f cache/playwright_chromium_is_installed.txt ]; then \
			echo "Running playwright install --with-deps chromium..."; \
			poetry run playwright install --with-deps chromium; \
			**mkdir -p cache; \**
			**touch cache/playwright_chromium_is_installed.txt; \**
		else \
			echo "Setup already done. Skipping playwright installation."; \
		fi \
	fi
        ...

So making the bind read-write solves this problem. However, further down the line be cautious for two additional problems:

  1. NodeJS should be updated to >= 20.x as you did.
  2. In containers/dev/compose.yml the env var SANDBOX_API_HOSTNAME should be changed to SANDBOX_LOCAL_RUNTIME_URL and also some scripts (e.g. ScienceAgentBench benchmark run_infer.py) don't read env vars at all and hence you need to properly pass it to the config created there.
    Otherwise, it hangs on Waiting for client to become ready at http://localhost:30214....

Hopefully it helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants