OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Cannot run docker image and send message to agent

Open alexsiu398 opened this issue 1 year ago • 14 comments

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:

  1. For the docker image "ghcr.io/opendevin/sandbox:latest", I try to run the image but it exited immediately.
  2. 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.

alexsiu398 avatar Apr 05 '24 01:04 alexsiu398

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.

foragerr avatar Apr 05 '24 01:04 foragerr

@alexsiu398 I guess you are not using the latest version try to pull the latest main

anasdorbani avatar Apr 05 '24 01:04 anasdorbani

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

alexsiu398 avatar Apr 05 '24 03:04 alexsiu398

did you rerun make build?

anasdorbani avatar Apr 05 '24 03:04 anasdorbani

did you rerun make build?

Yes. I pull the main,activate python environment and reinstall using make build

alexsiu398 avatar Apr 05 '24 03:04 alexsiu398

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.

enyst avatar Apr 05 '24 04:04 enyst

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

alexsiu398 avatar Apr 05 '24 06:04 alexsiu398

Please check Docker is running using docker ps.

What is the output of docker ps?

enyst avatar Apr 05 '24 10:04 enyst

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?

Starsek avatar Apr 05 '24 14:04 Starsek

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

williamliawdesign avatar Apr 05 '24 19:04 williamliawdesign

It is already at the above settings but still not happening

image

DOLARIK avatar Apr 06 '24 18:04 DOLARIK

@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.

rbren avatar Apr 07 '24 22:04 rbren

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 Screenshot from 2024-04-08 09-10-59

alexsiu398 avatar Apr 08 '24 01:04 alexsiu398

@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 Screenshot 2024-04-09 at 11 43 06 AM

rbren avatar Apr 09 '24 16:04 rbren

Should be fixed with the new docker installation method

rbren avatar Apr 15 '24 14:04 rbren