OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

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

Open vittoriopapa opened this issue 10 months ago • 8 comments

Describe the bug

I run correctly Open Devin and I can see the frontend but I can't send massage to the bot because he sad "starting new task..." "No agent started. Please wait a second...". After the first message "Hi! I'm OpenDevin, an AI Software Engineer. What would you like to build with me today?" he replaced with "Error creating controller. Please check Docker is running using docker ps.". Docker is actually running so I can't understen the error. I tried to restart pc and re-install docker, I check the version and if is running with docker ps but it doesn't work enough.

Setup and configuration

Current version: 0.1.0

Commands I ran to install and run OpenDevin: make build make setup-config make run

Screenshot 2024-04-10 123057

vittoriopapa avatar Apr 10 '24 10:04 vittoriopapa

Describe the bug

I run correctly Open Devin and I can see the frontend but I can't send massage to the bot because he sad "starting new task..." "No agent started. Please wait a second...". After the first message "Hi! I'm OpenDevin, an AI Software Engineer. What would you like to build with me today?" he replaced with "Error creating controller. Please check Docker is running using docker ps.". Docker is actually running so I can't understen the error. I tried to restart pc and re-install docker, I check the version and if is running with docker ps but it doesn't work enough.

Setup and configuration

Current version: 0.1.0

Commands I ran to install and run OpenDevin: make build make setup-config make run

Screenshot 2024-04-10 123057

The ERROR is:

opendevin:ERROR: manager.py:134 - Error creating controller. Traceback (most recent call last): File "/home/vittoriopapa/OpenDevin/opendevin/server/agent/manager.py", line 125, in create_controller self.controller = AgentController( ^^^^^^^^^^^^^^^^ File "/home/vittoriopapa/OpenDevin/opendevin/controller/agent_controller.py", line 86, in init self.command_manager = CommandManager( ^^^^^^^^^^^^^^^ File "/home/vittoriopapa/OpenDevin/opendevin/controller/command_manager.py", line 14, in init self.shell = DockerInteractive( ^^^^^^^^^^^^^^^^^^ File "/home/vittoriopapa/OpenDevin/opendevin/sandbox/sandbox.py", line 139, in init self.start_ssh_session() File "/home/vittoriopapa/OpenDevin/opendevin/sandbox/sandbox.py", line 213, in start_ssh_session self.ssh.login(hostname, username, self._ssh_password, port=2222) File "/home/vittoriopapa/.cache/pypoetry/virtualenvs/opendevin-BgiRA1ye-py3.11/lib/python3.11/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

vittoriopapa avatar Apr 10 '24 10:04 vittoriopapa

Thanks for raising. I'm getting a similar issue. I've tried to troubleshoot; here's what I could find:

Confirmed Docker and SSH: Like above, Docker is running (docker ps shows the sandbox), and a manual SSH attempt fails ("Connection refused"). Inside the Sandbox: I accessed the sandbox with docker exec -it /bin/bash. systemctl is unavailable, suggesting systemd isn't used. /etc/ssh/sshd_config appears standard.

Questions:

Service Management: How do I check SSH server status, start, stop, and restart it within the OpenDevin sandbox? (Haven't seen this addressed in the thread yet) Logs: Where would I find logs related to the SSH server within the sandbox environment?

eddienews-dev avatar Apr 10 '24 12:04 eddienews-dev

I get the same. I think there is already an other open issue about this.

PierrunoYT avatar Apr 10 '24 12:04 PierrunoYT

I have run into the exact same issue after a fresh pull and "make build". Please advise!

sinpsarkar avatar Apr 10 '24 17:04 sinpsarkar

ran into the same error

anthonyyoussef01 avatar Apr 10 '24 19:04 anthonyyoussef01

Hey all--we just merged a possible fix. Try adding SANDBOX_TYPE=exec to your config.toml

rbren avatar Apr 10 '24 21:04 rbren

All: please update git pull, a solution for these issues has just been merged. Set SANDBOX_TYPE to 'exec', in the config.toml file, if you need the older version of container which worked for your installation.

enyst avatar Apr 10 '24 22:04 enyst

thanks. I was just looking for a fix and found out this was updated 1 hour ago lol 👍🏼

CypherpunkSamurai avatar Apr 10 '24 23:04 CypherpunkSamurai

I am still having the same error:

Traceback (most recent call last):
  File "/mnt/c/Users/antho/PycharmProjects/OpenDevin/opendevin/server/agent/manager.py", line 124, in create_controller
    self.controller = AgentController(
                      ^^^^^^^^^^^^^^^^
  File "/mnt/c/Users/antho/PycharmProjects/OpenDevin/opendevin/controller/agent_controller.py", line 86, in __init__
    self.command_manager = CommandManager(
                           ^^^^^^^^^^^^^^^
  File "/mnt/c/Users/antho/PycharmProjects/OpenDevin/opendevin/controller/command_manager.py", line 14, in __init__
    self.shell = DockerInteractive(
                 ^^^^^^^^^^^^^^^^^^
  File "/mnt/c/Users/antho/PycharmProjects/OpenDevin/opendevin/sandbox/sandbox.py", line 135, in __init__
    self.restart_docker_container()
  File "/mnt/c/Users/antho/PycharmProjects/OpenDevin/opendevin/sandbox/sandbox.py", line 393, in restart_docker_container
    raise Exception('Failed to start container')
Exception: Failed to start container

anthonyyoussef01 avatar Apr 11 '24 03:04 anthonyyoussef01

@anthonyyoussef01 add to your config.toml file: SANDBOX_TYPE='exec'

enyst avatar Apr 11 '24 05:04 enyst

@anthonyyoussef01 Check out https://github.com/OpenDevin/OpenDevin/issues/911 for other solution. Key to get it to work for me was uninstalling Docker and reinstalling via WSL.

eddienews-dev avatar Apr 11 '24 06:04 eddienews-dev

File "/home/vittoriopapa/.cache/pypoetry/virtualenvs/opendevin-BgiRA1ye-py3.11/lib/python3.11/site-packages/toml/decoder.py", line 514, in loads raise TomlDecodeError(str(err), original, pos) toml.decoder.TomlDecodeError: Invalid date or number (line 4 column 1 char 126)

I add SANDBOX_TYPE=exec but If I start "make run" I have this error

vittoriopapa avatar Apr 11 '24 07:04 vittoriopapa

File "/Users/huangzhongxi/Library/Caches/pypoetry/virtualenvs/opendevin-6T71_ruG-py3.12/lib/python3.12/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'))

buqiuwenda avatar Apr 11 '24 08:04 buqiuwenda

Ok now is working. I uninstall Docker on my pc and I re-install on WSL, the link between docker desktop and wsl doesn't work.

vittoriopapa avatar Apr 11 '24 08:04 vittoriopapa

SANDBOX_TYPE="exec" like this? or SANDBOX_TYPE=exec? in config.toml

zhoumzh avatar Apr 11 '24 11:04 zhoumzh

File "/Users/huangzhongxi/Library/Caches/pypoetry/virtualenvs/opendevin-6T71_ruG-py3.12/lib/python3.12/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'))

You're on a Mac? You can install Docker Desktop and simply start it, then opendevin can do its thing. If you have more trouble, please open a new issue with the details of your setup.

enyst avatar Apr 11 '24 14:04 enyst

This worked, thank you!

@anthonyyoussef01 Check out #911 for other solution. Key to get it to work for me was uninstalling Docker and reinstalling via WSL.

This worked Thank you!

anthonyyoussef01 avatar Apr 11 '24 17:04 anthonyyoussef01

Hello. I launch Docker and open OpenDevin at “http://localhost:3000/index.html”. The OpenDevin interface itself displays normally, but it says "Error creating controller. Check if Docker is running using docker ps.", "Agent is not running. Wait a second..." and "I did not recognize this action: terminal." I saw that people in the comments write that you can write the symbol "SANDBOX_TYPE=exec" in the file "config.toml" and expect that this should fix the problem, but I cannot find the file "config.toml" (the search function does not helps) to do this. Help me please. Tell me where this file is located. If anything, I have a Mac.

LeonidUIN avatar Apr 20 '24 22:04 LeonidUIN