---
title: AI_DIAGNOSE_ERROR error condition
description: Documentation for the AI\_DIAGNOSE\_ERROR error condition on Databricks
canonical_url: https://docs.databricks.com/gcp/en/error-messages/ai-diagnose-error-error-class
---

# AI\_DIAGNOSE\_ERROR error condition

[SQLSTATE: 56000](https://docs.databricks.com/gcp/en/error-messages/sqlstates.md#class-56-miscellaneous-sql-or-product-error)

Failed to diagnose the issue.

## AMBIGUOUS\_LOG\_DESTINATION

`AI_DIAGNOSE` could not determine which directory under log destination `<logDestination>` contains the Spark event logs: multiple candidate subdirectories were found and none directly contains a 'service=eventlog' directory. Please specify the exact logs destination path (the directory directly containing 'service=eventlog/').

## AVAILABILITY\_CHECK\_FAILED

`AI_DIAGNOSE` could not check model availability before invoking the LLM: `<errorMessage>`

## CLUSTER\_LAUNCH\_FAILED

Job run `<runId>` has a classic cluster configuration but the cluster never started (cluster was not assigned). This is typically caused by a permission error or quota issue during cluster creation.

## CONCURRENT\_TASKS\_NOT\_SUPPORTED

Multiple cluster\_ids found in job run `<runId>`. `AI_DIAGNOSE` does not support concurrent task runs as logs are not isolated.

## CONTEXT\_WINDOW\_EXCEEDED

Context window exceeded: estimated `<estimatedTokens>` tokens exceeds max allowed token of `<thresholdTokens>`.

## ENDPOINT\_NOT\_CONFIGURED

`AI_DIAGNOSE` endpoint is not configured. Set spark.databricks.sql.aiDiagnose.endpointName or pass model\_endpoint to the procedure.

## HTTP\_REQUEST\_FAILED

The remote HTTP request failed: `<errorMessage>`

## INTERNAL\_ERROR

An internal error occurred: `<errorMessage>`

## INVALID\_ARGUMENT

Invalid argument(s) to `AI_DIAGNOSE`: `<errorMessage>`

## INVALID\_RUN\_ID

invalid run ID `<runId>`: unable to resolve the associated cluster. Please verify that the run ID is correct and that you have permission to view it.

## LLM\_AUTH\_FAILED

LLM endpoint `<endpointName>` rejected the request with HTTP `<httpStatusCode>`: `<errorMessage>`. Verify the calling identity has access to the endpoint.

## LLM\_ENDPOINT\_NOT\_FOUND

LLM endpoint `<endpointName>` was not found (HTTP `<httpStatusCode>`): `<errorMessage>`. The model may not be available in this workspace.

## LLM\_NETWORK\_TIMEOUT

LLM endpoint `<endpointName>` request timed out: `<errorMessage>`. The endpoint may be slow or the prompt too large.

## LLM\_NETWORK\_UNREACHABLE

Cannot reach LLM endpoint `<endpointName>`: `<errorMessage>`. Check workspace network configuration.

## LLM\_NOT\_APPROVED

LLM endpoint `<endpointName>` is not approved for this workspace: `<errorMessage>`. Use a model approved for this workspace's admin.

## LLM\_RATE\_LIMITED

LLM endpoint `<endpointName>` rate-limited the request (HTTP `<httpStatusCode>`): `<errorMessage>`. Retry later.

## LLM\_SERVER\_ERROR

LLM endpoint `<endpointName>` returned a server error (HTTP `<httpStatusCode>`): `<errorMessage>`.

## LOG\_READ\_FAILED

`AI_DIAGNOSE` failed to read Spark logs. Underlying error: `<underlyingErrorMessage>`

## MALFORMED\_RESPONSE

The LLM endpoint returned a malformed response: `<errorMessage>`

## MISSING\_EVENT\_LOGS

Spark event logs are not available from log destination `<logDestination>`. `AI_DIAGNOSE` requires readable event logs to analyze Spark execution. Underlying error: `<underlyingError>`

## MISSING\_INPUT\_PROMPT

The 'prompt' parameter is required. Pass `prompt => '[description]'` to `AI_DIAGNOSE` with a description of the issue, including the exact error message or stack trace from the job run.

## NO\_AVAILABLE\_MODELS

None of the preferred models are available for this workspace. Preferred: `<preferred>`. Available: `<available>`.

## PIPELINE\_TASK\_NOT\_SUPPORTED

Job run `<runId>` contains a pipeline task (Spark Declarative Pipelines on Lakeflow/Lakeflow). `AI_DIAGNOSE` does not support diagnosing pipeline tasks as they do not use a standard Spark cluster.

## SERVERLESS\_NOT\_SUPPORTED

Serverless compute was detected for job run `<runId>`. `AI_DIAGNOSE` does not support diagnosing serverless job runs.

## SPARK\_EVENTS\_CONNECTION\_FAILED

`AI_DIAGNOSE` failed to read Spark Query Events from the AI Diagnose service. Contact Databricks support if it persists. Details: `<cause>`

## SPARK\_EVENTS\_CREDENTIALS\_UNAVAILABLE

`AI_DIAGNOSE` could not acquire credentials to read Spark Query Events from the AI Diagnose service. Contact Databricks support if it persists.

## SPARK\_EVENTS\_MISSING\_WORKSPACE

`AI_DIAGNOSE` could not read Spark Query Events because the workspace id is missing or invalid. Contact Databricks support if it persists.

## SPARK\_EVENTS\_OUT\_OF\_BOUND\_PREDICATE

`AI_DIAGNOSE` cannot scan Spark Query Events: a predicate on column `<column>` is not pinned to the diagnosed job run (allowed: `<allowed>`, got: `<got>`).

## SPARK\_EVENTS\_SERVICE\_UNAVAILABLE

`AI_DIAGNOSE` could not read Spark Query Events because the AI Diagnose service URL is unavailable. Contact Databricks support if it persists.

## SPARK\_EVENTS\_UNEXPECTED\_WORKSPACE\_SCOPE

`AI_DIAGNOSE` stopped reading Spark Query Events because the service returned an unexpected workspace scope. Contact Databricks support if it persists.

## SQL\_TASK\_NOT\_SUPPORTED

Job run `<runId>` contains a SQL task (SQL alert, SQL query, or SQL dashboard) that runs on a SQL warehouse. `AI_DIAGNOSE` requires a Spark cluster with log delivery and does not support SQL warehouse tasks.

## TOOL\_CALL\_TIMEOUT

Tool timed out after `<timeoutSeconds>` seconds.

## UNSUPPORTED\_JOB\_STATE

The job state is not supported: `<errorMessage>`

## UNSUPPORTED\_RESPONSES\_MODEL

`AI_DIAGNOSE` resolved the Anthropic model `<model>` for a Responses API tool round, which is not supported yet: prompt-cache behavior for Anthropic models on the Responses path is still being validated. Select a non-Anthropic model, or run on the Chat Completions path.
