All-Hands-AI / OpenHands

πŸ™Œ OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
31.71k stars 3.66k forks source link

Error! Error while fetching server API version #393

Closed 24naret closed 5 months ago

24naret commented 5 months ago

Describe the bug

Steps to Reproduce

  1. everything in "new" install doc (pipenv etc)
  2. docker ps returns:
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. pulling docke image is ok
    > docker pull ghcr.io/opendevin/sandbox
    Using default tag: latest
    latest: Pulling from opendevin/sandbox
    f4bb4e8dca02: Already exists
    3da4c7328b64: Pull complete
    Digest: sha256:4ddb29bafcec23016cd2e760a1aa8c4f1719c7afd4818e3b357c55d23d7e5508
    Status: Downloaded newer image for ghcr.io/opendevin/sandbox:latest
    ghcr.io/opendevin/sandbox:latest
  4. starting backend is OK
    INFO:     Started server process [8544]
    INFO:     Waiting for application startup.
    INFO:     Application startup complete.
    INFO:     Uvicorn running on http://127.0.0.1:3000 (Press CTRL+C to quit)
  5. starting frontend as well

    
    
    ➜  Local:   http://localhost:3001/
    ➜  Network: use --host to expose
    ➜  press h + enter to show help

🌼 daisyUI 4.9.0 β”œβ”€ βœ”οΈŽ 1 theme added https://daisyui.com/docs/themes ╰─ β˜… Star daisyUI on GitHub https://github.com/saadeghi/daisyui

🌼 daisyUI 4.9.0 β”œβ”€ βœ”οΈŽ 1 theme added https://daisyui.com/docs/themes ╰─ β˜… Star daisyUI on GitHub https://github.com/saadeghi/daisyui

7. Accessing webpage throws error in server console:
```INFO:     ('127.0.0.1', 50486) - "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:50487 - "GET /litellm-models HTTP/1.1" 200 OK
INFO:     127.0.0.1:50488 - "GET /litellm-models HTTP/1.1" 200 OK

Additional context Machine Mac M1 config.toml:

LLM_API_KEY=""
WORKSPACE_DIR="/Volumes/Untitled/develop/opendevin-workspace"
LLM_MODEL="ollama/llama2"
LLM_BASE_URL="http://localhost:11434"
rbren commented 5 months ago

@24naret did you run docker ps with sudo?

24naret commented 5 months ago

No just docker ps

I get the same whe trying to run manually as described in server:

❯ PYTHONPATH=`pwd` python3 opendevin/sandbox/sandbox.py -d /Volumes/Untitled/develop/opendevin-workspace
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'))
Failed to start Docker container: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
24naret commented 5 months ago

Got it: On Mac M1(2,3?) in the docker Desktop you need to click: advanced settings --> check β€œAllow the default Docker socket to be used (requires password)”. So maybe add this to the README.md and change this from bug to doc.

ivy00johns commented 5 months ago

Got it: On Mac M1(2,3?) in the docker Desktop you need to click: advanced settings --> check β€œAllow the default Docker socket to be used (requires password)”. So maybe add this to the README.md and change this from bug to doc.

This fixed the issue for me. Thank you!

heisentberg commented 5 months ago

Got it: On Mac M1(2,3?) in the docker Desktop you need to click: advanced settings --> check β€œAllow the default Docker socket to be used (requires password)”. So maybe add this to the README.md and change this from bug to doc.

It's not working for me at all. I'm using a MacBook Air M2.

adsodemelk commented 5 months ago

What If am I using Colima instead of Docker for Desktop?

rbren commented 5 months ago

What If am I using Colima instead of Docker for Desktop?

You're on your own! Let us know how it goes though πŸ˜„ Colima actually looks pretty neat, I might give it a go sometime

Going to count his as solved. @adsodemelk and @heisentberg feel free to open a separate issue with specific details/logs/error messages

adsodemelk commented 5 months ago

Is actually very simple @rbren and maybe useful. I write the solution here in case is useful (may need tweak with different colima versions). You need to find the socket using colima status command and assign it do DOCKER_HOSTenv variable: export DOCKER_HOST=$(colima status 2>&1 | grep 'socket:' | awk '{print $4}')

heisentberg commented 5 months ago

Finally, the M2 MacBook now functions properly. This was achieved by uninstalling and then reinstalling Docker Desktop. Additionally, I ensured that the setting 'Allow the default Docker socket to be used (requires password)' was enabled, which resolved the issue.