OpenHands
OpenHands copied to clipboard
Cannot run docker image and send message to agent
Describe the bug
Cannot run docker image and send message to agent
Setup and configuration
Current version: commit b672ac3632c42ef148602e59e6789f6cf40831e6 (HEAD -> main, origin/main, origin/HEAD) Author: Paweł Ciosek [email protected] Date: Wed Apr 3 02:57:30 2024 +0200
My config.toml and environment vars (be sure to redact API keys): LLM_API_KEY="11111111111111111111" WORKSPACE_DIR="workspace" LLM_BASE_URL="http://localhost:11434" LLM_MODEL= "ollama/gemma:7b-instruct-q5_K_M" LLM_EMBEDDING_MODEL="gemma"
My model and agent (you can see these settings in the UI):
- Model: gemma
- Agent:ollama
Commands I ran to install and run OpenDevin: make build make run
Steps to Reproduce:
- For the docker image "ghcr.io/opendevin/sandbox:latest", I try to run the image but it exited immediately.
- Typed "make run", http://localhost:3001/ can be accessed but cannot send any message to agent.
Logs, error messages, and screenshots: make run Running the app... make[1]: Entering directory '/home/dt-qa/alex_workspace/OpenDevin' make[1]: Entering directory '/home/dt-qa/alex_workspace/OpenDevin' Starting frontend... Starting backend...
[email protected] start vite --port 3001
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
VITE v5.2.7 ready in 283 ms
➜ Local: http://localhost:3001/
➜ Network: use --host to expose
INFO: Started server process [16414]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:3000 (Press CTRL+C to quit)
INFO: 127.0.0.1:53918 - "GET / HTTP/1.1" 404 Not Found
INFO: ('127.0.0.1', 60314) - "WebSocket /ws" [accepted]
INFO: connection open
INFO: 127.0.0.1:60330 - "GET /litellm-models HTTP/1.1" 200 OK
INFO: 127.0.0.1:60336 - "GET /litellm-agents HTTP/1.1" 200 OK
INFO: 127.0.0.1:60348 - "GET /litellm-models HTTP/1.1" 200 OK
INFO: 127.0.0.1:60354 - "GET /litellm-agents HTTP/1.1" 200 OK
Please check Docker is running using docker ps.
Error! Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Failed to stop container: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Error creating controller.
That error means OpenDevin is unable to talk to docker daemon, there could be a few reasons - anything from docker is not running to docker socket is not shared. Did you try searching for this issue, there are a few suggested troubleshooting steps in prior issues.
@alexsiu398 I guess you are not using the latest version try to pull the latest main
I pull the main again and use python 3.11.8. docker image is running using the command "docker run -it --name opendevin ghcr.io/opendevin/sandbox:latest". Frontend shows Initializing agent but it stills cannot send any message.
make run Running the app... Waiting for the backend to start...
[email protected] start vite --port 3001 VITE v5.2.8 ready in 291 ms ➜ Local: http://localhost:3001/ ➜ Network: use --host to expose ➜ press h + enter to show help
did you rerun make build?
did you rerun
make build?
Yes. I pull the main,activate python environment and reinstall using make build
Can you look in the ./logs directory, there should be a backend log. Can you paste the latest errors in that file?
Alternatively, you can run separately with: make start-backend, then, when it starts, in another terminal: make start-frontend. The backend terminal should show if it starts or not, and why.
Can you look in the ./logs directory, there should be a backend log. Can you paste the latest errors in that file?
Alternatively, you can run separately with: make start-backend, then, when it starts, in another terminal: make start-frontend. The backend terminal should show if it starts or not, and why.
You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
INFO: Started server process [49217]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:3000 (Press CTRL+C to quit)
INFO: ('127.0.0.1', 50952) - "WebSocket /ws" [accepted]
INFO: connection open
Please check Docker is running using docker ps.
Error! Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Failed to stop container: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Error creating controller.
INFO: 127.0.0.1:50982 - "GET /litellm-models HTTP/1.1" 200 OK
INFO: 127.0.0.1:50996 - "GET /litellm-agents HTTP/1.1" 200 OK
INFO: 127.0.0.1:50968 - "GET /default-model HTTP/1.1" 200 OK
INFO: 127.0.0.1:51018 - "GET /litellm-models HTTP/1.1" 200 OK
INFO: 127.0.0.1:51024 - "GET /litellm-agents HTTP/1.1" 200 OK
INFO: 127.0.0.1:51010 - "GET /default-model HTTP/1.1" 200 OK
INFO: connection closed
INFO: ('127.0.0.1', 42210) - "WebSocket /ws" [accepted]
INFO: connection open
Client websocket disconnected (1001, None)
Please check Docker is running using docker ps.
Error! Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Failed to stop container: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Error creating controller.
INFO: 127.0.0.1:42226 - "GET /litellm-models HTTP/1.1" 200 OK
INFO: 127.0.0.1:42238 - "GET /litellm-agents HTTP/1.1" 200 OK
INFO: 127.0.0.1:42222 - "GET /default-model HTTP/1.1" 200 OK
INFO: 127.0.0.1:42250 - "GET /litellm-models HTTP/1.1" 200 OK
INFO: 127.0.0.1:42260 - "GET /litellm-agents HTTP/1.1" 200 OK
INFO: 127.0.0.1:42244 - "GET /default-model HTTP/1.1" 200 OK
INFO: connection closed
Please check Docker is running using docker ps.
What is the output of docker ps?
I have the same issue. my docker ps says that there is no running container. Who starts the container? Is it automatically starting with make run?
Try this Open Docker Desktop settings. Go to "Settings" > "Advanced". Check the box for "Allow the default Docker socket to be used (requires password)". Restart Docker Desktop.
See also #728
It is already at the above settings but still not happening
@DOLARIK we need more information about your environment and the problem you're seeing. Can you file a new issue and fill out the template?
The docker container only starts up when a task is started, I believe. But docker ps (without sudo) should successfully output at least an empty list. The error message Error while fetching server API version means essentially that the backend isn't able to run docker ps.
Please check Docker is running using docker ps.
What is the output of docker ps?
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e44b248a1e1f ghcr.io/opendevin/sandbox:latest "/bin/bash" 3 minutes ago Up 3 minutes opendevin
Try this Open Docker Desktop settings. Go to "Settings" > "Advanced". Check the box for "Allow the default Docker socket to be used (requires password)". Restart Docker Desktop.
See also #728
I am using docker desktop on linux but I cannot find the advanced setting
@alexsiu398 it should be in the left nav, but it seems it's not always there for some envs...
You can try googling why Advanced isn't there--I've only seen explanations for windows so far
Should be fixed with the new docker installation method