All-Hands-AI / OpenHands

🙌 OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
36.33k stars 4.13k forks source link

[Bug]: stat: cannot statx '/var/run/docker.sock': No such file or directory #4933

Open avonian opened 1 day ago

avonian commented 1 day ago

Is there an existing issue for the same bug?

Describe the bug and reproduction steps

Running linux mint 22 and docker 27

When I start the container with the boilerplate instructions it works fine:

docker run -it --rm --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.13-nikolaik \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 3000:3000 \
    -e LOG_ALL_EVENTS=true \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app \
    docker.all-hands.dev/all-hands-ai/openhands:0.13

but if i try to provide a working directory, i get the aforementioned error

here's how i'm doing it:

export WORKSPACE_BASE=/path/to/my/project

docker run -it --rm --pull=always \
    -e SANDBOX_USER_ID=$(id -u) \
    -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
    -v $WORKSPACE_BASE:/opt/workspace_base \
    -p 3000:3000 \
    -e LOG_ALL_EVENTS=true \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app \
    docker.all-hands.dev/all-hands-ai/openhands:0.13

any ideas what the problem might be?

OpenHands Installation

Docker command in README

OpenHands Version

0.13

Operating System

Linux

Logs, Errors, Screenshots, and Additional Context

0.13: Pulling from all-hands-ai/openhands Digest: sha256:5444b2c3667898163db4ce052717dd59e5040cdd05d2e9621d9018215865ae86 Status: Image is up to date for docker.all-hands.dev/all-hands-ai/openhands:0.13 Starting OpenHands... Setting up enduser with id 1000 stat: cannot statx '/var/run/docker.sock': No such file or directory

shaxxx commented 1 day ago

Instead of

-v /var/run/docker.sock:/var/run/docker.sock \

try with

-v //var/run/docker.sock:/var/run/docker.sock \

Worked for me.

mamoodi commented 16 hours ago

If shaxxx's solution doesn't work, this may be a permission issue. @shaxxx are you using linux as well?

shaxxx commented 16 hours ago

No, but this workaround was needed to get it working in Docker terminal bash shell. Otherwise, I would get exactly the same error