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

Files aren't visible to commands run in the ExecBox #1366

Open
FlipEngineering opened this issue Apr 25, 2024 · 5 comments
Open

Files aren't visible to commands run in the ExecBox #1366

FlipEngineering opened this issue Apr 25, 2024 · 5 comments
Labels
question Further information is requested severity:critical Major problems affecting all users

Comments

@FlipEngineering
Copy link

FlipEngineering commented Apr 25, 2024

Am I missing something?
workspace not visible in sandbox, and therefore can't execute python scripts in sandbox.

I'm on Windows 10 and I'm running WSL2 Ubuntu image, with Docker Desktop (integration enabled).
Connected to WSL in VS Code, and there in the shell I'm running these commands as described in the README, with light adaptation, maybe it's some of the changes I made?

These two lines of the docker command are "none standard":

    -e LLM_BASE_URL="https://api.groq.com/openai/v1/chat/completions" \
    -e SANDBOX_TYPE=exec \

the SANDBOX_TYPE = exec is because I wasn't able to get rid of the sshd error that most of you should be familiar with these days.

export LLM_API_KEY="gsk_XXX"
export WORKSPACE_BASE=$(pwd)/workspace

docker run \
    -e LLM_API_KEY \
    -e LLM_BASE_URL="https://api.groq.com/openai/v1/chat/completions" \
    -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
    -e SANDBOX_TYPE=exec \
    -v $WORKSPACE_BASE:/opt/workspace_base \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 3000:3000 \
    --add-host host.docker.internal=host-gateway \
    ghcr.io/opendevin/opendevin:main 

After that I

I also tested to make some files in the working directory of the shell:

docker exec -it 4e0410591257 /bin/bash

root@docker-desktop:/workspace# touch test.txt

when getting devin to run ls it does show that file:
image

also me trying to trick open devin into going into /opt/workspace_base didn't work as you can clearly see

But Devin as well successfully writes files in the specified workspace folder in the opendevin docker, and that shows as well in vscode, just the sandbox docker doesn't seem to be linking the correct folder, if any at all(?)

I've removed all WSL dockers multiple times, same within, have tried the 0.3.1 version of openDevin and the main. with multiple iterations of cleaning the dockers out and downloading the new ones.

I feel like if there would be more people with this basic issue there would be some issues here with this, but I don't seem to find them.

Any idea what I'm doing wrong?

@FlipEngineering FlipEngineering added the question Further information is requested label Apr 25, 2024
@rbren
Copy link
Collaborator

rbren commented Apr 25, 2024

I think there might be a bug in the exec box--I've noticed something similar.

@rbren rbren changed the title what am I missing? workspace not visible in sandbox, and therefore can't execute python scripts in sandbox. Files aren't visible to commands run in the ExecBox Apr 25, 2024
@rbren rbren added the severity:critical Major problems affecting all users label Apr 25, 2024
@rbren
Copy link
Collaborator

rbren commented Apr 27, 2024

What's strange is that if I run

poetry run python opendevin/sandbox/docker/exec_box.py

everything is fine. I can run ls and see everything in my workspace

And I exec into the sandbox created by the agent controller, everything looks fine too.

But for some reason, if I ask the agent to run ls, it returns empty...

@rbren
Copy link
Collaborator

rbren commented Apr 27, 2024

Actually--I just pulled main and this seems to be working. @FlipEngineering can you see if main is working for you? Here's what I get:

❯ docker run --pull=always \
-e LLM_API_KEY  \
-e SANDBOX_TYPE=exec \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_DIR     \
-v $WORKSPACE_DIR:/opt/workspace_base     \
-v /var/run/docker.sock:/var/run/docker.sock     \
-p 2000:3000     \
--add-host host.docker.internal=host-gateway     \
ghcr.io/opendevin/opendevin:main  python opendevin/main.py -t "run ls" -m claude-3-opus-20240229 -c MonologueAgent

main: Pulling from opendevin/opendevin
Digest: sha256:33abf220a562d8549725795cbeb57fac817bab5ae0836196fef13914dfc20368
Status: Image is up to date for ghcr.io/opendevin/opendevin:main
11:22:33 - opendevin:INFO: llm.py:52 - Initializing LLM with model: claude-3-opus-20240229
11:22:34 - opendevin:INFO: exec_box.py:221 - Container stopped
11:22:34 - opendevin:INFO: exec_box.py:239 - Container started


==============
STEP 0

11:22:35 - PLAN
run ls
11:22:40 - ACTION
CmdRunAction(command='ls', background=False, action='run')
11:22:40 - OBSERVATION
README.md
app
beep_script.sh
calculate_area.py
calculate_circle_area.py

@zhonggegege
Copy link

I often encounter this problem, mostly because the session is in progress and the task is still executing.

@qiviut
Copy link

qiviut commented May 3, 2024

I used to have the same problem, but it seems to be working thanks to the latest commits and switching from ExecBox back to the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested severity:critical Major problems affecting all users
Projects
None yet
Development

No branches or pull requests

4 participants