OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: RuntimeError: Failed to source ~/.bashrc with exit code -1 and output Command: "source ~/.bashrc" timed out.

Open baoge2778 opened this issue 1 year ago • 3 comments

Is there an existing issue for the same bug?

  • [X] I have checked the troubleshooting document at https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting
  • [X] I have checked the existing issues.

Describe the bug

06:09:21 - opendevin:ERROR: ssh_box.py:224 - Command timed out, killing process... 06:09:51 - opendevin:ERROR: agent.py:138 - Error creating controller: Failed to source ~/.bashrc with exit code -1 and output Command: "source ~/.bashrc" timed out. Sending SIGINT to the process: root@45731512d9b8:/workspace# ^C root@45731512d9b8:/workspace# Traceback (most recent call last): File "/app/opendevin/server/agent/agent.py", line 130, in create_controller self.controller = AgentController( ^^^^^^^^^^^^^^^^ File "/app/opendevin/controller/agent_controller.py", line 82, in init self.action_manager.init_sandbox_plugins(agent.sandbox_plugins) File "/app/opendevin/controller/action_manager.py", line 48, in init_sandbox_plugins self.sandbox.init_plugins(plugins) File "/app/opendevin/runtime/plugins/mixin.py", line 47, in init_plugins raise RuntimeError( RuntimeError: Failed to source ~/.bashrc with exit code -1 and output Command: "source ~/.bashrc" timed out. Sending SIGINT to the process: root@45731512d9b8:/workspace# ^C root@45731512d9b8:/workspace#

Current Version

ghcr.io/opendevin/opendevin:1651-merge

Installation and Configuration

docker run
--pull=always
-e SANDBOX_USER_ID=$(id -u)
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE
-v $WORKSPACE_BASE:/opt/workspace_base
-v /var/run/docker.sock:/var/run/docker.sock
-p 3000:3000
--add-host host.docker.internal:host-gateway
ghcr.io/opendevin/opendevin:1651-merge

Model and Agent

No response

Reproduction Steps

System Configuration:

Static hostname: node3 Icon name: computer-vm Chassis: vm Virtualization: microsoft Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-1160.el7.x86_64 Architecture: x86-64

Docker version : Docker version 26.1.1, build 4cf5afa

user: root

steps: 1.starting the docker command, 2.I can access the ui, 3.after waiting for the initialization to complete, the error appears

ps: Because when I use version ghcr.io/opendevin/opendevin:0.5, I will get the error SANDBOX_USER_ID cannot be 0. Please run with a different user id.error, so I use 1651-merge.

Logs, Errors, Screenshots, and Additional Context

No response

baoge2778 avatar May 10 '24 02:05 baoge2778

Are there any other errors in the log before this?

Workaround: Increase the timeout https://github.com/OpenDevin/OpenDevin/blob/f8d4b1ab0d85edfc584d0b4cd1960c3968b5f336/opendevin/runtime/docker/ssh_box.py#L48

SmartManoj avatar May 10 '24 03:05 SmartManoj

There was an warning at the beginning

Starting OpenDevin... Running OpenDevin as root /app/.venv/lib/python3.12/site-packages/pydantic/_internal/fields.py:160: UserWarning: Field "model_group_retry_policy" has conflict with protected namespace "model". You may be able to resolve this warning by setting model_config['protected_namespaces'] = (). warnings.warn( INFO: Started server process [10] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)

baoge2778 avatar May 10 '24 05:05 baoge2778

We can ignore that warning.

SmartManoj avatar May 10 '24 12:05 SmartManoj

I use the main version and it works now, thank you all

docker run
--pull=always
-e SANDBOX_USER_ID=$(id -u)
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE
-v $WORKSPACE_BASE:/opt/workspace_base
-v /var/run/docker.sock:/var/run/docker.sock
-p 3000:3000
--add-host host.docker.internal:host-gateway
ghcr.io/opendevin/opendevin:main

baoge2778 avatar May 11 '24 05:05 baoge2778