BerriAI/litellm · error · ValueError
'{DATABRICKS_OAUTH_PARAM}' must be a mapping of OAuth settin
Error message
'{DATABRICKS_OAUTH_PARAM}' must be a mapping of OAuth settings, got {type(raw).__name__} What it means
parse_databricks_oauth_config found a databricks_oauth block in litellm_params but it is not a mapping; raising here ensures misconfiguration surfaces loudly rather than sending an unauthenticated request to the Databricks app.
Source
Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:93
def parse_databricks_oauth_config(
litellm_params: dict[str, Any] | None,
) -> DatabricksAppOAuthConfig | None:
"""Build a Databricks App OAuth config from an agent's ``litellm_params``.
Returns ``None`` when the agent has no ``databricks_oauth`` block. Raises
``ValueError`` when the block is present but incomplete, so misconfiguration
surfaces loudly instead of silently sending an unauthenticated request.
"""
if not litellm_params:
return None
raw: Final = litellm_params.get(DATABRICKS_OAUTH_PARAM)
if raw is None:
return None
if not isinstance(raw, dict):
raise ValueError(f"'{DATABRICKS_OAUTH_PARAM}' must be a mapping of OAuth settings, got {type(raw).__name__}")
client_id: Final = _resolve_secret(raw.get("client_id"))
client_secret: Final = _resolve_secret(raw.get("client_secret"))
workspace_url: Final = _resolve_secret(raw.get("workspace_url"))
missing: Final = [
name
for name, value in (
("client_id", client_id),
("client_secret", client_secret),
("workspace_url", workspace_url),
)
if not value
]
if missing:
raise ValueError(f"Databricks App OAuth config is missing required field(s): {', '.join(missing)}")
scope: Final = _resolve_secret(raw.get("scope")) or _DEFAULT_SCOPEView on GitHub (pinned to 77b7c6c40c)
Solutions
- Pass the Databricks OAuth param as a mapping/object of settings.
Example fix
databricks_oauth={'client_id':..., 'client_secret':...} Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:93 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/31c21d971f721922.
Report an issue: GitHub.