Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused: An issue that was on track to be resolved (looking at the logs) #306

Open
ryx2 opened this issue Nov 11, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@ryx2
Copy link
Contributor

ryx2 commented Nov 11, 2024

00:03:00 - openhands:INFO: resolve_issue.py:426 - Finished.
ERROR:root:  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 574, in <module>
    main()
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 555, in main
    asyncio.run(
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 409, in resolve_issue
    output = await process_issue(
             ^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 231, in process_issue
    return_val = await complete_runtime(runtime, base_commit)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 95, in complete_runtime
    obs = runtime.run_action(action)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 491, in run_action
    response = send_request(
               ^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands/runtime/utils/request.py", line 60, in send_request
    response = session.request(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)

ERROR:root:<class 'requests.exceptions.ConnectionError'>: HTTPConnectionPool(host='localhost', port=35072): Max retries exceeded with url: /execute_action (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb8be362510>: Failed to establish a new connection: [Errno 111] Connection refused'))
Error: Process completed with exit code 1.

Might the runtime container have had an issue during the bun installation?

@neubig
Copy link
Contributor

neubig commented Nov 11, 2024

Hey @ryx2 , sorry about this! My guess is that maybe the docker runtime ran out of resources while installing bun.
I know @xingyaoww was also talking about related things so CCing here.

@neubig neubig added the bug Something isn't working label Nov 11, 2024
@xingyaoww
Copy link

I see this sometime when there's not enough resource (e.g., CPU, RAM) -- @ryx2 is the agent running something that consume a lot of resource?

Copy link

OpenHands started fixing the issue! You can monitor the progress here.

Copy link

An attempt was made to automatically fix this issue, but it was unsuccessful. A branch named 'openhands-fix-issue-306' has been created with the attempted changes. You can view the branch here. Manual intervention may be required.

@ryx2
Copy link
Contributor Author

ryx2 commented Nov 11, 2024

@xingyaoww it has this connection refused issue after it installs bun. I was only able to fix it by installing bun in the .yml in my fork

Copy link

OpenHands started fixing the issue! You can monitor the progress here.

Copy link

An attempt was made to automatically fix this issue, but it was unsuccessful. A branch named 'openhands-fix-issue-306-try2' has been created with the attempted changes. You can view the branch here. Manual intervention may be required.

@ryx2
Copy link
Contributor Author

ryx2 commented Nov 11, 2024

here's a bit more detail of how this error goes, I'll take a look as well

23:00:41 - openhands:INFO: resolve_issue.py:204 - **CmdOutputObservation (source=EventSource.AGENT, exit code=127)**
bun test tour_scheduling_scenario.test.ts
bash: bun: command not found


==============
[Agent Controller default] LEVEL 0 LOCAL STEP 18 GLOBAL STEP 18

23:00:46 - openhands:INFO: resolve_issue.py:204 - **CmdRunAction (source=EventSource.AGENT)**
THOUGHT: I need to install bun first:
COMMAND:
curl -fsSL https://bun.sh/install | bash
23:00:48 - openhands:INFO: resolve_issue.py:204 - **CmdOutputObservation (source=EventSource.AGENT, exit code=0)**
curl -fsSL https://bun.sh/install | bash
#=#=#                                                                         
##O#-#                                                                        
##O=#  #                                                                      

                                                                           0.1%
####################################################################      94.6%
######################################################################## 100.0%
bun was installed successfully to ~/.bun/bin/bun 

Added "~/.bun/bin" to $PATH in "~/.bashrc" 

To get started, run: 

  source /home/openhands/.bashrc 
  bun --help 


==============
[Agent Controller default] LEVEL 0 LOCAL STEP 19 GLOBAL STEP 19

23:00:51 - openhands:INFO: resolve_issue.py:204 - **CmdRunAction (source=EventSource.AGENT)**
THOUGHT: Let me source the bashrc and try running the test again:
COMMAND:
source ~/.bashrc && cd /workspace && bun test tour_scheduling_scenario.test.ts
23:06:23 - openhands:ERROR: base.py:176 - [runtime 96] Unexpected error while running action 500 Server Error: Internal Server Error for url: http://localhost:35833/execute_action
23:06:23 - openhands:ERROR: base.py:177 - [runtime 96] Problematic action: **CmdRunAction (source=EventSource.AGENT)**
THOUGHT: Let me source the bashrc and try running the test again:
COMMAND:
source ~/.bashrc && cd /workspace && bun test tour_scheduling_scenario.test.ts
23:06:23 - openhands:ERROR: loop.py:23 - 500 Server Error: Internal Server Error for url: http://localhost:35833/execute_action
23:06:24 - openhands:INFO: agent_controller.py:307 - [Agent Controller default] Setting agent(CodeActAgent) state from AgentState.RUNNING to AgentState.ERROR
23:06:24 - openhands:INFO: resolve_issue.py:204 - AgentStateChangedObservation(content='', agent_state=<AgentState.ERROR: 'error'>, observation='agent_state_changed')
23:06:24 - openhands:INFO: resolve_issue.py:88 - ------------------------------
23:06:24 - openhands:INFO: resolve_issue.py:89 - BEGIN Runtime Completion Fn
23:06:24 - openhands:INFO: resolve_issue.py:90 - ------------------------------
23:06:24 - ACTION
**CmdRunAction (source=None)**
COMMAND:
cd /workspace
23:06:24 - openhands:INFO: resolve_issue.py:427 - Finished.
ERROR:root:  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 590, in <module>
    main()
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 570, in main
    asyncio.run(
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 410, in resolve_issue
    output = await process_issue(
             ^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 231, in process_issue
    return_val = await complete_runtime(runtime, base_commit)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands_resolver/resolve_issue.py", line 95, in complete_runtime
    obs = runtime.run_action(action)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 492, in run_action
    response = send_request(
               ^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/openhands/runtime/utils/request.py", line 60, in send_request
    response = session.request(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)

ERROR:root:<class 'requests.exceptions.ConnectionError'>: HTTPConnectionPool(host='localhost', port=35833): Max retries exceeded with url: /execute_action (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f66301600b0>: Failed to establish a new connection: [Errno 111] Connection refused'))

@pvdyck
Copy link

pvdyck commented Nov 15, 2024

@xingyaoww it has this connection refused issue after it installs bun. I was only able to fix it by installing bun in the .yml in my fork

Did you simply add ?

  - name: Install Bun
    run: |
      curl -fsSL https://bun.sh/install | bash
      echo "::add-path::$(bun bin)"

@ryx2
Copy link
Contributor Author

ryx2 commented Nov 15, 2024

I actually just made this work by adding the binary bun linux executable directly to my repo and instructing it in the .openhands_instructions to run with ./bun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants