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]: Docker container restart failed! #1896

Closed
2 tasks done
K-tang-mkv opened this issue May 19, 2024 · 5 comments
Closed
2 tasks done

[Bug]: Docker container restart failed! #1896

K-tang-mkv opened this issue May 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@K-tang-mkv
Copy link
Contributor

Is there an existing issue for the same bug?

Describe the bug

firstly, I type the command

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

Everything works fine with that! But after I press Ctrl+C to quit and then run docker start container_id, it fails!
Here is the log:

docker logs exciting_kare 
Starting OpenDevin...
Setting up enduser with id 1000
Docker socket group id: 998
systemd-network:x:998:
Group with id 998 already exists
Running as enduser

INFO:     Started server process [34]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)

^C
Session terminated, killing shell...INFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [34]
 ...killed.
Starting OpenDevin...
Setting up enduser with id 1000
useradd: user 'enduser' already exists
Failed to create user enduser with id 1000. Moving opendevin user.
useradd: user 'enduser' already exists
Failed to create user enduser with id 1000 for a second time. Exiting.

The log points out that it failed to create the user 'enduser' with id 1000, so it exits immediately. How can I avoid this and start the container correctly?

Current Version

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
crtl+c


### Model and Agent

_No response_

### Reproduction Steps

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


crtl+c


docker start container_id


docker logs container_id



### Logs, Errors, Screenshots, and Additional Context

_No response_
@K-tang-mkv K-tang-mkv added the bug Something isn't working label May 19, 2024
@SmartManoj
Copy link
Collaborator

Could you check the main version?

@K-tang-mkv
Copy link
Contributor Author

Could you check the main version?

I try to use the main version, but the same problem with that.
Reproduce:

docker pull ghcr.io/opendevin/opendevin:main
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:main
ctrl+c
docker ps -a
CONTAINER ID   IMAGE                              COMMAND                  CREATED          STATUS                      PORTS     NAMES
863e43dd7292   ghcr.io/opendevin/opendevin:main   "/app/entrypoint.sh …"   13 minutes ago   Exited (1) 12 minutes ago             xenodochial_ride
6bb46d7a1e72   ghcr.io/opendevin/opendevin:0.5    "/app/entrypoint.sh …"   3 hours ago      Exited (1) 40 minutes ago             exciting_kare
docker start xenodochial_ride

It fails to start!

docker logs xenodochial_ride
Starting OpenDevin...
Setting up enduser with id 1000
Docker socket group id: 998
systemd-network:x:998:
Group with id 998 already exists
Running as enduser
/app/.venv/lib/python3.12/site-packages/llama_index_client/types/metadata_filter.py:20: SyntaxWarning: invalid escape sequence '\*'
  """
There was a problem when trying to write in your cache folder (/home/enduser/.cache/huggingface/hub). You should set the environment variable TRANSFORMERS_CACHE to a writable directory.
INFO:     Started server process [34]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)

^C
Session terminated, killing shell...INFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [34]
 ...killed.
Starting OpenDevin...
Setting up enduser with id 1000
useradd: user 'enduser' already exists
Failed to create user enduser with id 1000. Moving opendevin user.
useradd: user 'enduser' already exists
Failed to create user enduser with id 1000 for a second time. Exiting.

@SmartManoj
Copy link
Collaborator

Could you able to run it as root?

@K-tang-mkv
Copy link
Contributor Author

sudo docker start xenodochial_ride

Still fail to start as root.

@SmartManoj
Copy link
Collaborator

for the docker run command itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants