OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

allow running app as root

Open rbren opened this issue 1 year ago • 2 comments

Fixes: https://github.com/OpenDevin/OpenDevin/issues/1629

rbren avatar May 08 '24 15:05 rbren

Current issue is that source ~/.bashrc hangs when running as root user

rbren avatar May 09 '24 17:05 rbren

@xingyaoww any ideas why source ~/.bashrc times out when running as root?

I get

00:45:36 - opendevin:ERROR: ssh_box.py:231 - Command timed out, killing process...
00:46:07 - opendevin:ERROR: agent.py:125 - Error creating controller: Failed to source ~/.bashrc with exit code -1 and output Command: "source ~/.bashrc" timed out. Sending SIGINT to the process: root@f4a634cb4d2a:/workspace# ^C
root@f4a634cb4d2a:/workspace#
Traceback (most recent call last):
  File "/app/opendevin/server/agent/agent.py", line 117, in create_controller
    self.controller = AgentController(
                      ^^^^^^^^^^^^^^^^
  File "/app/opendevin/controller/agent_controller.py", line 82, in __init__
    self.runtime.init_sandbox_plugins(agent.sandbox_plugins)
  File "/app/opendevin/runtime/runtime.py", line 66, 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@f4a634cb4d2a

rbren avatar May 10 '24 01:05 rbren

@rbren Just pushed a new commit and it fixes the hang issue, at least when i was running:

RUN_AS_DEVIN=False python3 opendevin/runtime/docker/ssh_box.py

xingyaoww avatar May 10 '24 20:05 xingyaoww

It works! Thanks Xingyao

rbren avatar May 10 '24 20:05 rbren