Home / Databricks on Azure

Databricks on AzureCheat sheetIntermediate

Azure Databricks cluster termination codes cheat sheet: read the reason, find the cause, apply the fix

Decode Azure Databricks cluster termination codes such as SUBNET_EXHAUSTED_FAILURE, NETWORK_CHECK_*, INIT_SCRIPT_FAILURE and COMMUNICATION_LOST, pull them with the CLI or SDK, and map each to its fix.

Deepak Bhardwaj9 min read

Applies toAzure Databricks classic compute (all-purpose and job clusters), Databricks CLI 0.205+, Databricks SDK for Python

A cluster stopped or never started, and the UI shows a one-line reason. That line has a code (what happened) and a type (whose problem it is). This page shows how to pull both quickly and what to do for the codes you'll see most often on Azure.

Read the termination reason

In the UI

Open Compute > the cluster > Event log. The terminating event reads like this:

Cluster '0123-456789-abcd123' was terminated. Reason: SUBNET_EXHAUSTED_FAILURE (CLOUD_FAILURE). Parameters: ...

Expand the event to see the parameters. On Azure, azure_error_message and azure_error_code often name the actual Azure failure. Read those before you open a ticket.

With the Databricks CLI

# Current state, last state message and termination reason
databricks clusters get 0123-456789-abcd123 -o json \
  | jq '{state, state_message, termination_reason}'

# Recent terminate events for the cluster
databricks clusters events --json '{
  "cluster_id": "0123-456789-abcd123",
  "event_types": ["TERMINATING"],
  "limit": 10
}' -o json

termination_reason has three fields: code, type and parameters.

Every terminated cluster in the workspace (Python SDK)

Use this during an incident to see whether one cluster failed or all of them did:

from collections import Counter
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.compute import State

w = WorkspaceClient()
reasons = Counter()
for c in w.clusters.list():
    if c.state == State.TERMINATED and c.termination_reason:
        tr = c.termination_reason
        reasons[(tr.code.value if tr.code else None,
                 tr.type.value if tr.type else None)] += 1
        print(c.cluster_id, c.cluster_name, tr.code, tr.type,
              (tr.parameters or {}).get("azure_error_message", ""))

print(reasons.most_common())

If dozens of clusters show the same code, you're dealing with a shared cause such as the network, quota, a policy or a global init script. A single cluster usually points to its own configuration.

Read the type first

Type Meaning First move
SUCCESS Normal stop (idle, user, job done) Nothing broken. Check auto-termination if it surprised you
CLIENT_ERROR The configuration is wrong (script, image, setting) Fix the cluster, policy or script. Retrying won't help
CLOUD_FAILURE Azure-side failure: network, quota, capacity, VM Check Azure: subnet, NSG/UDR, quota, region capacity
SERVICE_FAULT Databricks-side failure Retry. If it repeats, open a support case with the cluster ID and timestamp

Not every code maps to a single type. Some, like CLOUD_PROVIDER_LAUNCH_FAILURE, can be triggered by your network setup even though the type is CLOUD_FAILURE. Trust the parameters over the type.

Normal stops

Code Cause Action
INACTIVITY Auto-termination timer expired Expected. Raise the timeout only for interactive work
USER_REQUEST Someone (or automation) terminated it Look up who in the audit log (clusters service, delete action)
JOB_FINISHED Job compute finished its run Expected

Capacity and quota

Code Cause Fix
AZURE_QUOTA_EXCEEDED_EXCEPTION The vCPU quota for that VM family in the region is used up Check usage (below). Request a quota increase, stop idle clusters or move to a family with headroom
CLOUD_PROVIDER_RESOURCE_STOCKOUT Azure has no capacity for that VM size in the region or zone Retry later or switch VM size. Enable flexible node types where available
CLOUD_PROVIDER_LAUNCH_FAILURE VM launch failed or timed out Read azure_error_message. Common causes are a full subnet, quota or throttling
SUBNET_EXHAUSTED_FAILURE VNet-injected subnets are out of IPs. Each node needs one IP in both the host and container subnets Reduce max workers, use bigger VMs with fewer nodes, or move to larger subnets
INSTANCE_POOL_MAX_CAPACITY_REACHED The pool is at its max capacity Raise the pool max or spread clusters across pools
SPOT_INSTANCE_TERMINATION Azure evicted spot VMs Run the driver on demand, use fallback to on-demand and add job retries

Check quota from the Azure CLI:

az vm list-usage --location westeurope -o table \
  | grep -i -E "Family|Total Regional"

For subnet sizing, see VNet-injected subnets out of IP addresses. For quota and stockouts, see cloud provider launch errors.

Network checks at startup

Before bootstrap, a node checks its network. When a check fails, you get one of the NETWORK_CHECK_* codes. A _DUE_TO_MISCONFIG suffix means Databricks has seen this failure repeatedly and treats it as a configuration problem, not a transient one.

Code What could not be reached Check
NETWORK_CHECK_DNS_SERVER_FAILURE The configured DNS server Custom DNS IPs on the VNet and port 53. Use 168.63.129.16 as a test
NETWORK_CHECK_CONTROL_PLANE_FAILURE Databricks control plane NSG outbound rules, firewall rules, UDR next hop
NETWORK_CHECK_METADATA_ENDPOINT_FAILURE Instance metadata 169.254.169.254 A UDR or firewall intercepting link-local traffic
NETWORK_CHECK_STORAGE_FAILURE Artifact storage Storage FQDNs allowed through the firewall, DNS resolution
NETWORK_CHECK_MULTIPLE_COMPONENTS_FAILURE Several of the above Look for one shared change: DNS, firewall or route table
NETWORK_CONFIGURATION_FAILURE General VM networking SSL errors point to TLS inspection. A 401 points to Private Link or IP access lists
NPIP_TUNNEL_SETUP_FAILURE Secure cluster connectivity relay Outbound 443 to the SCC relay, DNS for the relay host
CONTROL_PLANE_REQUEST_FAILURE Bootstrap instructions from the control plane DNS, NSG, firewall, UDR
INSTANCE_UNREACHABLE The control plane cannot reach the node NSG rules and route tables on the subnets
HIVEMETASTORE_CONNECTIVITY_FAILURE Legacy Hive metastore (port 3306) Allow outbound 3306 to the AzureDatabricks service tag

To check the effective routes and NSG rules on a running cluster VM's NIC from the managed resource group:

az network nic show-effective-route-table -g <managed-rg> -n <nic-name> -o table
az network nic list-effective-nsg -g <managed-rg> -n <nic-name>

From a notebook on a cluster that does start, test name resolution and ports:

%sh
nslookup <your-region-relay-host>
nc -vz <your-region-relay-host> 443

The relay host name differs by region. Check the Azure Databricks IP addresses and domains page for yours. For relay and Private Link problems, see SCC relay and Private Link issues.

Warning

A firewall, UDR or DNS change usually hits every cluster in the workspace at the next start. If many clusters show NETWORK_CHECK_* codes within minutes of each other, roll back the network change first and investigate after.

Configuration errors

Code Cause Fix
INIT_SCRIPT_FAILURE A cluster-scoped init script failed on a node Read init_scripts/*.stderr.log under the cluster log path. The script path is in the message
GLOBAL_INIT_SCRIPT_FAILURE A workspace global init script failed An admin fixes or disables it under Settings > Compute > Global init scripts
INVALID_ARGUMENT Bad setting, or a missing or unreadable secret in Spark config or env vars Check {{secrets/scope/key}} references, scope ACLs and Key Vault network access
SPARK_STARTUP_FAILURE The driver did not start in time Remove custom Spark config and init scripts to isolate the cause. Try a larger driver
DOCKER_IMAGE_PULL_FAILURE The custom container image could not be pulled Image name/tag, registry credentials, network path to ACR
EOS_SPARK_IMAGE The runtime is end of support Move to a supported LTS runtime
AZURE_OPERATION_NOT_ALLOWED_EXCEPTION An Azure policy, lock or permission blocked the operation Check deny assignments, locks and policies on the managed resource group

Init script logs, if cluster log delivery goes to a volume:

databricks fs ls dbfs:/Volumes/ops/logs/cluster_logs/0123-456789-abcd123/init_scripts/

See init script failures and managed resource group errors.

Running clusters that die

Code Cause Fix
COMMUNICATION_LOST The control plane lost contact with a node: health check failed, node overloaded or VM gone Check driver logs for OOM or long GC pauses and the relay path. Look for VM events in Azure
DRIVER_UNREACHABLE / DRIVER_UNRESPONSIVE The driver stopped responding, usually from memory pressure or collect() of large data Use a bigger driver, stop collecting to the driver, check GC in the driver log
CLUSTER_OPERATION_TIMEOUT An internal operation exceeded its deadline Retry. Open a support case if it repeats
REQUEST_THROTTLED / RATE_LIMITED Too many cluster launches or cloud API calls at once Stagger job start times, use pools, add backoff to automation

Code names vary by release and new codes get added. If you see a code that isn't listed here, search for it on the Microsoft Learn "Classic compute termination error codes" page.

Prevent it next time

  • Send cluster logs to a Unity Catalog volume in every compute policy, so init script and driver logs exist after the cluster is gone.
  • Alert on job failures and include the termination code in the runbook link (see job alerts that reach on-call).
  • Track vCPU quota and subnet free IPs before adding new jobs, not after launches fail.
  • Run network changes (firewall, UDR, DNS) through a test workspace that starts a cluster as a smoke test.
  • Keep the SDK script above in your on-call toolkit. Counting codes across the workspace takes about a minute and separates "one bad cluster" from "the platform is down".