{"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":"warning","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/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/deepeval/api.py#L59-L95","documentation":"DeepEval's sync HTTP helper only supports POST and surfaces provider failures by catching httpx.HTTPStatusError and re-raising a generic Exception containing the response body. Hitting it means DeepEval's platform rejected the log/trace POST with a 4xx/5xx, and the response text (JSON error from DeepEval) is embedded in the message.","triggerScenarios":"DeepEvalLogger._http_request POSTs to base_api_url + endpoint and DeepEval returns an error status: 401/403 for an invalid or expired CONFIDENT_API_KEY, 404 for a wrong base URL/endpoint, 4xx for a schema-mismatched body after a litellm version change.","commonSituations":"CONFIDENT_API_KEY rotated or revoked; self-hosted/misconfigured base_api_url; litellm upgrade changing the DeepEval payload shape while the API endpoint tightened validation.","solutions":["Inspect the embedded response text — 401/403 means regenerate CONFIDENT_API_KEY in DeepEval's dashboard and update the env var","Verify base_api_url points at the correct DeepEval region/instance","If the payload schema is rejected, update litellm (or pin the last compatible version) so the DeepEval body matches the API"],"exampleFix":"# before\napi = Api(api_key=\"stale-key\")\n\n# after\nexport CONFIDENT_API_KEY=<fresh key>\n# then rebuild the logger","handlingStrategy":"try-catch","validationCode":"import httpx, os\n\ndef deepeval_key_ok() -> bool:\n    r = httpx.post(\n        \"https://app.confident-ai.com/api/v1/sdk/events\",\n        headers={\"Authorization\": f\"Bearer {os.environ['CONFIDENT_API_KEY']}\"},\n        json={},\n    )\n    return r.status_code not in (401, 403)","typeGuard":null,"tryCatchPattern":"try:\n    api.send_request(HttpMethods.POST, Endpoints.EVENTS, body=payload)\nexcept Exception as e:\n    if \"DeepEval logging error\" in str(e):\n        log_and_continue(\"DeepEval rejected payload — check key/url; not fatal for LLM traffic\")\n    else:\n        raise","preventionTips":["Wrap DeepEval logging calls so telemetry failures never break the main LLM path","Keep CONFIDENT_API_KEY fresh and verify it with a direct request after rotation"],"tags":["deepeval","logging","http","authentication"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}