{"record":{"id":"3105ee4a30fab1f1","repo":"BerriAI/litellm","slug":"databricks-app-oauth-token-response-returned-non-o","errorCode":null,"errorMessage":"Databricks App OAuth token response returned non-object JSON (got {type(body).__name__})","messagePattern":"Databricks App OAuth token response returned non-object JSON \\(got (.+?)\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/agent_endpoints/databricks_oauth.py","lineNumber":196,"sourceCode":"                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)\n        return access_token, ttl\n\n\ndatabricks_app_oauth_token_cache: Final = DatabricksAppOAuthTokenCache()","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/agent_endpoints/databricks_oauth.py#L178-L214","documentation":"Raised in the Databricks App OAuth flow when the token endpoint returned 2xx and response.json() succeeded, but the decoded body is not a JSON object (type name is embedded). The client expects a dict to extract access_token; a non-object body means the token_url likely points at the wrong endpoint or a gateway returned unexpected JSON.","triggerScenarios":"Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the token endpoint response; it must return a JSON object."],"exampleFix":"Log the raw token response body.","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-14T11:17:12.474Z"}