{"record":{"id":"bc9edd7df872545e","repo":"BerriAI/litellm","slug":"invalid-anonymizer-response-received-none","errorCode":null,"errorMessage":"Invalid anonymizer response: received None","messagePattern":"Invalid anonymizer response: received None","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/presidio.py","lineNumber":517,"sourceCode":"    async def anonymize_text(\n        self,\n        text: str,\n        analyze_results: list[PresidioAnalyzeResponseItem] | _PresidioAnonymizeResponse,\n        output_parse_pii: bool,\n        masked_entity_count: dict[str, int],\n        request_data: dict | None = None,\n    ) -> str:\n        \"\"\"\n        Send analysis results to the Presidio anonymizer endpoint to get redacted text\n        \"\"\"\n        try:\n            # If there are no detections after filtering, return the original text\n            if isinstance(analyze_results, list) and len(analyze_results) == 0:\n                return text\n\n            redacted_text: Final = await self._post_presidio_anonymize(text, analyze_results)\n            if redacted_text is None:\n                raise Exception(\"Invalid anonymizer response: received None\")\n\n            verbose_proxy_logger.debug(\"redacted_text: %s\", redacted_text)\n\n            if not output_parse_pii:\n                return self._finalize_presidio_anonymize_simple(redacted_text, masked_entity_count)\n\n            return self._finalize_presidio_anonymize_numbered_tokens(\n                text, analyze_results, request_data, masked_entity_count\n            )\n        except Exception as e:\n            # Sanitize exception to avoid leaking the original text (which may\n            # contain API keys or other secrets) in error responses.\n            error_str: Final = str(e)\n            if \"Invalid anonymizer response\" in error_str or \"Presidio anonymizer returned\" in error_str:\n                raise\n            raise Exception(f\"Presidio PII anonymization failed: {type(e).__name__}\") from e\n\n    def filter_analyze_results_by_score(","sourceCodeStart":499,"sourceCodeEnd":535,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/presidio.py#L499-L535","documentation":"Error \"Invalid anonymizer response: received None\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/presidio.py:517 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the Presidio anonymizer service is running and reachable at the configured endpoint.","Verify the anonymizer request payload (anonymizers config) matches the Presidio API schema."],"exampleFix":null,"handlingStrategy":null,"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"}