{"record":{"id":"31c21d971f721922","repo":"BerriAI/litellm","slug":"databricks-oauth-param-must-be-a-mapping-of-oa","errorCode":null,"errorMessage":"'{DATABRICKS_OAUTH_PARAM}' must be a mapping of OAuth settings, got {type(raw).__name__}","messagePattern":"'(.+?)' must be a mapping of OAuth settings, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/agent_endpoints/databricks_oauth.py","lineNumber":93,"sourceCode":"\n\ndef parse_databricks_oauth_config(\n    litellm_params: dict[str, Any] | None,\n) -> DatabricksAppOAuthConfig | None:\n    \"\"\"Build a Databricks App OAuth config from an agent's ``litellm_params``.\n\n    Returns ``None`` when the agent has no ``databricks_oauth`` block. Raises\n    ``ValueError`` when the block is present but incomplete, so misconfiguration\n    surfaces loudly instead of silently sending an unauthenticated request.\n    \"\"\"\n    if not litellm_params:\n        return None\n\n    raw: Final = litellm_params.get(DATABRICKS_OAUTH_PARAM)\n    if raw is None:\n        return None\n    if not isinstance(raw, dict):\n        raise ValueError(f\"'{DATABRICKS_OAUTH_PARAM}' must be a mapping of OAuth settings, got {type(raw).__name__}\")\n\n    client_id: Final = _resolve_secret(raw.get(\"client_id\"))\n    client_secret: Final = _resolve_secret(raw.get(\"client_secret\"))\n    workspace_url: Final = _resolve_secret(raw.get(\"workspace_url\"))\n\n    missing: Final = [\n        name\n        for name, value in (\n            (\"client_id\", client_id),\n            (\"client_secret\", client_secret),\n            (\"workspace_url\", workspace_url),\n        )\n        if not value\n    ]\n    if missing:\n        raise ValueError(f\"Databricks App OAuth config is missing required field(s): {', '.join(missing)}\")\n\n    scope: Final = _resolve_secret(raw.get(\"scope\")) or _DEFAULT_SCOPE","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/agent_endpoints/databricks_oauth.py#L75-L111","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the Databricks OAuth param as a mapping/object of settings."],"exampleFix":"databricks_oauth={'client_id':..., 'client_secret':...}","handlingStrategy":"type-guard","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"}