[Bug]: workspace vs workspace_base issue?
Is there an existing issue for the same bug?
- [X] I have checked the troubleshooting document at https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting
- [X] I have checked the existing issues.
Describe the bug
When the codeact agent tries to write jupyter code and runs it, I get the error: bash: line 1: /workspace/.tmp/.ipython_execution_tmp.py: No such file or directory
When I look at the "code editor" tab, the .tmp/.ipython_execution_tmp.py is there but under workspace_base
My guess is that's the issue?
Current Version
opendevin:0.5
Installation and Configuration
Doesn't seem to matter how I run it but this is my current starting command:
export LLM_API_KEY="..."
export LLM_MODEL="..."
export LLM_BASE_URL="..."
export WORKSPACE_BASE=$(pwd)/open_devin_test
sudo docker run \
-e LLM_API_KEY \
-e LLM_MODEL \
-e LLM_BASE_URL \
-e SANDBOX_USER_ID=$(id -u) \
-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:0.5
I'm running this within wsl2 on windows
Model and Agent
Behavior doesn't vary by model, have only ever tried it with the code act agent
Reproduction Steps
- Launch open devin
- Prompt it to write python code
- Get error
Logs, Errors, Screenshots, and Additional Context
@williambarberjr what do you get if you run ls -lah $(pwd)/open_devin_test
any solution? i have the same problem
@rbren
but no files in the container.
OS: wsl
i have always these problems
I'm running this on Mac m1 `export WORKSPACE_BASE=$(pwd)/workspace;
docker run
--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
--add-host host.docker.internal:host-gateway
ghcr.io/opendevin/opendevin:0.5`
why does no files and directories appear in the code editor when I give a prompt ?
@williambarberjr what do you get if you run
ls -lah $(pwd)/open_devin_test
ls -lah $(pwd)/open_devin_test
total 12K
drwxr-xr-x 3 myusername myusername 4.0K May 10 13:58 .
drwxr-x--- 27 myusername myusername 4.0K May 10 14:03 ..
drwxr-xr-x 2 myusername 42421 4.0K May 8 15:25 .tmp
There's nothing inside my open_devin_test folder, it's just an empty dir.
The full print out from the WSL2 console:
==============
STEP 0
18:01:34 - PLAN
run hello world in the ipython notebook
18:01:37 - ACTION
**IPythonRunCellAction**
THOUGHT:Sure, let's run a simple "Hello World!" in the IPython notebook environment:
CODE:
print("Hello World!")
18:01:37 - OBSERVATION
IPythonRunCellObservation(content='bash: line 1: /workspace/.tmp/.ipython_execution_tmp.py: No such file or directory', code='print("Hello World!")', observation='run_ipython')
==============
STEP 1
18:01:40 - ACTION
**IPythonRunCellAction**
THOUGHT:It seems there was an issue with the execution environment. Let me try running the "Hello World!" command again for you.
CODE:
print("Hello World!")
18:01:40 - OBSERVATION
IPythonRunCellObservation(content='bash: line 1: /workspace/.tmp/.ipython_execution_tmp.py: No such file or directory', code='print("Hello World!")', observation='run_ipython')
==============
STEP 2
18:01:46 - ACTION
It appears there is a persistent issue with the IPython notebook execution environment. Unfortunately, I can't directly resolve this environment setup issue from here. However, you can try running the Python code locally on your machine or in any online Python compiler. Here's the code you would use:
\```python
print("Hello World!")
\```
You can simply copy this into your Python environment and run it to see the output. If you have any other questions or need further assistance with a different task, feel free to ask!
18:01:46 - opendevin:INFO: agent_controller.py:201 - Setting agent state from AgentState.RUNNING to AgentState.AWAITING_USER_INPUT
When I go to docker desktop, click the vertical ... and "open in terminal" then poked around with these commands and results:
# pwd
/workspace
# ls
open_devin_test
# cd ..
# ls
bin boot dev etc home lib lib32 lib64 libx32 media mnt opendevin opt proc root run sbin srv sys tmp usr var workspace
# cd opt
# ls
# pwd
/opt
#
In other words, when looking inside the docker container for the sandbox, I don't see any subfolders inside /opt, so I'm not sure how it's supposed to handle the volume mapping requested with this -v flag: -v $WORKSPACE_BASE:/opt/workspace_base
My WSL2 env is Ubuntu 22.04.4 LTS if it matters and I'm running this on Windows 11 Pro. But generally I think the point of Docker is those details shouldn't be as consequential...
@rbren Shouldn't open_devin_test folder be mapped to /workspace in sandbox?
@williambarberjr What happens if you set export WORKSPACE_BASE=$(pwd)/workspace;?
@williambarberjr Could you check the main version?
@williambarberjr What happens if you set
export WORKSPACE_BASE=$(pwd)/workspace;?
If I understand what the -v volume flag is doing in the docker run command, I believe doing that would just try to map a) the result of concatenating my current working directory with /workspace (a directory which doesn't exist on my local machine) to b) /opt/workspace_base within the docker container (which also doesn't exist within the docker container)
So I don't think that will solve anything unless I'm missing something...
How did open_devin_test folder come inside the workspace directory?
is that a nested folder?
a directory which doesn't exist on my local machine
The following line will automatically create it. https://github.com/OpenDevin/OpenDevin/blob/8bfae8413e74e1b6095d5380a7ea93b6b73a4537/containers/app/Dockerfile#L42
Duplicate of #1366
I'm going to dedupe this with https://github.com/OpenDevin/OpenDevin/issues/1366
This is weird stuff, it seems to only pop up for a few folks. I will put more info in #1366 if anyone is able to help debug further