{"record":{"id":"fe59dc3dedbf6759","repo":"BerriAI/litellm","slug":"databricks-app-oauth-token-request-failed-with-sta","errorCode":null,"errorMessage":"Databricks App OAuth token request failed with status {exc.response.status_code}","messagePattern":"Databricks App OAuth token request failed with status (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/agent_endpoints/databricks_oauth.py","lineNumber":188,"sourceCode":"        client: Final = get_async_httpx_client(llm_provider=httpxSpecialProvider.A2A)\n\n        verbose_logger.debug(\"Fetching Databricks App OAuth token from %s\", config.token_url)\n\n        basic_auth: Final = base64.b64encode(f\"{config.client_id}:{config.client_secret}\".encode()).decode()\n        try:\n            response: Final = await client.post(\n                config.token_url,\n                data={\n                    \"grant_type\": \"client_credentials\",\n                    \"scope\": config.scope,\n                },\n                headers={\n                    \"Authorization\": f\"Basic {basic_auth}\",\n                    \"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","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/agent_endpoints/databricks_oauth.py#L170-L206","documentation":"The Databricks App OAuth token endpoint returned an HTTP error status during the client-credentials grant. Converted to ValueError so the agent call fails with a clear auth-acquisition message including the status code.","triggerScenarios":"Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify Databricks OAuth credentials and endpoints; check the response body for the status code."],"exampleFix":"Test the token request manually with curl.","handlingStrategy":"try-catch","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"}