OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Error creating controller

Open zGamerZz opened this issue 10 months ago • 14 comments

Hey, i finnally managed to run OpenDevin but now this Error is coming in the Inetrface:

Error creating controller. Please check Docker is running using docker ps.

image

Here the docker ps: image

Can someone help me. Thanks in Advance

zGamerZz avatar May 02 '24 15:05 zGamerZz

I also reinstalled the docker image

zGamerZz avatar May 02 '24 17:05 zGamerZz

Go through the Troubleshooting guide.

ghost avatar May 02 '24 18:05 ghost

Add the logs

SmartManoj avatar May 03 '24 08:05 SmartManoj

can you share the logs docker logs -f 'container_name'

natarajan0007 avatar May 03 '24 09:05 natarajan0007

Sure, here is the terminal log. When I run docker logs -f 'container_name' it just load and load and nothing is following...

INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)
INFO:     172.17.0.1:33580 - "GET /index.html HTTP/1.1" 304 Not Modified
INFO:     172.17.0.1:33580 - "GET /assets/index-D59teWsw.js HTTP/1.1" 304 Not Modified
INFO:     172.17.0.1:33596 - "GET /assets/index-CZQzs2DR.css HTTP/1.1" 304 Not Modified
INFO:     ('172.17.0.1', 33604) - "WebSocket /ws?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaWQiOiIwMmMyZTJkZS0wMWVhLTQ4NDMtYWE2NC1lOGJkZWQyMzQyYTQifQ.-ijYRPd6NHBQvqIkNsFVj-0zQR2pdd7_z13oqlVNXFc" [accepted]
INFO:     connection open
Starting loop_recv for sid: 02c2e2de-01ea-4843-aa64-e8bded2342a4
INFO:     172.17.0.1:33596 - "GET /api/refresh-files HTTP/1.1" 200 OK
12:01:36 - opendevin:INFO: agent.py:144 - Creating agent MonologueAgent using LLM gpt-3.5-turbo
12:01:36 - opendevin:INFO: llm.py:51 - Initializing LLM with model: gpt-3.5-turbo
12:01:37 - opendevin:INFO: ssh_box.py:353 - Container stopped
12:01:37 - opendevin:INFO: ssh_box.py:373 - Mounting workspace directory: workspace
12:01:38 - opendevin:INFO: ssh_box.py:396 - Container started
12:01:39 - opendevin:INFO: ssh_box.py:413 - waiting for container to start: 1, container status: running
12:01:39 - opendevin:INFO: ssh_box.py:178 - Connecting to [email protected] via ssh. If you encounter any issues, you can try `ssh -v -p 34617 [email protected]` with the password '20cb14c4-a5f4-4f48-8a68-841c8b5caa66' and report the issue on GitHub.
12:01:39 - opendevin:ERROR: agent.py:155 - Error creating controller: Could not establish connection to host
Traceback (most recent call last):
  File "/app/opendevin/server/agent/agent.py", line 147, in create_controller
    self.controller = AgentController(
                      ^^^^^^^^^^^^^^^^
  File "/app/opendevin/controller/agent_controller.py", line 57, in __init__
    self.action_manager = ActionManager(self.id)
                          ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/controller/action_manager.py", line 33, in __init__
    self.sandbox = DockerSSHBox(
                   ^^^^^^^^^^^^^
  File "/app/opendevin/sandbox/docker/ssh_box.py", line 91, in __init__
    self.start_ssh_session()
  File "/app/opendevin/sandbox/docker/ssh_box.py", line 181, in start_ssh_session
    self.ssh.login(hostname, username, self._ssh_password,
  File "/app/.venv/lib/python3.12/site-packages/pexpect/pxssh.py", line 424, in login
    raise ExceptionPxssh('Could not establish connection to host')
pexpect.pxssh.ExceptionPxssh: Could not establish connection to host
INFO:     172.17.0.1:33580 - "GET /api/messages/total HTTP/1.1" 200 OK
INFO:     172.17.0.1:33596 - "GET /api/litellm-models HTTP/1.1" 200 OK
INFO:     172.17.0.1:33596 - "GET /api/agents HTTP/1.1" 200 OK
INFO:     172.17.0.1:33596 - "GET /api/messages HTTP/1.1" 200 OK

zGamerZz avatar May 03 '24 12:05 zGamerZz

https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting#workarounds-1:~:text=Set%20%2De%20SANDBOX_TYPE%3Dexec%20to%20switch%20to%20the%20ExecBox%20docker%20container

SmartManoj avatar May 03 '24 12:05 SmartManoj

https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting#workarounds-1:~:text=Set%20%2De%20SANDBOX_TYPE%3Dexec%20to%20switch%20to%20the%20ExecBox%20docker%20container

Nope... It doesnß t work... The same issue :/

zGamerZz avatar May 03 '24 12:05 zGamerZz

I was also facing similar issue the only difference is i got the permission denied error. Bc i am running the application under "opendevin" user . it doesnt have privilage to talk to docker socket. After adding this permission the issue resolved

chmod 666 /var/run/docker.sock

natarajan0007 avatar May 03 '24 12:05 natarajan0007

docker run
    --add-host host.docker.internal=host-gateway
    -e LLM_API_KEY="ollama"
    -e LLM_BASE_URL="http://host.docker.internal:11434"
    -e WORKSPACE_MOUNT_PATH=your path
    -v your volume:/opt/workspace_base
    -v /var/run/docker.sock:/var/run/docker.sock
    -p 3000:3000
    ghcr.io/opendevin/opendevin:main

natarajan0007 avatar May 03 '24 12:05 natarajan0007

docker run     --add-host host.docker.internal=host-gateway     -e LLM_API_KEY="ollama"     -e LLM_BASE_URL="http://host.docker.internal:11434"     -e WORKSPACE_MOUNT_PATH=your path     -v your volume:/opt/workspace_base     -v /var/run/docker.sock:/var/run/docker.sock     -p 3000:3000     ghcr.io/opendevin/opendevin:main

Thank you very much the error is solved but now im getting a ton of this errors...:


Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
    yield
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 233, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
    raise exc from None
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
    response = connection.handle_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
    stream = self._connect(request)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 122, in _connect
    stream = self._network_backend.connect_tcp(**kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
    with map_exceptions(exc_map):
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused

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

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 952, in _request
    response = self._client.send(
               ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 232, in handle_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused

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

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai.py", line 414, in completion
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai.py", line 373, in completion
    response = openai_client.chat.completions.create(**data, timeout=timeout)  # type: ignore
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 579, in create
    return self._post(
           ^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1240, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 921, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 976, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1053, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 976, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1053, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 986, in _request
    raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 1028, in completion
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 1001, in completion
    response = openai_chat_completions.completion(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai.py", line 422, in completion
    raise OpenAIError(status_code=500, message=traceback.format_exc())
litellm.llms.openai.OpenAIError: Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
    yield
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 233, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
    raise exc from None
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
    response = connection.handle_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
    stream = self._connect(request)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 122, in _connect
    stream = self._network_backend.connect_tcp(**kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
    with map_exceptions(exc_map):
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused

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

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 952, in _request
    response = self._client.send(
               ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 232, in handle_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused

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

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai.py", line 414, in completion
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai.py", line 373, in completion
    response = openai_client.chat.completions.create(**data, timeout=timeout)  # type: ignore
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 579, in create
    return self._post(
           ^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1240, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 921, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 976, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1053, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 976, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1053, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 986, in _request
    raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/opendevin/controller/agent_controller.py", line 127, in _run
    finished = await self.step(i)
               ^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/controller/agent_controller.py", line 283, in step
    action = self.agent.step(self.state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/agenthub/codeact_agent/codeact_agent.py", line 187, in step
    response = self.llm.completion(
               ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 289, in wrapped_f
    return self(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 379, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 314, in iter
    return fut.result()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 382, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/llm/llm.py", line 112, in wrapper
    resp = completion_unwrapped(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 3129, in wrapper
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 3027, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 2200, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 8965, in exception_type
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 7802, in exception_type
    raise APIError(
litellm.exceptions.APIError: OpenAIException - Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
    yield
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 233, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
    raise exc from None
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
    response = connection.handle_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
    stream = self._connect(request)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 122, in _connect
    stream = self._network_backend.connect_tcp(**kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
    with map_exceptions(exc_map):
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused

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

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 952, in _request
    response = self._client.send(
               ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 232, in handle_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused

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

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai.py", line 414, in completion
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai.py", line 373, in completion
    response = openai_client.chat.completions.create(**data, timeout=timeout)  # type: ignore
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 579, in create
    return self._post(
           ^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1240, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 921, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 976, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1053, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 976, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1053, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 986, in _request
    raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.

zGamerZz avatar May 03 '24 12:05 zGamerZz

you have run to ollama instance first . these errors are belongs to openAI API connection. if you have open AI API key you can replace with that. else follow this instruction how to setup ollama

https://opendevin.github.io/OpenDevin/modules/usage/llms/localLLMs

natarajan0007 avatar May 03 '24 13:05 natarajan0007

I replaced LLM_API_KEY="ollama" with LLM_API_KEY="my key". But now the other Error comes (Error creating controller):

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/docker/api/client.py", line 265, in _raise_for_status
    response.raise_for_status()
  File "/app/.venv/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.45/containers/1b05622b335caa7fd67e99e529985de202cbbae2f1f6effa90fc1a16b144f27a/start

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

Traceback (most recent call last):
  File "/app/opendevin/server/agent/agent.py", line 159, in create_controller
    self.controller = AgentController(
                      ^^^^^^^^^^^^^^^^
  File "/app/opendevin/controller/agent_controller.py", line 75, in __init__
    self.action_manager = ActionManager(self.id)
                          ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/controller/action_manager.py", line 39, in __init__
    self.sandbox = DockerSSHBox(
                   ^^^^^^^^^^^^^
  File "/app/opendevin/runtime/docker/ssh_box.py", line 97, in __init__
    self.restart_docker_container()
  File "/app/opendevin/runtime/docker/ssh_box.py", line 415, in restart_docker_container
    raise ex
  File "/app/opendevin/runtime/docker/ssh_box.py", line 393, in restart_docker_container
    self.container = self.docker_client.containers.run(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/models/containers.py", line 880, in run
    container.start()
  File "/app/.venv/lib/python3.12/site-packages/docker/models/containers.py", line 417, in start
    return self.client.api.start(self.id, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/api/container.py", line 1135, in start
    self._raise_for_status(res)
  File "/app/.venv/lib/python3.12/site-packages/docker/api/client.py", line 267, in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
docker.errors.APIError: 500 Server Error for http+docker://localhost/v1.45/containers/1b05622b335caa7fd67e99e529985de202cbbae2f1f6effa90fc1a16b144f27a/start: Internal Server Error ("Ports are not available: exposing port TCP 0.0.0.0:50083 -> 0.0.0.0:0: listen tcp 0.0.0.0:50083: bind: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig.")
````´

zGamerZz avatar May 03 '24 14:05 zGamerZz

https://github.com/docker/for-win/issues/9561#issuecomment-870560926

SmartManoj avatar May 03 '24 14:05 SmartManoj

docker/for-win#9561 (comment)

Still get the same error (restarted also my pc)

zGamerZz avatar May 03 '24 14:05 zGamerZz

I replaced LLM_API_KEY="ollama" with LLM_API_KEY="my key". But now the other Error comes (Error creating controller):

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/docker/api/client.py", line 265, in _raise_for_status
    response.raise_for_status()
  File "/app/.venv/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.45/containers/1b05622b335caa7fd67e99e529985de202cbbae2f1f6effa90fc1a16b144f27a/start

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

Traceback (most recent call last):
  File "/app/opendevin/server/agent/agent.py", line 159, in create_controller
    self.controller = AgentController(
                      ^^^^^^^^^^^^^^^^
  File "/app/opendevin/controller/agent_controller.py", line 75, in __init__
    self.action_manager = ActionManager(self.id)
                          ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/controller/action_manager.py", line 39, in __init__
    self.sandbox = DockerSSHBox(
                   ^^^^^^^^^^^^^
  File "/app/opendevin/runtime/docker/ssh_box.py", line 97, in __init__
    self.restart_docker_container()
  File "/app/opendevin/runtime/docker/ssh_box.py", line 415, in restart_docker_container
    raise ex
  File "/app/opendevin/runtime/docker/ssh_box.py", line 393, in restart_docker_container
    self.container = self.docker_client.containers.run(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/models/containers.py", line 880, in run
    container.start()
  File "/app/.venv/lib/python3.12/site-packages/docker/models/containers.py", line 417, in start
    return self.client.api.start(self.id, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/api/container.py", line 1135, in start
    self._raise_for_status(res)
  File "/app/.venv/lib/python3.12/site-packages/docker/api/client.py", line 267, in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
docker.errors.APIError: 500 Server Error for http+docker://localhost/v1.45/containers/1b05622b335caa7fd67e99e529985de202cbbae2f1f6effa90fc1a16b144f27a/start: Internal Server Error ("Ports are not available: exposing port TCP 0.0.0.0:50083 -> 0.0.0.0:0: listen tcp 0.0.0.0:50083: bind: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig.")
````´

How can I give the Permissions for the socket?

zGamerZz avatar May 03 '24 15:05 zGamerZz