{"record":{"id":"f0469d07329f450b","repo":"BerriAI/litellm","slug":"deepeval-logging-error-e-response-text","errorCode":null,"errorMessage":"DeepEval logging error: {e.response.text}","messagePattern":"DeepEval logging error: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/deepeval/api.py","lineNumber":77,"sourceCode":"            \"CONFIDENT_API_KEY\": api_key,\n        }\n        # using the global non-eu variable for base url\n        self.base_api_url = base_url or API_BASE_URL\n        self.sync_http_handler = HTTPHandler()\n        self.async_http_handler = get_async_httpx_client(llm_provider=httpxSpecialProvider.LoggingCallback)\n\n    def _http_request(self, method: str, url: str, headers=None, json=None, params=None):\n        if method != \"POST\":\n            raise Exception(\"Only POST requests are supported\")\n        try:\n            self.sync_http_handler.post(\n                url=url,\n                headers=headers,\n                json=json,\n                params=params,\n            )\n        except httpx.HTTPStatusError as e:\n            raise Exception(f\"DeepEval logging error: {e.response.text}\")\n        except Exception as e:\n            raise e\n\n    def send_request(self, method: HttpMethods, endpoint: Endpoints, body=None, params=None):\n        url: Final = f\"{self.base_api_url}{endpoint.value}\"\n        res: Final = self._http_request(\n            method=method.value,\n            url=url,\n            headers=self._headers,\n            json=body,\n            params=params,\n        )\n\n        if res.status_code == 200:\n            try:\n                return res.json()\n            except ValueError:\n                return res.text","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/deepeval/api.py#L59-L95","documentation":"In the vendored DeepEval client, HTTPHandler.post raises httpx.HTTPStatusError via raise_for_status() on any 4xx/5xx from api.confident-ai.com; _http_request converts it to a generic Exception carrying the response body text. Grounded caveat: this vendored copy never returns the httpx response (no `return` statement), so even successful requests later crash send_request with AttributeError on None — a separate latent bug to patch.","triggerScenarios":"Invalid or expired CONFIDENT_API_KEY (401/403); EU account hitting the default non-EU API_BASE_URL (403/404); tracing payload rejected as malformed (400); Confident AI outage (5xx).","commonSituations":"Key rotated or revoked on the Confident AI dashboard; LITELLM_ENVIRONMENT or endpoint body shaped wrong for the account plan; proxy servers adding unexpected status codes.","solutions":["Read the embedded response text — it names the real HTTP status and server reason","Validate CONFIDENT_API_KEY on the Confident AI dashboard and re-export it","If your account is EU, construct Api(api_key=..., base_url=API_BASE_URL_EU)","If you see AttributeError on None instead, patch the vendored client to `return` the response from _http_request"],"exampleFix":"# before (vendored api.py)\nself.sync_http_handler.post(url=url, headers=headers, json=json, params=params)  # result dropped\n\n# after\nreturn self.sync_http_handler.post(url=url, headers=headers, json=json, params=params)","handlingStrategy":"try-catch","validationCode":"import httpx\nfrom litellm.integrations.deepeval.api import API_BASE_URL, API_BASE_URL_EU\nimport os\n\ndef deepeval_api_reachable() -> bool:\n    base = API_BASE_URL_EU if os.getenv(\"DEEPEVAL_REGION\", \"us\") == \"eu\" else API_BASE_URL\n    try:\n        r = httpx.post(f\"{base}/v1/tracing\", headers={\"CONFIDENT_API_KEY\": os.getenv(\"CONFIDENT_API_KEY\", \"\")}, json={})\n        return r.status_code < 500  # auth errors still prove reachability\n    except httpx.HTTPError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    api.send_request(HttpMethods.POST, Endpoints.TRACING_ENDPOINT, body=body)\nexcept Exception as e:  # generic Exception by design; match on text\n    if \"logging error\" in str(e):\n        litellm.verbose_logger.exception(\"deepeval telemetry failed (non-2xx): %s\", e)\n    else:\n        raise","preventionTips":["Wrap all DeepEval logging calls so telemetry failures never fail the completion","Validate CONFIDENT_API_KEY at deploy time with a cheap request","Pick EU vs US base_url explicitly at Api() construction"],"tags":["deepeval","http-status","api-client","authentication","observability"],"backgroundTag":"http-error-response","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}