{"record":{"id":"e842875ffe8fe841","repo":"BerriAI/litellm","slug":"discovery-failed-exc","errorCode":null,"errorMessage":"Discovery failed: {exc}","messagePattern":"Discovery failed: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/a2a/endpoints.py","lineNumber":107,"sourceCode":"    ```\n    \"\"\"\n    if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:\n        raise HTTPException(\n            status_code=403,\n            detail=(f\"Only proxy admins can discover agent cards. Your role={user_api_key_dict.user_role}\"),\n        )\n\n    try:\n        card: Final = await fetch_well_known_card(\n            request.url,\n            discovery_mode=request.discovery_mode,\n            params=request.params,\n        )\n    except AgentCardDiscoveryError as exc:\n        raise HTTPException(status_code=400, detail=str(exc))\n    except Exception as exc:\n        verbose_proxy_logger.exception(\"Unexpected error during A2A discovery: %s\", exc)\n        raise HTTPException(status_code=500, detail=f\"Discovery failed: {exc}\")\n\n    return JSONResponse(\n        content={\"url\": request.url, \"agent_card\": card},\n        media_type=\"application/json\",\n    )\n","sourceCodeStart":89,"sourceCodeEnd":113,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/a2a/endpoints.py#L89-L113","documentation":"Catch-all in the admin A2A discovery endpoint: fetch_well_known_card raised an unexpected (non-AgentCardDiscoveryError) exception; it is surfaced as HTTP 400 with the exception text so admins can diagnose the target agent.","triggerScenarios":"Thrown at litellm/proxy/a2a/endpoints.py:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying exception; check agent URL reachability and config."],"exampleFix":"Check proxy logs for the discovery exception.","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}