BerriAI/litellm · error · Exception
Error resolving guardrails from DB: {e}
Error message
Error resolving guardrails from DB: {e} What it means
Catch-all raised while resolving a policy's inherited guardrails from DB-backed policies: building temporary Policy objects from DB rows or running PolicyResolver.resolve_policy_guardrails over them failed; the original exception is embedded in the message.
Source
Thrown at litellm/proxy/policy_engine/policy_registry.py:739
"remove": policy_response.guardrails_remove,
},
"condition": policy_response.condition,
"pipeline": policy_response.pipeline,
},
)
temp_policies[policy_response.policy_name] = policy
# Use the existing PolicyResolver to resolve guardrails
resolved_policy: Final = PolicyResolver.resolve_policy_guardrails(
policy_name=policy_name,
policies=temp_policies,
context=None, # No context needed for simple resolution
)
return sorted(resolved_policy.guardrails)
except Exception as e:
verbose_proxy_logger.exception("Error resolving guardrails from DB: %s", e)
raise Exception(f"Error resolving guardrails from DB: {e}")
async def get_versions_by_policy_name(
self,
policy_name: str,
prisma_client: "PrismaClient",
) -> PolicyVersionListResponse:
"""
Get all versions of a policy by name, ordered by version_number descending.
Args:
policy_name: Name of the policy
prisma_client: The Prisma client instance
Returns:
PolicyVersionListResponse with policy_name and list of versions
"""
try:
rows: Final = await _policy_table(prisma_client).find_many(View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check DB connectivity; verify referenced guardrails exist, then retry policy resolution.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/proxy/policy_engine/policy_registry.py:739 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/3fafa195e632af35.
Report an issue: GitHub.