All-Hands-AI / OpenHands

🙌 OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
31.27k stars 3.61k forks source link

Error creating connection. I have added `SANDBOX_TYPE="exec"` in the config.toml. I am using Mac and Docker desktop. I checked the docker `docker ps`. There is nothing running. I checked inside docker desktop. The image is there but not running. When I manually clicked run from the docker desktop, I got `Exited (0)` #1084

Closed hongthana closed 5 months ago

hongthana commented 5 months ago

image

I am using Mac and Docker desktop.

For the git, I followed these steps: git fetch -> git checkout main -> git pull

After that I followed these steps: make build -> make set-config -> make run

I still cannot get it to run. The frontend is okay. However, there was no response from the backend.

In the log file, I found "Error creating controller.".

After searching issues, I found a workaround by adding SANDBOX_TYPE="exec" in the config.toml. However, it is still not working. config.toml LLM_MODEL="claude-3-opus-20240229" LLM_API_KEY="" LLM_EMBEDDING_MODEL="" WORKSPACE_DIR="./workspace" SANDBOX_TYPE="exec"

I checked the docker docker ps. There is nothing running. I ran docker ps -l. The docker was there ghcr.io/opendevin/sandbox:latest

I checked inside docker desktop. The image was there, but not running. When I manually clicked run from the Docker desktop, I got Exited (0).

Here is the log: INFO: Started server process [7409] 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', 53398) - "WebSocket /ws?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaWQiOiIzOTU4MWZkOC0zYWQ2LTQwNTYtYTRmMi1hNGZjNzQyMWZhODQifQ.cfABOSoUuWHjFJjk82AhH51S5dxgZL66I0X_wHX-oTs" [accepted] INFO: connection open Starting loop_recv for sid: 39581fd8-3ad6-4056-a4f2-a4fc7421fa84, False Error creating controller. INFO: 127.0.0.1:53401 - "GET /litellm-models HTTP/1.1" 200 OK INFO: 127.0.0.1:53402 - "GET /litellm-agents HTTP/1.1" 200 OK INFO: 127.0.0.1:53403 - "GET /messages/total HTTP/1.1" 200 OK INFO: 127.0.0.1:53399 - "GET /refresh-files HTTP/1.1" 200 OK INFO: 127.0.0.1:53404 - "GET /litellm-models HTTP/1.1" 200 OK INFO: 127.0.0.1:53400 - "GET /default-model HTTP/1.1" 200 OK INFO: 127.0.0.1:53406 - "GET /litellm-agents HTTP/1.1" 200 OK INFO: 127.0.0.1:53410 - "GET /messages/total HTTP/1.1" 200 OK INFO: 127.0.0.1:53412 - "GET /refresh-files HTTP/1.1" 200 OK INFO: 127.0.0.1:53413 - "GET /default-model HTTP/1.1" 200 OK INFO: 127.0.0.1:53419 - "GET /messages HTTP/1.1" 200 OK

Please help. I've tried to solve this issue for a few days.

hongthana commented 5 months ago

I tried poetry run python opendevin/main.py -d ./workspace/ -t "write a bash script that prints hi". It gave me an error as below:.

/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "modelid" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = (). warnings.warn( /Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "modelname" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = (). warnings.warn( /Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "modelinfo" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = (). warnings.warn( Running agent MonologueAgent (model: claude-3-opus-20240229, directory: ./workspace/) with task: "write a bash script that prints hi" Traceback (most recent call last): File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/connectionpool.py", line 793, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request conn.request( File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/connection.py", line 400, in request self.endheaders() File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/http/client.py", line 1037, in _send_output self.send(msg) File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/http/client.py", line 975, in send self.connect() File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/transport/unixconn.py", line 27, in connect sock.connect(self.unix_socket) FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/connectionpool.py", line 847, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/util/retry.py", line 470, in increment raise reraise(type(error), error, _stacktrace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/util/util.py", line 38, in reraise raise value.with_traceback(tb) File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/connectionpool.py", line 793, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request conn.request( File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/urllib3/connection.py", line 400, in request self.endheaders() File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/http/client.py", line 1037, in _send_output self.send(msg) File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/http/client.py", line 975, in send self.connect() File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/transport/unixconn.py", line 27, in connect sock.connect(self.unix_socket) urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/api/client.py", line 213, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) ^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/utils/decorators.py", line 44, in inner return f(self, *args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/api/client.py", line 236, in _get return self.get(url, self._set_request_timeout(kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/thanawatraibroycharoen/OpenDevin/opendevin/main.py", line 96, in asyncio.run(main()) File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/asyncio/base_events.py", line 650, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/OpenDevin/opendevin/main.py", line 88, in main controller = AgentController( ^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/OpenDevin/opendevin/controller/agent_controller.py", line 85, in init self.command_manager = CommandManager(self.id, workdir, container_image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/OpenDevin/opendevin/controller/command_manager.py", line 15, in init self.shell = DockerInteractive( ^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/OpenDevin/opendevin/sandbox/sandbox.py", line 125, in init if not self.is_container_running(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/OpenDevin/opendevin/sandbox/sandbox.py", line 235, in is_container_running docker_client = docker.from_env() ^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/client.py", line 94, in from_env return cls( ^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/client.py", line 45, in init self.api = APIClient(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/api/client.py", line 197, in init self._version = self._retrieve_server_version() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/thanawatraibroycharoen/opt/anaconda3/envs/OpenDevin/lib/python3.11/site-packages/docker/api/client.py", line 220, in _retrieve_server_version raise DockerException( docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

hongthana commented 5 months ago

Solved it. Refer to this issue

https://github.com/OpenDevin/OpenDevin/issues/278