All-Hands-AI / OpenHands

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

Could not establish connection to host #982

Closed DXLgpt closed 5 months ago

DXLgpt commented 5 months ago

Describe the bug

can not connect the agent F2C0{VPKT%`Q)FHLCLU{%F4 1WG%7@Z1R9JH5C51~3~Y7FJ

Setup and configuration

Current version:#941

WSL2+ubuntu

DOCKER:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bce3d286af8a ghcr.io/opendevin/sandbox "/usr/sbin/sshd -D -…" 2 minutes ago Up 2 minutes sandbox-a802f37d-0483-4d24-ab6d

Commands I ran to install and run OpenDevin:

1.make build 2.make setup-config 3.make run

Steps to Reproduce:

1.make build by #941 2.make setup-config(GPT3.5+openai+workspace) 3.make run 4.o+enter

Logs, error messages, and screenshots:

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

Additional Context

enyst commented 5 months ago

Does the console show you a password you can try to connect with, directly, just to see if it works? It should be a message saying to connect with ssh -v -p opendevin@localhost, I think.

DXLgpt commented 5 months ago

Does the console show you a password you can try to connect with, directly, just to see if it works? It should be a message saying to connect with ssh -v -p opendevin@localhost, I think.

Does the console show you a password you can try to connect with, directly, just to see if it works? It should be a message saying to connect with ssh -v -p opendevin@localhost, I think.

there isn't any password show me...

enyst commented 5 months ago

OK, even without password, if you try ssh -v -p 2222 opendevin@localhost what happens? Paste it here for some random password.

rbren commented 5 months ago

Should be fixed by https://github.com/OpenDevin/OpenDevin/pull/983, if you add SANDBOX_TYPE=exec to your config.toml

rbren commented 5 months ago

983 is merged now--try adding SANDBOX_TYPE=exec to your config.toml

DXLgpt commented 5 months ago

OK, even without password, if you try ssh -v -p 2222 opendevin@localhost what happens? Paste it here for some random password.

(opendevin-py3.11) dxl@WIN-EJOAN8:/mnt/f/1Coding/OpenDevin$ ssh -v -p 2222 opendevin@localhost OpenSSH_8.9p1 Ubuntu-3ubuntu0.4, OpenSSL 3.0.2 15 Mar 2022 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for debug1: Connecting to localhost [127.0.0.1] port 2222. debug1: connect to address 127.0.0.1 port 2222: Connection refused ssh: connect to host localhost port 2222: Connection refused

DXLgpt commented 5 months ago

983 is merged now--try adding SANDBOX_TYPE=exec to your config.toml

it's working, but find out another issue. thank you

DXLgpt commented 5 months ago

https://github.com/OpenDevin/OpenDevin/pull/983 is merged now--try adding SANDBOX_TYPE=exec to your config.toml

This is working.

katmai commented 5 months ago

SANDBOX_TYPE="exec"

don't forget the quotes

katmai commented 5 months ago

983 is merged now--try adding SANDBOX_TYPE=exec to your config.toml

however with this implementation i notice that the line that output the ssh connect string and the password is now missing.

enyst commented 5 months ago

983 is merged now--try adding SANDBOX_TYPE=exec to your config.toml

however with this implementation i notice that the line that output the ssh connect string and the password is now missing.

You're right, and it's because it doesn't try to ssh anymore, if you choose "exec". I mean, we have two options now: you can choose "exec" or "ssh". So if you choose exec, then it's the old style sandbox, which isn't connected via ssh.

Anujh23 commented 5 months ago

Oops. Something went wrong: Error code: 400 - {'error': {'code': 'OperationNotSupported', 'message': 'The embeddings operation does not work with the specified model, gpt-35-turbo. Please choose different model and try again. You can learn more about which models can be used with each operation here: https://go.microsoft.com/fwlink/?linkid=2197993.'}}

LLM_MODEL="gpt-35-turbo" LLM_API_KEY="xxx" LLM_EMBEDDING_MODEL="azureopenai" LLM_BASE_URL="https://azureai002.openai.azure.com/" LLM_DEPLOYMENT_NAME="xx" LLM_API_VERSION="2024-02-15-preview" WORKSPACE_DIR="./workspace" SANDBOX_TYPE="exec"

I have also tried gpt-4.

enyst commented 5 months ago

@Anujh23 can you please check the deployment name as documented here: https://github.com/OpenDevin/OpenDevin/blob/main/docs/documentation/AZURE_LLM_GUIDE.md#2-embeddings

It sounds like you're using a "deployment" defined in Azure for gpt-35, but this parameter needs an embeddings deployment.