BerriAI/litellm · error · Exception
Error getting attachments from DB: {e}
Error message
Error getting attachments from DB: {e} What it means
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.
Source
Thrown at litellm/proxy/policy_engine/attachment_registry.py:451
return [
PolicyAttachmentDBResponse(
attachment_id=a.attachment_id,
policy_name=a.policy_name,
scope=a.scope,
teams=a.teams or [],
keys=a.keys or [],
models=a.models or [],
tags=a.tags or [],
created_at=a.created_at,
updated_at=a.updated_at,
created_by=a.created_by,
updated_by=a.updated_by,
)
for a in attachments
]
except Exception as e:
verbose_proxy_logger.exception("Error getting attachments from DB: %s", e)
raise Exception(f"Error getting attachments from DB: {e}")
async def sync_attachments_from_db(
self,
prisma_client: "PrismaClient",
) -> None:
"""
Sync policy attachments from the database to in-memory registry.
Config-loaded attachments are preserved.
Args:
prisma_client: The Prisma client instance
"""
try:
attachments: Final = await self.get_all_attachments_from_db(prisma_client)
db_attachments: Final = [
PolicyAttachment(
policy=attachment_response.policy_name,View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check database connectivity and logs for the DB error; retry the list request.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/proxy/policy_engine/attachment_registry.py:451 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/ab601a047cbaff88.
Report an issue: GitHub.