{"record":{"id":"f374eb57d449cef9","repo":"BerriAI/litellm","slug":"error-getting-versions-e","errorCode":null,"errorMessage":"Error getting versions: {e}","messagePattern":"Error getting versions: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/policy_engine/policy_registry.py","lineNumber":769,"sourceCode":"            prisma_client: The Prisma client instance\n\n        Returns:\n            PolicyVersionListResponse with policy_name and list of versions\n        \"\"\"\n        try:\n            rows: Final = await _policy_table(prisma_client).find_many(\n                where={\"policy_name\": policy_name},\n                order={\"version_number\": \"desc\"},\n            )\n            versions: Final = [_row_to_policy_db_response(r) for r in rows]\n            return PolicyVersionListResponse(\n                policy_name=policy_name,\n                versions=versions,\n                total_count=len(versions),\n            )\n        except Exception as e:\n            verbose_proxy_logger.exception(\"Error getting versions: %s\", e)\n            raise Exception(f\"Error getting versions: {e}\")\n\n    async def create_new_version(\n        self,\n        policy_name: str,\n        prisma_client: \"PrismaClient\",\n        source_policy_id: str | None = None,\n        created_by: str | None = None,\n    ) -> PolicyDBResponse:\n        \"\"\"\n        Create a new draft version of a policy. Copies all fields from the source.\n        Source is current production if source_policy_id is None.\n\n        Args:\n            policy_name: Name of the policy\n            prisma_client: The Prisma client instance\n            source_policy_id: Policy ID to clone from; if None, use current production\n            created_by: User who created the version\n","sourceCodeStart":751,"sourceCodeEnd":787,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/policy_engine/policy_registry.py#L751-L787","documentation":"Catch-all from the policy version listing routine: the find_many on the policy table filtered by policy_name (ordered by version_number) or conversion of rows failed; the original DB error text is embedded.","triggerScenarios":"Thrown at litellm/proxy/policy_engine/policy_registry.py:769 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check DB connectivity and logs; verify the policy exists, 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"}