{"record":{"id":"e890eb8b3f6c6c67","repo":"BerriAI/litellm","slug":"databricks-app-oauth-token-request-failed-exc","errorCode":null,"errorMessage":"Databricks App OAuth token request failed: {exc}","messagePattern":"Databricks App OAuth token request failed: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/agent_endpoints/databricks_oauth.py","lineNumber":192,"sourceCode":"        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\n        except (TypeError, ValueError):\n            expires_in = _DEFAULT_TTL_SECONDS\n\n        ttl: Final = max(expires_in - _TOKEN_EXPIRY_BUFFER_SECONDS, 0)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/agent_endpoints/databricks_oauth.py#L174-L210","documentation":"Raised in the Databricks App OAuth client-credentials flow when the token request fails with an httpx error other than HTTPStatusError — i.e. a transport-level failure: connection refused, DNS failure, TLS error, or timeout hitting config.token_url. The original exception is chained. HTTP-error responses have their own separate wrapper with the status code.","triggerScenarios":"Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network connectivity to the Databricks token endpoint; see exception detail."],"exampleFix":"Check proxy logs for the underlying exception.","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-14T05:17:10.506Z"}