BerriAI/litellm · error · ValueError

Databricks App OAuth token request failed with status {exc.r

Error message

Databricks App OAuth token request failed with status {exc.response.status_code}

What it means

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.

Source

Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:188

        client: Final = get_async_httpx_client(llm_provider=httpxSpecialProvider.A2A)

        verbose_logger.debug("Fetching Databricks App OAuth token from %s", config.token_url)

        basic_auth: Final = base64.b64encode(f"{config.client_id}:{config.client_secret}".encode()).decode()
        try:
            response: Final = await client.post(
                config.token_url,
                data={
                    "grant_type": "client_credentials",
                    "scope": config.scope,
                },
                headers={
                    "Authorization": f"Basic {basic_auth}",
                    "Content-Type": "application/x-www-form-urlencoded",
                },
            )
        except httpx.HTTPStatusError as exc:
            raise ValueError(
                f"Databricks App OAuth token request failed with status {exc.response.status_code}"
            ) from exc
        except httpx.HTTPError as exc:
            raise ValueError(f"Databricks App OAuth token request failed: {exc}") from exc

        body: Final = response.json()
        if not isinstance(body, dict):
            raise ValueError(
                f"Databricks App OAuth token response returned non-object JSON (got {type(body).__name__})"
            )

        access_token: Final = body.get("access_token")
        if not access_token:
            raise ValueError("Databricks App OAuth token response missing 'access_token'")

        raw_expires_in: Final = body.get("expires_in")
        try:
            expires_in = int(raw_expires_in) if raw_expires_in is not None else _DEFAULT_TTL_SECONDS

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify Databricks OAuth credentials and endpoints; check the response body for the status code.

Example fix

Test the token request manually with curl.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/proxy/agent_endpoints/databricks_oauth.py:188 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/fe59dc3dedbf6759. Report an issue: GitHub.