{"record":{"id":"ab601a047cbaff88","repo":"BerriAI/litellm","slug":"error-getting-attachments-from-db-e","errorCode":null,"errorMessage":"Error getting attachments from DB: {e}","messagePattern":"Error getting attachments from DB: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":500,"severity":"error","filePath":"litellm/proxy/policy_engine/attachment_registry.py","lineNumber":451,"sourceCode":"            return [\n                PolicyAttachmentDBResponse(\n                    attachment_id=a.attachment_id,\n                    policy_name=a.policy_name,\n                    scope=a.scope,\n                    teams=a.teams or [],\n                    keys=a.keys or [],\n                    models=a.models or [],\n                    tags=a.tags or [],\n                    created_at=a.created_at,\n                    updated_at=a.updated_at,\n                    created_by=a.created_by,\n                    updated_by=a.updated_by,\n                )\n                for a in attachments\n            ]\n        except Exception as e:\n            verbose_proxy_logger.exception(\"Error getting attachments from DB: %s\", e)\n            raise Exception(f\"Error getting attachments from DB: {e}\")\n\n    async def sync_attachments_from_db(\n        self,\n        prisma_client: \"PrismaClient\",\n    ) -> None:\n        \"\"\"\n        Sync policy attachments from the database to in-memory registry.\n        Config-loaded attachments are preserved.\n\n        Args:\n            prisma_client: The Prisma client instance\n        \"\"\"\n        try:\n            attachments: Final = await self.get_all_attachments_from_db(prisma_client)\n\n            db_attachments: Final = [\n                PolicyAttachment(\n                    policy=attachment_response.policy_name,","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/policy_engine/attachment_registry.py#L433-L469","documentation":"Catch-all from the policy attachment list routine: querying or materializing PolicyAttachment rows from the database failed (Prisma/deserialization error); the underlying exception text is included. Indicates a DB-level problem, not a caller error.","triggerScenarios":"Thrown at litellm/proxy/policy_engine/attachment_registry.py:451 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check database connectivity and logs for the DB error; retry the list request."],"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-14T05:17:10.506Z"}