{"record":{"id":"1350988c695456d0","repo":"BerriAI/litellm","slug":"databricks-app-oauth-token-response-missing-acces","errorCode":null,"errorMessage":"Databricks App OAuth token response missing 'access_token'","messagePattern":"Databricks App OAuth token response missing 'access_token'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/agent_endpoints/databricks_oauth.py","lineNumber":202,"sourceCode":"                    \"Content-Type\": \"application/x-www-form-urlencoded\",\n                },\n            )\n        except httpx.HTTPStatusError as exc:\n            raise ValueError(\n                f\"Databricks App OAuth token request failed with status {exc.response.status_code}\"\n            ) from exc\n        except httpx.HTTPError as exc:\n            raise ValueError(f\"Databricks App OAuth token request failed: {exc}\") from exc\n\n        body: Final = response.json()\n        if not isinstance(body, dict):\n            raise ValueError(\n                f\"Databricks App OAuth token response returned non-object JSON (got {type(body).__name__})\"\n            )\n\n        access_token: Final = body.get(\"access_token\")\n        if not access_token:\n            raise ValueError(\"Databricks App OAuth token response missing 'access_token'\")\n\n        raw_expires_in: Final = body.get(\"expires_in\")\n        try:\n            expires_in = int(raw_expires_in) if raw_expires_in is not None else _DEFAULT_TTL_SECONDS\n        except (TypeError, ValueError):\n            expires_in = _DEFAULT_TTL_SECONDS\n\n        ttl: Final = max(expires_in - _TOKEN_EXPIRY_BUFFER_SECONDS, 0)\n        return access_token, ttl\n\n\ndatabricks_app_oauth_token_cache: Final = DatabricksAppOAuthTokenCache()\n\n\nasync def resolve_databricks_app_auth_header(\n    litellm_params: dict[str, Any] | None,\n) -> dict[str, str] | None:\n    \"\"\"Return ``{\"Authorization\": \"Bearer <token>\"}`` for a Databricks App agent.","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/agent_endpoints/databricks_oauth.py#L184-L220","documentation":"Raised in the Databricks App OAuth flow as the final shape check: the response was 2xx, parsed as JSON, and is a dict, but it has no 'access_token' key — mandatory for a client-credentials grant. Typically means the credentials are valid HTTP-wise but the app lacks the right scopes, or the endpoint is not a real OAuth token endpoint.","triggerScenarios":"Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the token response contains access_token; check credentials and grant."],"exampleFix":"Log the token response and confirm 'access_token'.","handlingStrategy":"validation","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"}