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]: Main OpenDevin container does not clean up sandbox containers on shutdown #1791

Open
2 tasks done
paulmaunders opened this issue May 14, 2024 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working severity:low Minor issues, code cleanup, etc

Comments

@paulmaunders
Copy link

Is there an existing issue for the same bug?

Describe the bug

When stopping the main OpenDevin container with CTRL+C, the sandbox container remains running. This leads to the accumulation of numerous running containers, which clutters the Docker environment. The sandbox containers should be automatically stopped and removed when the main container is stopped.

There is a related issue here: #1462 but it was closed.

Current Version

0.5 (from Docker image ghcr.io/opendevin/opendevin:0.5)

Installation and Configuration

docker run \
    -it \
    --pull=always \
    -e LLM_API_KEY \
    -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

  • Model: gpt-4o
  • Agent: CodeActAgent

Reproduction Steps

  1. Launch the OpenDevin container with the docker run command from the README (as shown above)
  2. Ask OpenDevin to do something which will invoke the sandbox environment (e.g. "Run the hostname command")
  3. Stop the main container with CTRL+C
  4. Check for the remaining sandbox container with docker ps

If you repeat the steps above several times, you will see that you have multiple sandbox containers still running.

Logs, Errors, Screenshots, and Additional Context

Environment details:

  • Docker version: 4.29.0
  • OS: macOS 14.4.1

Example docker ps output:

% docker ps
CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS          PORTS                      NAMES
a63e75de014e   ghcr.io/opendevin/sandbox:main   "/usr/sbin/sshd -D -…"   14 minutes ago   Up 14 minutes   0.0.0.0:36389->36389/tcp   opendevin-sandbox-2569336a-283a-4aae-8624-1657ea13636bb5ff7e65-7687-4cb0-a1ea-986a2775c27f
909fc44003fd   ghcr.io/opendevin/sandbox:main   "/usr/sbin/sshd -D -…"   15 minutes ago   Up 15 minutes   0.0.0.0:60859->60859/tcp   opendevin-sandbox-2569336a-283a-4aae-8624-1657ea13636b435c7f33-9fed-4c06-8621-b98b3d175b57
095ab0333d73   ghcr.io/opendevin/sandbox:main   "/usr/sbin/sshd -D -…"   15 minutes ago   Up 15 minutes   0.0.0.0:36111->36111/tcp   opendevin-sandbox-2569336a-283a-4aae-8624-1657ea13636bd675c5a2-7c8e-4e71-acad-0bea68136083
@paulmaunders paulmaunders added the bug Something isn't working label May 14, 2024
@SmartManoj SmartManoj added the severity:low Minor issues, code cleanup, etc label May 17, 2024
@imkebe
Copy link

imkebe commented May 17, 2024

I can confirm.

@K-tang-mkv
Copy link
Contributor

got the same problem that sandbox container still running after ctrl+c for quitting app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working severity:low Minor issues, code cleanup, etc
Projects
None yet
Development

No branches or pull requests

4 participants