CertSafari
    Databricks Certified Data Engineer Associate· Lessons

    Domain 6 · Lesson 29/33

    Databricks cluster startup failures, library conflicts and out-of-memory errors

    Diagnose cluster startup failures, library conflicts, and out-of-memory issues

    21 min read
    2% of exam
    10 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Read a cluster termination reason in the compute event log and say whether the cause is cloud capacity, subnet IPs, quota, spot loss, network bootstrap, or Spark startup
    • Tell a cloud-side launch failure apart from IAM, API rate-limit and runtime-image failures by the error each one produces
    • Install, update and uninstall compute-scoped libraries, and predict how they interact with %pip notebook-scoped libraries
    • Recover a notebook environment broken by a library that replaced a core package such as IPython
    • Confirm an executor out-of-memory error by ruling out spot losses and autoscaling, and fix it by raising memory per core
    • Recognise driver-side memory pressure from collect() and large broadcasts, and fix it in the code

    Key concept

    Compute event log as the first diagnostic — When compute fails to launch, or loses executors while it runs, the compute's event log records the termination reason or the event that explains the loss. Read that reason before you change any configuration, because each error code points to a different layer: the cloud provider, the network, Spark, or your own workload.

    1.Cloud capacity, IP, quota and spot failures in the event log

    A cluster that never reaches the running state leaves a termination reason in its event log, and that reason is the fastest way to tell whose problem it is. Many launch failures come from the cloud account, not from Databricks or your code. Databricks asks the cloud provider for virtual machines, and the provider can refuse because it has no capacity, because your subnet has run out of addresses, or because your account has hit a quota. None of these means your cluster definition is wrong, and you fix each one differently.

    Capacity is the one that comes and goes. An InsufficientInstanceCapacity message, or text such as "We currently do not have sufficient c4.8xlarge capacity in the Availability Zone you requested", means the provider cannot supply that instance type in that zone right now. It can fail at 10:00 and succeed at 10:20 with an unchanged configuration, because the shortage is on the cloud side. The fixes are another availability zone or the auto availability zone setting, another instance type, or on-demand instead of spot instances. To stop it recurring, a workspace admin can enable flexible node types, so Databricks falls back to a compatible instance type when the preferred one is unavailable. This does not cover GPU instance types.

    Subnet IP exhaustion and quota failures persist until someone changes the environment. "Not enough free addresses in subnet" means the VPC subnet cannot hand out more IPs. Unused elastic network interfaces and IP reservations are common causes. A quota failure means the launch would push the AWS account past a limit on instances, volumes or IPs. You fix it in the AWS Service Quotas console or by cleaning up resources. Retrying does not help with either one.

    Spot losses can happen after launch too. Server.SpotInstanceTermination means the provider took the VMs back because it needed the capacity or prices changed. Spot capacity suits fault-tolerant work. For production, use on-demand instances, or a mix of on-demand and spot, together with job retries.

    Event log messages and the layer each one points to
    What the event log showsWhat it meansRecommended fix
    InsufficientInstanceCapacity / no Spot capacity availableCloud provider has no capacity for that instance type in that zoneOther zone or auto AZ, other instance type, on-demand, flexible node types
    Not enough free addresses in subnetSubnet has run out of free IPsOther AZ, expand the subnet CIDR, clean up unused network resources
    Launch would exceed the AWS account quotaAccount limit reached for instances, volumes or IPsRequest a quota increase, clean up, spread across regions
    Server.SpotInstanceTerminationProvider reclaimed spot instancesOn-demand for production, mixed spot/on-demand, job retries
    not authorized to perform: sts:AssumeRoleWorkspace IAM role or trust misconfigurationVerify IAM role trust relationships and instance profile permissions
    could not find internal Spark imageConfigured Databricks Runtime image does not existSelect a supported Databricks Runtime version

    The last two rows are what a capacity error is often confused with, and their messages look different. An IAM problem is a permission failure such as sts:AssumeRole being refused, and it fails on every attempt, not now and then. A deprecated or wrong runtime shows up as a missing Spark image. Throttling by the cloud provider's API is another separate failure, and you fix it by reducing concurrent cluster launches or staggering them. A message from the cloud provider about insufficient capacity in a zone points to none of these.

    Checkpoint 1 of 9· Match them up

    A cluster's event log shows each of these messages. Match each message to the cause and fix it points to.

    Tap a term, then the definition that fits it.

    Checkpoint 2 of 9· Exam question

    An engineering team notices that cluster launches for a specific instance type fail sporadically throughout the day, and the cluster event log surfaces an error originating from the cloud provider about insufficient capacity in the selected availability zone. The Databricks cluster configuration itself has not changed. What should the team conclude about this failure?

    Sources1

    2.Bootstrap, network and Spark startup timeouts

    Some launches get VMs and still fail, either during bootstrap or when Spark starts. Bootstrap failures are about connectivity: an instance cannot reach the Databricks control plane or artifact storage in time. The bootstrap timeout is 700 seconds. A slow artifact download, a DNS problem or a firewall rule can each use up that time, and a message such as "timed out after 703891 milliseconds" while the instance is INSTANCE_INITIALIZING is the result.

    On a new workspace, the classic symptom is a first test cluster that hangs for 20 to 30 minutes and then reports a node daemon ping timeout, saying the compute plane network is misconfigured. That points to routing or the firewall. You can test this faster than by relaunching clusters: put an EC2 instance in a workspace subnet and probe each endpoint the nodes need.

    Connectivity probes from an EC2 instance in a workspace subnet (eu-west-1 example)bash
    # Verify access to the web application
    nc -zv ireland.cloud.databricks.com 443
    
    # Verify access to the secure compute connectivity relay
    nc -zv tunnel.eu-west-1.cloud.databricks.com 443
    
    # Verify S3 global and regional access
    nc -zv s3.amazonaws.com 443
    nc -zv s3.eu-west-1.amazonaws.com 443
    
    # Verify STS global and regional access
    nc -zv sts.amazonaws.com 443
    nc -zv sts.eu-west-1.amazonaws.com 443
    
    # Verify regional Kinesis access
    nc -zv kinesis.eu-west-1.amazonaws.com 443

    STS deserves its own check. "Failed to launch spark container" with a container timeout usually means the instance could not use STS to reach the root S3 bucket. This tends to appear after exfiltration protection, VPC endpoints or a firewall is added. To fix it, let the global STS endpoint through the firewall, or set up a regional VPC endpoint for STS in a security group that can reach the workspace subnets.

    SPARK_STARTUP_FAILURE happens later. The network is fine, but the Spark driver did not report ready within its startup window, which is typically 200 seconds, and the cluster is terminated with "Spark failed to start: Timed out after 200 seconds" or DEADLINE_EXCEEDED. Anything that delays the driver uses up that window: init scripts, Spark configuration errors such as an invalid metastore URI, and slow artifact downloads. Suppose a cluster pulls a large custom JAR from an external Maven repository and the driver never reports readiness. The likely cause is that the download takes longer than the deadline allows. A network that blocks outbound traffic entirely would fail earlier, at bootstrap or the daemon ping, not at the Spark deadline. To isolate the cause, remove custom Spark configs and init scripts and try again. Small instance types can also be slow enough to miss the deadline.

    Checkpoint 3 of 9· Check yourself

    After the security team adds a firewall and VPC endpoints for exfiltration protection, new clusters fail with "failed to launch spark container ... Timed out with exception after 1 attempts". What is the most likely cause, and what is the fix?

    Checkpoint 4 of 9· Exam question

    A data engineering team creates an all-purpose cluster that references a large custom JAR hosted on an external Maven repository as a cluster library. The cluster consistently fails to launch, and the event log shows the driver never reported readiness within the initialization window before the launch was aborted. What is the most likely cause of this failure?

    Sources12

    3.Compute-scoped and notebook-scoped libraries

    A Python package on Databricks can live in two scopes, and most library conflicts come from mixing them up. A compute-scoped library is installed on the cluster and available to every notebook attached to it. A notebook-scoped library, installed with %pip, is visible only to that notebook and the jobs that run it. Other notebooks on the same cluster do not see it. It also does not persist: when the session ends or the notebook is detached, you reinstall it.

    Compute-scoped libraries take effect on a different schedule from the one most people expect. A notebook that is already attached does not see a newly installed cluster library until it starts a new session. Uninstalling works the other way round: the library stays loaded and shows Uninstall pending restart until the cluster restarts. No in-place upgrade exists, so you update a cluster library by uninstalling the old version and installing the new one. An installation that runs longer than two hours is marked failed. On a cluster created from a policy that enforces libraries, those libraries install automatically, and you cannot add others or remove any.

    How the two library scopes behave
    BehaviourCompute-scoped libraryNotebook-scoped library (%pip)
    Who sees itAll notebooks attached to the clusterOnly the current notebook and its jobs
    When it takes effectAttached notebooks need a new sessionAfter install; restartPython() may be needed
    PersistenceStays with the clusterLost when the session ends or the notebook detaches
    UninstallLibraries tab, then Uninstall pending restart until the cluster restarts%pip uninstall -y; cannot remove a runtime or cluster library, only revert to it

    That layering is how a notebook can override a version without affecting its neighbours. A notebook-scoped version sits on top of the runtime or cluster version for that one notebook. %pip uninstall -y (the -y is required) removes only your override. To change what every notebook gets, you have to change the cluster library.

    Checkpoint 5 of 9· Check yourself

    An engineer pins pandas to a newer version with %pip install in their notebook. Colleagues' notebooks on the same cluster still import the older pandas from the cluster's library. The team wants every notebook on the cluster to use the new version. What explains this, and what should they do?

    Sources34

    4.Fixing conflicts that break the notebook environment

    The worst library conflicts are not import errors in your own code. They happen when a new package changes the environment the notebook itself runs in. Databricks Runtime ships with packages the notebook depends on, IPython among them. A library whose dependencies require different versions of packages already in the runtime will replace those versions. If one of them is a core package, notebook features can stop working, and even a trivial cell such as printing a variable can fail. The cause is the install, not the code in the cell or the compute behind it.

    To recover, reset the environment, because a broken interpreter cannot repair itself. Restart the cluster or start a new session, then remove or pin the library that pulled in the conflicting dependency. Do the same when you upgrade something deliberately. %pip does not restart the Python process, so after you install a custom version of a runtime package, upgrade with --upgrade, apply a requirements.txt, or install anything that changes runtime-included dependencies, call dbutils.library.restartPython(). Doing all installs at the top of the notebook, before that restart, keeps the session consistent, because the restart clears Python state.

    Checkpoint 6 of 9· Check yourself

    Right after an analyst runs %pip install for a new package, every cell in their notebook fails, including a plain print(x). The install log shows the package pulled in a different IPython version. What is going on, and what should they do first?

    Checkpoint 7 of 9· Exam question

    A data engineer installs a workspace library that pulls in a specific version of ipython as a transitive dependency. Immediately afterward, every command run in existing notebooks attached to that cluster returns Cancelled after roughly 30 seconds, even for trivial operations like printing a variable. What is the most likely cause?

    Sources35

    5.Confirming and fixing executor out-of-memory errors

    An executor that runs out of memory does not always fail the job straight away. Spark removes the executor and retries its tasks somewhere else, so at first the job only slows down. When the same tasks keep failing, the stage fails and then the job. The typical error is an ExecutorLostFailure with "Remote RPC client disassociated", after a task has "failed 4 times". That message is generic, though, and executors can disappear for other reasons.

    Diagnose by elimination, in this order:

    1. Check the compute's event log. A resize from autoscaling is expected, not an error. Lost spot instances mean the provider reclaimed the VMs.
    2. If the event log has no explanation, open the failed job in the Spark UI, go to the failed stage, and read why each task failed. Then open the Executors tab and get the logs from the failed executors.
    3. If you have ruled out both, a memory issue is the most likely explanation.

    Lost executors and failed tasks are the signs to look for in the UI. How to read a stage's task metrics is covered in Reading Spark UI stage metrics. To confirm memory is the cause, double the memory per core and run the job again. A worker with 4 cores and 16 GB has 4 GB per core. Moving to 4 cores and 32 GB doubles that, while moving to 8 cores and 32 GB changes nothing: Spark runs one task per core, and the tasks running at the same time share the executor's memory, so the ratio matters, not the total. If the job then fails later or not at all, memory was the cause. Keep the larger worker type if the cost is acceptable.

    If more memory does not help, or costs too much, fix the workload. Common causes:

    • Too few shuffle partitions: the data is split into fewer pieces, so each task has more to hold. Set spark.sql.shuffle.partitions to auto and Spark picks the number from the query plan and input size.
    • UDFs, where each task may load its whole partition into memory: rewrite with native functions or repartition first.
    • A window function without PARTITION BY, so the window spans the whole dataset instead of a slice of it: add a PARTITION BY clause.
    • Skew, where a few key values hold most of the data, so a few tasks need far more memory than the rest.
    • Streaming state that grows without a limit: use the RocksDB state store and cap its memory, because uncapped off-heap memory use can cause OOM errors. Databricks Runtime 17.3 and above handles the cap automatically.

    Checkpoint 8 of 9· Put it in order

    A nightly job slows down and then fails with an ExecutorLostFailure saying "Remote RPC client disassociated". Put these diagnosis and fix steps in the order the lesson recommends.

    1. 1.Confirm memory is the cause by moving to a worker type with double the memory per core, for example 4 cores and 32 GB instead of 4 cores and 16 GB, and rerunning.
    2. 2.Check the compute's event log for autoscaling resizes or lost spot instances that would explain the missing executors.
    3. 3.If more memory does not help or costs too much, fix the workload, for example by setting spark.sql.shuffle.partitions to auto or replacing UDFs with native functions.
    4. 4.In the Spark UI, open the failed stage to read why each task failed, then get the failed executors' logs from the Executors tab.

    Sources6789

    6.Driver-side memory pressure from collect and broadcasts

    Executor OOM and driver memory pressure need different fixes, and they look different. An executor problem leaves a trail of lost executors and retried tasks spread across the cluster. A driver problem comes from operations that pull data into the single driver process, and adding workers or giving them more memory does not help with that.

    collect() is the standard example. It brings a distributed result back into the driver as a local object, so the driver's memory limits the result size no matter how big the cluster is. Collect only small results. Aggregate, filter or limit first, or write large results to a table. Databricks' migration guidance for SparkR and sparklyr gives the same warning: both use collect() to turn Spark DataFrames into R data frames, and collecting too much makes the driver run out of memory. Guidance for running many streams on one cluster says to avoid collect() on the driver for the same reason.

    Large broadcasts are the second cause. A broadcast join hint on a table that is not small, or a broadcast threshold set too high, can push too much data into memory. Look for broadcast hints on large tables, check the runtime broadcast threshold, and let Spark choose a different join when the table is too big to broadcast. The driver also gets more traffic when many notebooks install notebook-scoped libraries, which is something to weigh when you size the driver node for a busy shared cluster.

    Executor OOM compared with driver memory pressure
    AspectExecutor out of memoryDriver memory pressure
    Typical triggerToo few shuffle partitions, UDFs, unpartitioned windows, skewcollect() of a large result, large broadcast
    What you seeExecutors removed, tasks retried, ExecutorLostFailureFailure in the single driver process; more workers do not help
    First fixDouble memory per core, then fix the causeCollect less; remove broadcast hints on large tables; review the broadcast threshold

    Checkpoint 9 of 9· Check yourself

    A job joins a fact table to a dimension table of several hundred GB, and someone added a broadcast join hint to it. The job now fails under memory pressure, and a teammate proposes adding more workers. What should you do instead?

    Sources10863

    Sources

    (10)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “AWS does not have sufficient capacity for the requested instance type in the selected availability zone.”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “ask your workspace admin to enable flexible node types so that Databricks automatically falls back to compatible instance types”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “The AWS subnet has insufficient free IP addresses to launch the requested instances.”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “The cluster launch would exceed the AWS account's quota for the requested resource type.”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “Spot or preemptible instances were terminated by the cloud provider due to capacity needs or pricing changes.”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “Switch to on-demand instances for production workloads, implement job retry logic to handle interruptions, or use a mix of on-demand and spot instances.”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “Workspace-level misconfiguration is preventing cluster launch, including issues with IAM roles or service principal permissions.”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “The specified Spark image does not exist in Databricks artifact storage.”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “Reduce concurrent cluster launches, request an API rate limit increase from your cloud provider”
      ↩︎ Cloud capacity, IP, quota and spot failures in the event log
      “The VM bootstrap process timed out due to network connectivity issues, slow artifact downloads, or issues with the cloud provider.”
      ↩︎ Bootstrap, network and Spark startup timeouts
      “The bootstrap timeout is 700 seconds.”
      ↩︎ Bootstrap, network and Spark startup timeouts
      “The Spark driver failed to start within the configured timeout.”
      ↩︎ Bootstrap, network and Spark startup timeouts
      “Spark failed to start: Timed out after 200 seconds.”
      ↩︎ Bootstrap, network and Spark startup timeouts
      “Check your init scripts for potential errors that could delay or prevent driver startup.”
      ↩︎ Bootstrap, network and Spark startup timeouts
      “Remove custom Spark configs and init scripts to isolate the issue.”
      ↩︎ Bootstrap, network and Spark startup timeouts
      “Downloading artifacts from Databricks storage is failing or too slow due to network connectivity, firewall, or DNS issues.”
      ↩︎ Bootstrap, network and Spark startup timeouts
      “Use the error code from your cluster event log to find the relevant cause and recommended fix.”
      ↩︎ Key concept
    2. 2.
      “This message indicates that the routing or the firewall is incorrect.”
      ↩︎ Bootstrap, network and Spark startup timeouts
      “This compute log error is likely due to the instance not being able to use STS to get into the root S3 bucket.”
      ↩︎ Bootstrap, network and Spark startup timeouts
    3. 3.
      “When you install a notebook-scoped library, only the current notebook and any jobs associated with that notebook have access to that library.”
      ↩︎ Compute-scoped and notebook-scoped libraries
      “Notebook-scoped libraries do not persist across sessions.”
      ↩︎ Compute-scoped and notebook-scoped libraries
      “you can use %pip uninstall to revert the library to the default version in Databricks Runtime or the version installed on the cluster”
      ↩︎ Compute-scoped and notebook-scoped libraries
      “Upgrading, modifying, or uninstalling core Python packages (such as IPython) with %pip may cause some features to stop working as expected.”
      ↩︎ Fixing conflicts that break the notebook environment
      “If you experience such problems, reset the environment by restarting the cluster or starting a new session.”
      ↩︎ Fixing conflicts that break the notebook environment
      “%pip commands do not automatically restart the Python process.”
      ↩︎ Fixing conflicts that break the notebook environment
      “You might experience more traffic to the driver node when working with notebook-scoped library installs.”
      ↩︎ Driver-side memory pressure from collect and broadcasts
      “you can use %pip uninstall to revert the library to the default version in Databricks Runtime or the version installed on the cluster”
      ↩︎ Exam trap 1
    4. 4.
      “When you install a library on a cluster, a notebook already attached to that cluster will not immediately see the new library.”
      ↩︎ Compute-scoped and notebook-scoped libraries
      “When you uninstall a library from a cluster, the library is removed only when you restart the cluster.”
      ↩︎ Compute-scoped and notebook-scoped libraries
      “To update a cluster-installed library, uninstall the old version”
      ↩︎ Compute-scoped and notebook-scoped libraries
      “A library that has taken more than 2 hours to install will be marked as failed.”
      ↩︎ Compute-scoped and notebook-scoped libraries
      “If you create a cluster using a policy that enforces library installation, specified libraries automatically install on your cluster.”
      ↩︎ Compute-scoped and notebook-scoped libraries
      “When you uninstall a library from a cluster, the library is removed only when you restart the cluster.”
      ↩︎ Exam trap 2
    5. 5.
      “Installing a library that requires changing the versions of dependent libraries that are included in Databricks Runtime.”
      ↩︎ Fixing conflicts that break the notebook environment
    6. 6.
      “When executors run out of memory, Spark removes them and retries their tasks.”
      ↩︎ Confirming and fixing executor out-of-memory errors
      “If you suspect a memory issue, verify it by doubling the memory per core to see whether it resolves the problem.”
      ↩︎ Confirming and fixing executor out-of-memory errors
      “A large broadcast. Check for broadcast join hints on large tables, and review the runtime broadcast threshold.”
      ↩︎ Driver-side memory pressure from collect and broadcasts
      “The ratio of memory to cores matters, not the total memory.”
      ↩︎ Exam trap 4
    7. 7.
      “To find out why your executors are failing, first check the compute's Event log to see whether there's an explanation for the executor failures.”
      ↩︎ Confirming and fixing executor out-of-memory errors
      “If you've gotten this far, the likeliest explanation is a memory issue.”
      ↩︎ Confirming and fixing executor out-of-memory errors
      “Autoscaling: In this case it's expected and not an error.”
      ↩︎ Exam trap 3
    8. 8.
      “Spark uses a 1:1 mapping between task slots and available cores.”
      ↩︎ Confirming and fixing executor out-of-memory errors
      “Cap RocksDB memory usage on a per-node basis to avoid OOM errors from off-heap memory usage.”
      ↩︎ Confirming and fixing executor out-of-memory errors
      “Avoid calling collect() or other expensive DataFrame operations on the driver unless absolutely necessary”
      ↩︎ Driver-side memory pressure from collect and broadcasts
    9. 10.
      “Only collect small amounts of data back to R data frames, or the Spark driver will run out of memory.”
      ↩︎ Driver-side memory pressure from collect and broadcasts

    Spotted a mistake, or was something unclear? Tell us.