{"record":{"id":"3393829dfb8150e7","repo":"BerriAI/litellm","slug":"a2a-send-message-failed-no-response-received-afte","errorCode":null,"errorMessage":"A2A send_message failed: no response received after retry attempts.","messagePattern":"A2A send_message failed: no response received after retry attempts\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"litellm/a2a_protocol/main.py","lineNumber":311,"sourceCode":"                is_streaming=False,\n            )\n            card_url = get_agent_card_url(agent_card) if agent_card else None\n        except Exception as e:\n            try:\n                map_a2a_exception(e, card_url, api_base, model=agent_name)\n            except A2ALocalhostURLError as localhost_err:\n                a2a_client = await handle_a2a_localhost_retry(\n                    error=localhost_err,\n                    agent_card=agent_card,\n                    a2a_client=a2a_client,\n                    is_streaming=False,\n                )\n                card_url = get_agent_card_url(agent_card) if agent_card else None\n                continue\n            except Exception:\n                raise\n    if a2a_response is None:\n        raise RuntimeError(\"A2A send_message failed: no response received after retry attempts.\")\n    return a2a_response\n\n\nasync def _stream_messages(\n    a2a_client: \"A2AClientType\", request: \"SendStreamingMessageRequest\"\n) -> AsyncIterator[\"SendStreamingMessageResponse\"]:\n    \"\"\"Stream message events via a2a-sdk 1.x and yield JSON-RPC chunks.\"\"\"\n    if _a2a_conversions is None:\n        raise ImportError(\n            \"The 'a2a' package is required for A2A agent invocation. Install it with: pip install a2a-sdk\"\n        )\n\n    pb_request: Final[CoreSendMessageRequest] = _a2a_conversions.to_core_send_message_request(request)\n    async for event in a2a_client.send_message(pb_request, context=_get_a2a_call_context(a2a_client)):\n        compat_chunk = _to_compat_stream_response(event, request_id=request.id)\n        yield SendStreamingMessageResponse(root=compat_chunk)\n\n","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/a2a_protocol/main.py#L293-L329","documentation":"_execute_a2a_send_with_retry loops the non-streaming send (retrying once after a localhost-card rewrite). If the loop ends without ever capturing a successful response — retries exhausted or every attempt failing in a way that produced no response object — this RuntimeError is raised. It is the aggregate 'attempted but never succeeded' error for message/send.","triggerScenarios":"api_base unreachable (agent down, wrong host/port) so every attempt errors; a localhost-card retry succeeded logistically but the resent request still failed; retry budget consumed by transient network errors.","commonSituations":"Pointing at a stopped agent container; wrong port in api_base; flaky network between litellm and the agent; agent restarting mid-request.","solutions":["Verify the agent is up and the URL is right: curl <api_base>/.well-known/agent-card.json","Check logs for a preceding 'Retrying with base URL' warning — if present, fix the agent's advertised card URL","Wrap asend_message with your own retry/backoff for transient outages","Inspect the original underlying exception in the traceback (the retry wrapper re-raises it) to classify network vs agent error"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import httpx\n\nasync def agent_ready(api_base: str) -> bool:\n    try:\n        async with httpx.AsyncClient(timeout=5) as hc:\n            return hc and (await hc.get(f'{api_base.rstrip(\"/\")}/.well-known/agent-card.json')).is_success\n    except httpx.HTTPError:\n        return False\n\nif not await agent_ready(api_base):\n    raise RuntimeError(f'A2A agent not reachable at {api_base}')","typeGuard":null,"tryCatchPattern":"last = None\nfor attempt in range(3):\n    try:\n        resp = await asend_message(a2a_client=client, request=req, api_base=api_base)\n        break\n    except RuntimeError as e:\n        if 'after retry attempts' not in str(e):\n            raise\n        last = e\n        await asyncio.sleep(2 ** attempt)\nelse:\n    raise RuntimeError(f'A2A agent unreachable after backoff: {api_base}') from last","preventionTips":["Validate api_base with a card fetch at startup and on config reload","Circuit-break agents that repeatedly fail instead of hard-failing user requests","Watch for the localhost-retry warning in logs; it usually precedes this error"],"tags":["a2a","retry","runtime-error","connection"],"backgroundTag":"retry-exhausted","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}