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

[Bug]: Failed to establish new connection to runtime #4723

Closed
1 task done
malhotra5 opened this issue Nov 3, 2024 · 1 comment
Closed
1 task done

[Bug]: Failed to establish new connection to runtime #4723

malhotra5 opened this issue Nov 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@malhotra5
Copy link
Contributor

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

Attempting to run Openhands development with the following command DEBUG=true sudo make run. I've allowed for default Docker socket to be used from advanced settings on MacOs. Openhands runs fine until I request a task. Sample request attached below

I want to create a React app to view all of the open pull requests that exist on all of my team's github repos. Here are some details:

Please initialize the app using vite and react-ts.
You can test the app on the https://github.com/OpenDevin/ github org
I have provided a github token in the environment (the variable name is $GITHUB_TOKEN)
It should have a dropdown that allows me to select a single repo within the org.
There should be tests written using vitest.
When things are working, initialize a github repo, create a .gitignore file, and commit the changes.

A runtime is created

15:47:10 - openhands:INFO: base.py:98 - [runtime 1eac2587-4bc8-4b12-9272-2f77de5e305e] Container started: openhands-runtime-1eac2587-4bc8-4b12-9272-2f77de5e305e
15:47:10 - openhands:INFO: base.py:98 - [runtime 1eac2587-4bc8-4b12-9272-2f77de5e305e] Waiting for client to become ready at http://localhost:31427...

However, the connection is never made to localhost:31427 and max retries are attempted.

OpenHands Installation

Development workflow

OpenHands Version

main

Operating System

MacOS

Logs, Errors, Screenshots, and Additional Context

Running the app...
Starting backend server...
Waiting for the backend to start...
INFO:     Started server process [74663]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:3000 (Press CTRL+C to quit)
Connection to localhost port 3000 [tcp/hbci] succeeded!
Backend started successfully.
Starting frontend...

> [email protected] dev
> npm run make-i18n && VITE_MOCK_API=false remix vite:dev --port 3001 --host 127.0.0.1


> [email protected] make-i18n
> node scripts/make-i18n-translations.cjs

  ➜  Local:   http://127.0.0.1:3001/
  ➜  press h + enter to show help
INFO:     127.0.0.1:51451 - "GET / HTTP/1.1" 200 OK
INFO:     127.0.0.1:51451 - "GET /assets/root-C13iIuce.css HTTP/1.1" 200 OK
INFO:     127.0.0.1:51453 - "GET /assets/manifest-f813f68a.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/entry.client-B8Ew7Aa5.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51451 - "GET /assets/jsx-runtime-zhgTtAea.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/components-C4zGJJwK.js HTTP/1.1" 200 OK
INFO:     127.0.0.1:51453 - "GET /assets/react-redux-DzUTqGNF.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/index-Bv3ft2Ye.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51453 - "GET /assets/socket-B39-LSlI.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51453 - "GET /assets/store-CT-MXBfU.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/router-CQIzOUUf.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51453 - "GET /assets/index-DvhLSMS6.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/i18nInstance-DCxlOlkw.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/AgentState-DCyv5jZT.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51453 - "GET /assets/agentSlice-0xeL04tr.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51451 - "GET /assets/codeSlice-IFyzp_hl.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51451 - "GET /assets/root-jKYyIQ6D.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51453 - "GET /assets/index-BgBamcox.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51453 - "GET /locales/en/translation.json HTTP/1.1" 200 OK
INFO:     127.0.0.1:51453 - "GET /assets/_oh-yUAYRWBU.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51451 - "GET /assets/route-Bn5XcCF0.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51451 - "GET /assets/utils-p7Tk_-vA.js HTTP/1.1" 200 OK
INFO:     127.0.0.1:51453 - "GET /assets/connect-to-github-modal-CK1XBvUe.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/generate-github-auth-url-CGV-URLP.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/modal-backdrop-CXhb-o7L.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51451 - "GET /assets/open-hands-BOkBFOmY.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51451 - "GET /assets/responses-iq082X3z.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/extends-CEetKkoc.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51451 - "GET /assets/settings-DawUpo-u.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /assets/user-is-authenticated-BVDzhE9t.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51455 - "GET /config.json HTTP/1.1" 200 OK
INFO:     127.0.0.1:51451 - "GET /config.json HTTP/1.1" 200 OK
15:47:04 - openhands:INFO: github.py:14 - Initializing UserVerifier
15:47:04 - openhands:INFO: github.py:27 - GITHUB_USER_LIST_FILE not configured
15:47:04 - openhands:INFO: github.py:48 - GITHUB_USERS_SHEET_ID not configured
15:47:04 - openhands:INFO: github.py:85 - No user verification sources configured - allowing all users
INFO:     127.0.0.1:51451 - "POST /api/authenticate HTTP/1.1" 200 OK
INFO:     127.0.0.1:51451 - "GET /api/options/models HTTP/1.1" 200 OK
INFO:     127.0.0.1:51455 - "GET /api/options/agents HTTP/1.1" 200 OK
INFO:     127.0.0.1:51453 - "GET /api/options/security-analyzers HTTP/1.1" 200 OK
INFO:     127.0.0.1:51479 - "GET /assets/_oh.app-ENbAnWHL.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51475 - "GET /config.json HTTP/1.1" 200 OK
INFO:     127.0.0.1:51478 - "GET /assets/route-CCYv0vF5.js HTTP/1.1" 304 Not Modified
15:47:08 - openhands:INFO: github.py:14 - Initializing UserVerifier
15:47:08 - openhands:INFO: github.py:27 - GITHUB_USER_LIST_FILE not configured
15:47:08 - openhands:INFO: github.py:48 - GITHUB_USERS_SHEET_ID not configured
15:47:08 - openhands:INFO: github.py:85 - No user verification sources configured - allowing all users
INFO:     127.0.0.1:51479 - "POST /api/authenticate HTTP/1.1" 200 OK
INFO:     127.0.0.1:51478 - "GET /assets/useScrollToBottom-B8_iP14x.js HTTP/1.1" 200 OK
INFO:     127.0.0.1:51475 - "GET /assets/_oh.app-CzmP5rSR.js HTTP/1.1" 200 OK
INFO:     127.0.0.1:51484 - "GET /assets/declaration-DdUOQw3g.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51482 - "GET /assets/index-BXT04Q8N.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51485 - "GET /assets/clear-session-Bbh6tTiy.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51479 - "GET /assets/index-C4MRHScb.js HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:51484 - "GET /assets/index-wBZoZNP4.js HTTP/1.1" 304 Not Modified
15:47:08 - openhands:INFO: github.py:14 - Initializing UserVerifier
15:47:08 - openhands:INFO: github.py:27 - GITHUB_USER_LIST_FILE not configured
15:47:08 - openhands:INFO: github.py:48 - GITHUB_USERS_SHEET_ID not configured
15:47:08 - openhands:INFO: github.py:85 - No user verification sources configured - allowing all users
INFO:     127.0.0.1:51475 - "POST /api/authenticate HTTP/1.1" 200 OK
INFO:     127.0.0.1:51475 - "GET /assets/Terminal-DwNJitIW.js HTTP/1.1" 200 OK
INFO:     127.0.0.1:51478 - "GET /assets/Terminal-CGrrDQr5.css HTTP/1.1" 304 Not Modified
15:47:08 - openhands:INFO: github.py:14 - Initializing UserVerifier
15:47:08 - openhands:INFO: github.py:27 - GITHUB_USER_LIST_FILE not configured
15:47:08 - openhands:INFO: github.py:48 - GITHUB_USERS_SHEET_ID not configured
15:47:08 - openhands:INFO: github.py:85 - No user verification sources configured - allowing all users
INFO:     ('127.0.0.1', 51487) - "WebSocket /ws" [accepted]
15:47:08 - openhands:INFO: listen.py:335 - New session: 1eac2587-4bc8-4b12-9272-2f77de5e305e
INFO:     connection open
15:47:08 - openhands:INFO: github.py:14 - Initializing UserVerifier
15:47:08 - openhands:INFO: github.py:27 - GITHUB_USER_LIST_FILE not configured
15:47:08 - openhands:INFO: github.py:48 - GITHUB_USERS_SHEET_ID not configured
15:47:08 - openhands:INFO: github.py:85 - No user verification sources configured - allowing all users
INFO:     127.0.0.1:51478 - "POST /api/authenticate HTTP/1.1" 200 OK
INFO:     127.0.0.1:51475 - "GET /config.json HTTP/1.1" 200 OK
15:47:08 - openhands:INFO: github.py:14 - Initializing UserVerifier
15:47:08 - openhands:INFO: github.py:27 - GITHUB_USER_LIST_FILE not configured
15:47:08 - openhands:INFO: github.py:48 - GITHUB_USERS_SHEET_ID not configured
15:47:08 - openhands:INFO: github.py:85 - No user verification sources configured - allowing all users
INFO:     127.0.0.1:51475 - "POST /api/authenticate HTTP/1.1" 200 OK
15:47:08 - openhands:INFO: runtime_build.py:176 - Building image: ghcr.io/all-hands-ai/runtime:oh_v0.12.0_ih3jmpy2won44cg6_cvtclm1oaf9cheg4
15:47:08 - openhands:INFO: base.py:98 - [runtime 1eac2587-4bc8-4b12-9272-2f77de5e305e] Starting runtime with image: ghcr.io/all-hands-ai/runtime:oh_v0.12.0_ih3jmpy2won44cg6_cvtclm1oaf9cheg4
15:47:10 - openhands:INFO: base.py:98 - [runtime 1eac2587-4bc8-4b12-9272-2f77de5e305e] Container started: openhands-runtime-1eac2587-4bc8-4b12-9272-2f77de5e305e
15:47:10 - openhands:INFO: base.py:98 - [runtime 1eac2587-4bc8-4b12-9272-2f77de5e305e] Waiting for client to become ready at http://localhost:31427...
15:49:20 - openhands:ERROR: agent_session.py:196 - Runtime initialization failed: HTTPConnectionPool(host='localhost', port=31427): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10deecd40>: Failed to establish a new connection: [Errno 61] Connection refused'))
Traceback (most recent call last):
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connection.py", line 199, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connection.py", line 441, in request
    self.endheaders()
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connection.py", line 279, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connection.py", line 214, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x10deecd40>: Failed to establish a new connection: [Errno 61] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=31427): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10deecd40>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/server/session/agent_session.py", line 194, in _create_runtime
    await self.runtime.connect()
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 217, in connect
    self._wait_until_alive()
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 418, in exc_check
    raise retry_exc.reraise()
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 185, in reraise
    raise self.last_attempt.result()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 395, in _wait_until_alive
    response = send_request_with_retry(
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/runtime/utils/request.py", line 96, in send_request_with_retry
    return _send_request_with_retry()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/runtime/utils/request.py", line 92, in _send_request_with_retry
    response = session.request(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=31427): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10deecd40>: Failed to establish a new connection: [Errno 61] Connection refused'))
ERROR:asyncio:Future exception was never retrieved
future: <Future finished exception=ConnectionError(MaxRetryError("HTTPConnectionPool(host='localhost', port=31427): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10deecd40>: Failed to establish a new connection: [Errno 61] Connection refused'))"))>
Traceback (most recent call last):
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connection.py", line 199, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connection.py", line 441, in request
    self.endheaders()
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connection.py", line 279, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connection.py", line 214, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x10deecd40>: Failed to establish a new connection: [Errno 61] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=31427): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10deecd40>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/server/session/agent_session.py", line 88, in _start_thread
    asyncio.run(self._start(*args), debug=True)
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/server/session/agent_session.py", line 106, in _start
    await self._create_runtime(
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/server/session/agent_session.py", line 194, in _create_runtime
    await self.runtime.connect()
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 217, in connect
    self._wait_until_alive()
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 418, in exc_check
    raise retry_exc.reraise()
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 185, in reraise
    raise self.last_attempt.result()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/runtime/impl/eventstream/eventstream_runtime.py", line 395, in _wait_until_alive
    response = send_request_with_retry(
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/runtime/utils/request.py", line 96, in send_request_with_retry
    return _send_request_with_retry()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Documents/Projects/OpenHands/openhands/runtime/utils/request.py", line 92, in _send_request_with_retry
    response = session.request(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/Library/Caches/pypoetry/virtualenvs/openhands-ai-nue4wPdC-py3.12/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=31427): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10deecd40>: Failed to establish a new connection: [Errno 61] Connection refused'))
@malhotra5 malhotra5 added the bug Something isn't working label Nov 3, 2024
@malhotra5
Copy link
Contributor Author

Not sure why its fixed now.

Reinstalled docker and didn't seem to work. Did a system prune at some point and now its working. Marking this as closed.

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

1 participant