{"record":{"id":"8ff76b43a5156a76","repo":"BerriAI/litellm","slug":"error-comparing-versions-e","errorCode":null,"errorMessage":"Error comparing versions: {e}","messagePattern":"Error comparing versions: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/policy_engine/policy_registry.py","lineNumber":1013,"sourceCode":"                \"guardrails_remove\",\n                \"condition\",\n                \"pipeline\",\n            )\n            field_diffs: Final[dict[str, dict[str, object]]] = {}\n            for field in compare_fields:\n                val_a = getattr(resp_a, field)\n                val_b = getattr(resp_b, field)\n                if val_a != val_b:\n                    field_diffs[field] = {\"version_a\": val_a, \"version_b\": val_b}\n\n            return PolicyVersionCompareResponse(\n                version_a=resp_a,\n                version_b=resp_b,\n                field_diffs=field_diffs,\n            )\n        except Exception as e:\n            verbose_proxy_logger.exception(\"Error comparing versions: %s\", e)\n            raise Exception(f\"Error comparing versions: {e}\")\n\n    async def delete_all_versions(\n        self,\n        policy_name: str,\n        prisma_client: \"PrismaClient\",\n    ) -> Mapping[str, str]:\n        \"\"\"\n        Delete all versions of a policy. Also removes from in-memory registry.\n\n        Args:\n            policy_name: Name of the policy\n            prisma_client: The Prisma client instance\n\n        Returns:\n            Dict with \"message\" and optional \"warning\" if a config-defined policy took over.\n        \"\"\"\n        try:\n            await _policy_table(prisma_client).delete_many(where={\"policy_name\": policy_name})","sourceCodeStart":995,"sourceCodeEnd":1031,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/policy_engine/policy_registry.py#L995-L1031","documentation":"Catch-all from the version comparison routine: after both versions were fetched, computing the field-by-field diff or building the PolicyVersionCompareResponse raised; the original exception is embedded.","triggerScenarios":"Thrown at litellm/proxy/policy_engine/policy_registry.py:1013 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the error detail; ensure both version IDs are valid and comparable, then retry."],"exampleFix":null,"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-14T00:17:10.932Z"}