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]: stat: cannot statx '/var/run/docker.sock': No such file or directory #4933

Closed
1 task done
avonian opened this issue Nov 12, 2024 · 12 comments
Closed
1 task done
Labels
bug Something isn't working Stale Inactive for 30 days

Comments

@avonian
Copy link

avonian commented Nov 12, 2024

Is there an existing issue for the same bug?

  • I have checked the existing issues.

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

@avonian avonian added the bug Something isn't working label Nov 12, 2024
@shaxxx
Copy link

shaxxx commented Nov 12, 2024

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
Copy link
Collaborator

mamoodi commented Nov 13, 2024

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

@shaxxx
Copy link

shaxxx commented Nov 13, 2024

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

@avonian
Copy link
Author

avonian commented Nov 18, 2024

hi thanks for the tip

it seems if i include the -v /var/run/docker.sock:/var/run/docker.sock line it works, with or without //

as follows:

docker run -it --rm --pull=always \
    -e SANDBOX_USER_ID=$(id -u) \
    -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
    -v $WORKSPACE_BASE:/opt/workspace_base \
    -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

however when it opens up it doesn't actually show the working directory, i get the "What do you want to build?" message

i can confirm echo $WORKSPACE_BASE outputs the correct path

@avonian
Copy link
Author

avonian commented Nov 18, 2024

so yea i cant open local working directory, and i also tried to open a repo via github at which point the IDE loaded and threw this error:

raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'docker'

seems similar to the original error

@mamoodi
Copy link
Collaborator

mamoodi commented Nov 18, 2024

@avonian can you try this. After you set your WORKSPACE_BASE to a path you want.

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

@mamoodi
Copy link
Collaborator

mamoodi commented Nov 18, 2024

Also the initial "What do you want to build" will always show. Even if you specify a workspace.
You can just give it a prompt to go to the next page like "What python version is installed"

@avonian
Copy link
Author

avonian commented Nov 18, 2024

thanks again for the quick reply

i did as you suggested, and asked a question to open up the IDE, and the working folder is empty

either way appreciate everyones help here

@mamoodi
Copy link
Collaborator

mamoodi commented Nov 18, 2024

Just want to make sure that when you provided WORKSPACE_BASE, you provided an absolute path that exists?

@avonian
Copy link
Author

avonian commented Nov 18, 2024

yep, absolute path, and when i do an echo it appears correctly, and i can cd to it exactly as its printed or by doing cd $WORKSPACE_BASE

Copy link
Contributor

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 github-actions bot added the Stale Inactive for 30 days label Dec 20, 2024
Copy link
Contributor

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale Inactive for 30 days
Projects
None yet
Development

No branches or pull requests

3 participants