{"record":{"id":"e5d2ee0601a40b09","repo":"BerriAI/litellm","slug":"error-updating-version-status-e","errorCode":null,"errorMessage":"Error updating version status: {e}","messagePattern":"Error updating version status: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/policy_engine/policy_registry.py","lineNumber":960,"sourceCode":"            policy: Final = self._parse_policy(\n                policy_name,\n                {\n                    \"inherit\": updated.inherit,\n                    \"description\": updated.description,\n                    \"guardrails\": {\n                        \"add\": updated.guardrails_add or [],\n                        \"remove\": updated.guardrails_remove or [],\n                    },\n                    \"condition\": updated.condition,\n                    \"pipeline\": updated.pipeline,\n                },\n            )\n            self.add_policy(policy_name, policy)\n\n            return _row_to_policy_db_response(updated)\n        except Exception as e:\n            verbose_proxy_logger.exception(\"Error updating version status: %s\", e)\n            raise Exception(f\"Error updating version status: {e}\")\n\n    async def compare_versions(\n        self,\n        policy_id_a: str,\n        policy_id_b: str,\n        prisma_client: \"PrismaClient\",\n    ) -> PolicyVersionCompareResponse:\n        \"\"\"\n        Compare two policy versions and return field-by-field diffs.\n\n        Args:\n            policy_id_a: First policy version ID\n            policy_id_b: Second policy version ID\n            prisma_client: The Prisma client instance\n\n        Returns:\n            PolicyVersionCompareResponse with both versions and field_diffs\n        \"\"\"","sourceCodeStart":942,"sourceCodeEnd":978,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/policy_engine/policy_registry.py#L942-L978","documentation":"DB error wrapper in the policy registry: updating the version_status row (including the production demotion dance and in-memory refresh) raised; the exception is logged and re-raised with this prefix.","triggerScenarios":"Thrown at litellm/proxy/policy_engine/policy_registry.py:960 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check DB connectivity and the error detail; retry the status transition."],"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"}