a2aproject / a2aproject/a2a-samples

[Bug]: HTTP Error 503 occured in examples/langgraph

Aperta
#3 4 commenti 9 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
1.8k
Fork
751
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### What happened?

A bug happened!
Firstly, I launched the server successfully:
```bash
> python .\__main__.py
INFO: Started server process [35184]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:10000 (Press CTRL+C to quit)
```

Then, I launched the client but got a 503 error:
```bash
> python .\test_client.py
...
File "D:\A2A\a2a-python\src\a2a\utils\telemetry.py", line 158, in async_wrapper
result = await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\src\a2a\client\client.py", line 289, in _send_request
raise A2AClientHTTPError(
503, f'Network communication error: {e}'
) from e
a2a.client.errors.A2AClientHTTPError: HTTP Error 503: Network communication error:
An error occurred: HTTP Error 503: Network communication error:
Ensure the agent server is running.
```

Meanwhile, the server returned an OK:
```bash
INFO: 127.0.0.1:63261 - "GET /.well-known/agent.json HTTP/1.1" 200 OK
```

But the client failed.

### Relevant log output

```shell
# test_client
(a2a-python) PS D:\A2A\a2a-python\examples\langgraph> python .\test_client.py
Connecting to agent at http://localhost:10000...
Connection successful.
--- Single Turn Request ---
Traceback (most recent call last):
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_transports\default.py", line 101, in map_httpcore_exceptions
yield
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_transports\default.py", line 394, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_async\connection_pool.py", line 256, in handle_async_request
raise exc from None
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_async\connection_pool.py", line 236, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pool_request.request
^^^^^^^^^^^^^^^^^^^^
)
^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_async\http_proxy.py", line 206, in handle_async_request
return await self._connection.handle_async_request(proxy_request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_async\connection.py", line 103, in handle_async_request
return await self._connection.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_async\http11.py", line 136, in handle_async_request
raise exc
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_async\http11.py", line 106, in handle_async_request
) = await self._receive_response_headers(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_async\http11.py", line 177, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_async\http11.py", line 217, in _receive_event
data = await self._network_stream.read(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.READ_NUM_BYTES, timeout=timeout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_backends\anyio.py", line 32, in read
with map_exceptions(exc_map):
~~~~~~~~~~~~~~^^^^^^^^^
File "C:\Users\BrickHTQ\AppData\Roaming\uv\python\cpython-3.13.3-windows-x86_64-none\Lib\contextlib.py", line 162, in __exit__
self.gen.throw(value)
~~~~~~~~~~~~~~^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadTimeout

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

Traceback (most recent call last):
File "D:\A2A\a2a-python\src\a2a\client\client.py", line 279, in _send_request
response = await self.httpx_client.post(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.url, json=rpc_request_payload, **(http_kwargs or {})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_client.py", line 1859, in post
return await self.request(
^^^^^^^^^^^^^^^^^^^
...<13 lines>...
)
^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_client.py", line 1540, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_client.py", line 1629, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
)
^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_client.py", line 1657, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_client.py", line 1694, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_client.py", line 1730, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_transports\default.py", line 393, in handle_async_request
with map_httpcore_exceptions():
~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\BrickHTQ\AppData\Roaming\uv\python\cpython-3.13.3-windows-x86_64-none\Lib\contextlib.py", line 162, in __exit__
self.gen.throw(value)
~~~~~~~~~~~~~~^^^^^^^
File "D:\A2A\a2a-python\.venv\Lib\site-packages\httpx\_transports\default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadTimeout

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

Traceback (most recent call last):
File "D:\A2A\a2a-python\examples\langgraph\test_client.py", line 158, in main
await run_single_turn_test(client)
File "D:\A2A\a2a-python\examples\langgraph\test_client.py", line 61, in run_single_turn_test
send_response: SendMessageResponse = await client.send_message(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\src\a2a\utils\telemetry.py", line 158, in async_wrapper
result = await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\src\a2a\client\client.py", line 199, in send_message
**await self._send_request(
^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
)
^
File "D:\A2A\a2a-python\src\a2a\utils\telemetry.py", line 158, in async_wrapper
result = await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A2A\a2a-python\src\a2a\client\client.py", line 289, in _send_request
raise A2AClientHTTPError(
503, f'Network communication error: {e}'
) from e
a2a.client.errors.A2AClientHTTPError: HTTP Error 503: Network communication error:
An error occurred: HTTP Error 503: Network communication error:
Ensure the agent server is running.

# server log
> python __main__.py
INFO: Started server process [31972]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:9999 (Press CTRL+C to quit)
INFO: 127.0.0.1:49633 - "GET /.well-known/agent.json HTTP/1.1" 200 OK
Retrying langchain_google_genai.chat_models._chat_with_retry.._chat_with_retry in 2.0 seconds as it raised RetryError: Timeout of 600.0s exceeded, last exception: 503 failed to connect to all addresses; last error: UNKNOWN: ipv6:%5B2404:6800:4012:9::200a%5D:443: tcp handshaker shutdown.
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.