[Bug]: SANDBOX_USER_ID cannot be 0. Please run with a different user id.
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
Hey, when I try to run OpenDevin with the official actual cmd this Error comes:
SANDBOX_USER_ID cannot be 0. Please run with a different user id.
How can I run with a different user id?
Current Version
0.5.0
Installation and Configuration
#The directory you want OpenDevin to modify. MUST be an absolute path!
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
Model and Agent
No response
Reproduction Steps
- Type the cmd
- the error
Logs, Errors, Screenshots, and Additional Context
No response
@zGamerZz sounds like you're logged in as root. Do you typically work as the root user? What's your OS?
@zGamerZz sounds like you're logged in as root. Do you typically work as the root user? What's your OS?
@rbren I´m on Windows but use Ubuntu via WSL as root user
SANDBOX_USER_ID cannot be 0. Please run with a different user id. me too,I´m on Centos7.9
same here on Ubuntu 22
Try
docker run \ --pull=always \ -e SANDBOX_USER_ID=1000 \ -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
Hey all, I have a proposed fix here, which allows running as root (which should work better than aj47's workaround)
Can you try running with tag 1651-merge (instead of 0.5) and see if it works any better?
(CC @zGamerZz @Beamaccount @baoge2778)
(抄送@zGamerZz @Beamaccount @baoge2778)
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:1651-merge
It worked. But other errors occurred after starting the container
06:09:21 - opendevin:ERROR: ssh_box.py:224 - Command timed out, killing process... 06:09:51 - opendevin:ERROR: agent.py:138 - Error creating controller: Failed to source ~/.bashrc with exit code -1 and output Command: "source ~/.bashrc" timed out. Sending SIGINT to the process: root@45731512d9b8:/workspace# ^C root@45731512d9b8:/workspace# Traceback (most recent call last): File "/app/opendevin/server/agent/agent.py", line 130, in create_controller self.controller = AgentController( ^^^^^^^^^^^^^^^^ File "/app/opendevin/controller/agent_controller.py", line 82, in init self.action_manager.init_sandbox_plugins(agent.sandbox_plugins) File "/app/opendevin/controller/action_manager.py", line 48, in init_sandbox_plugins self.sandbox.init_plugins(plugins) File "/app/opendevin/runtime/plugins/mixin.py", line 47, in init_plugins raise RuntimeError( RuntimeError: Failed to source ~/.bashrc with exit code -1 and output Command: "source ~/.bashrc" timed out. Sending SIGINT to the process: root@45731512d9b8:/workspace# ^C root@45731512d9b8:/workspace#
Try
docker run \ --pull=always \ -e SANDBOX_USER_ID=1000 \ -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
This is working for me thank you :)
@baoge2778 can you open a new issue for your new problem? If you could fill out the template and mention you're running as root that would be helpful
actually @baoge2778 scratch that--seems @zGamerZz was using the SANDBOX_USER_ID=1000 workaround, which will likely cause other issues (all files written by OpenDevin will have the wrong permissions/ownership)
@baoge2778 can you open a new issue for your new problem? If you could fill out the template and mention you're running as root that would be helpful
ok.https://github.com/OpenDevin/OpenDevin/issues/1682