What you will be able to do
- Locate a failed task in the Lakeflow Jobs UI and match its cause to a fix: task configuration, cluster resources, concurrency or an upstream outage
- Predict which tasks a repair run re-executes, which results it keeps, and which settings and cluster the re-run uses
- Judge whether a task is safe to repair, based on what it wrote before it failed
- Correct a bad input by overriding job parameters in the Repair job run dialog, the CLI or the API, without changing the job definition
- Choose between a repair run and Run now with different settings, including partial runs with the + task modifier
Key concept
Repair run — A repair finishes a failed multi-task run inside that same run. It re-executes only the tasks that did not succeed, plus the tasks that depend on them, and uses the job's current settings. Tasks that already succeeded keep their results and are not run again.
1.Locating the failed task and its cause
Remediation starts with one specific task, not with the job as a whole. A nightly job with six tasks can show as failed because a single task broke, and every task downstream of it is held back as a result. To find that task, open Jobs & Pipelines, click the job name, and look at the matrix view on the Runs tab. Each column is a run and each cell is a task. A task that broke is red. Tasks that never started because something upstream failed are pink, for skipped.
Red and pink cells both count as unsuccessful, and that matters later, because a repair treats them the same way. A pink task has nothing wrong with it. It was simply never allowed to start. When you hover over a red cell you see the start and end times, duration, cluster details and sometimes an error message. When you click it, the Task run details page opens with the task's output, the full error message and its metadata. That page is where you decide what kind of failure this is.
| Cause | Where to fix it |
|---|---|
| Task misconfiguration (wrong notebook path, bad setting) | Edit task, update the configuration, Save task |
| Insufficient cluster resources (for example, insufficient instances) | Edit task, then under Compute click Configure to change workers or instance types, or click Swap to another cluster; ask an admin to raise cloud quotas if needed |
| Maximum concurrent runs exceeded | Wait for other runs to finish, or raise Maximum concurrent runs via Edit concurrent runs |
| Upstream outage (external data source unavailable) | Nothing in the job to fix: wait for the source to recover, then repair |
The last row is the one people tend to overlook. When a source system was down, the job definition is fine and editing it would change nothing. The remedy is to wait for the source to come back and then repair the run. For a faster first diagnosis, Diagnose Error on a failed job asks Genie Code to explain the error.
Checkpoint 1 of 9· Match them up
A multi-task job run failed. Match each cause found on the Task run details page with what to do before you repair the run.
Tap a term, then the definition that fits it.
Each fix addresses the cause where it lies: task settings, compute, or the concurrency limit. When an upstream source was down, the job itself is fine, so you wait for the source to recover and then repair the run without editing anything.
“You can still take advantage of the repair run feature covered in the next section after the external issue is resolved.”Source: docs.databricks.com
2.What a repair run re-runs and what it keeps
A repair run completes the failed run instead of replacing it. Suppose ingest_raw succeeded and transform_silver failed. A repair runs transform_silver and anything downstream of it. The output of ingest_raw stands, so you pay no compute to reproduce it. The re-executed tasks belong to the original run and appear in that run's history. When the repair finishes, the matrix view adds a new column for the repaired run, and the tasks that were red should now be green.
The re-run uses the job's current settings, not a snapshot from when the run started. That rule is what makes repair a remediation tool and not just a retry button: you fix the notebook path or resize the cluster, save the task, then repair, and the failed task picks up your fix. The reverse also holds. An unrelated edit saved to the job since the failure will reach the repaired tasks too.
The cluster is new, but it is easy to trace. The first repair runs on my_job_cluster_v1, which uses the current settings of my_job_cluster. The original cluster and its settings stay visible against the initial run. The run's Duration in the Runs tab is measured from the start of the first attempt to the end of the latest repair. A run that failed twice and then succeeded reports the time of all three attempts, not just the last one.
Repair has two limits. First, it exists only for jobs that orchestrate two or more tasks. A failed single-task job has nothing to keep, so you trigger it again with Run now. Second, a repair chooses tasks by their *run state*, not by whether they are *disabled*. A disabled task is not repaired unless you name it in rerun_tasks in the repair request.
To repair from the UI, open the failed run from the Start time column or the matrix view and click Repair run. The Repair job run dialog lists every unsuccessful task and every dependent task that will run. You can enter parameter values there before you confirm with Repair run. For a failure caused by one wrong input, that dialog is the whole fix: put the correct value in and repair.
Checkpoint 2 of 9· Check yourself
In a three-task job, ingest_raw succeeded, transform_silver failed because its notebook path was wrong, and publish_gold, which depends on transform_silver, was skipped. You correct the path, click Save task, then click Repair run. What does the repair do?
A repair re-runs only the unsuccessful tasks, which include the skipped one, plus the tasks that depend on them. It uses the job's current settings, so the saved path fix applies. The successful ingest_raw keeps its result, and the re-run tasks stay part of the original run.
“you can repair failed or canceled multi-task jobs by running only the subset of unsuccessful tasks and any dependent tasks.”Source: docs.databricks.com
Sources1
3.Partial writes make a repair unsafe
A repair restarts each unsuccessful task from the beginning. It does not resume from where the task stopped, and it does not undo what the task already did. Lakeflow Jobs does not make tasks idempotent. If append_events wrote 40% of a batch with INSERT INTO before it failed, a repair runs the whole insert again, and that 40% is written a second time. Neither Delta nor the jobs service removes the duplicates for you. A bigger cluster doesn't help either: a repair that finishes sooner still appends the same rows twice.
Whether a repair is safe depends entirely on the task's own write logic, so check that before you click. If the write is idempotent, running it twice leaves the table the same as running it once. A MERGE keyed on a natural identifier updates the rows that already landed instead of adding them again. Overwriting the affected partition replaces the partial output wholesale. Plain append is the one write that a repair turns into duplicates.
| Write pattern | Effect of re-running after a partial write |
|---|---|
| Append (INSERT INTO) | Rows written before the failure are written again, so the table has duplicates |
| MERGE on a natural key | Rows already written are matched and updated, so no duplicates |
| Overwrite of the affected partition or table | Partial output is replaced, so no duplicates |
A task can also detect that it is being re-run. The dynamic value reference {{task.execution_count}} counts how many times the current task has run, including retries and repairs. {{job.repair_count}} counts the repair attempts on the current job run. Branching on these values is no substitute for an idempotent write, but they let a task log or guard a run that is not its first.
Checkpoint 3 of 9· Check yourself
Before you click Repair run, you review three failed tasks. Each one wrote part of its output and then crashed. load_orders uses MERGE keyed on order_id, refresh_daily overwrites the affected date partition, and append_events uses INSERT INTO. If you repair without changing any of them, what happens?
A repair runs each task again from the beginning and does not undo partial writes. A MERGE on a natural key updates rows that already exist, and an overwrite replaces the partial output. A plain append writes the same rows a second time.
“use idempotent operations (such as overwrite or merge instead of append) where duplicate data is a concern.”Source: docs.databricks.com
Checkpoint 4 of 9· Exam question
A task named append_events appends new rows into a Delta table with INSERT INTO before it fails partway through processing a large batch, leaving some rows already written. The on-call engineer plans to fix the root cause and then repair the run so only append_events re-executes. What should they do to avoid corrupting the downstream table?
Correct answer: A — Rewrite append_events to use a MERGE keyed on a natural identifier, or overwrite the affected partition, so repairing it again does not duplicate rows already written.
- A. A task that partially wrote its output before failing can duplicate data when it is repaired and simply reruns the same append logic; making the write idempotent through a merge on a stable key, or an overwrite of the affected partition, is the documented way to make repairs safe.
- B. Nothing about the repair mechanism inspects table contents for duplicates; the platform reruns the task's code as written, so any non-idempotent append logic will reproduce the same duplication problem on repair.
- C. A larger autoscaling ceiling changes how quickly the repaired attempt completes, but it does nothing to prevent the append logic itself from re-inserting rows that were already committed in the earlier attempt.
- D. Plain Parquet writers have no transaction log or automatic rollback of partial writes, so switching formats removes Delta's ACID guarantees entirely rather than solving the duplicate-row problem on repair.
4.Overriding parameters in a repair
Job parameters are key-value pairs defined on the job, with default values that a run can override, and dynamic value references fill some values in at run time. Both are covered in Job parameters and dynamic value references. In remediation, the override matters for one reason: it fixes a bad input for this run only, and the job definition stays as it was.
Values you enter in the Repair job run dialog take precedence over the values the failed run used. Say transform_silver failed because source_path pointed at last month's folder. You type the correct path into the dialog, repair, and the task runs with the corrected value. The job's saved default is not changed. Tomorrow's scheduled run still starts from the definition, so if the default itself is wrong, fix the job as well.
In the Repair job run dialog for the next repair, clear both the key and the value for source_path. That returns the parameter to its original value. If you leave the field as it is, the override from the previous repair is used again.
Overrides follow job permissions. Any user with CAN MANAGE RUN or higher on a job can override its job parameter values for a manual run. A default value therefore does not stop anyone from changing it. If an input must never change, restrict who can run the job.
Checkpoint 5 of 9· Check yourself
A date parameter was mistyped for one run, and transform_silver failed. You enter the correct date in the Repair job run dialog, and the repair succeeds. What did that override change?
Values entered in the Repair job run dialog override the failed run's inputs for that repair only. The job definition is not changed, and on a later repair, clearing the key and value returns the parameter to its original value.
“On subsequent repair runs, you can return a parameter to its original value by clearing the key and value in the Repair job run dialog.”Source: docs.databricks.com
Checkpoint 6 of 9· Exam question
A Lakeflow Job has two tasks, ingest_raw and transform_silver, where transform_silver depends on ingest_raw. In today's run, ingest_raw succeeded but transform_silver failed because it referenced an incorrect source_path parameter value. The team wants to fix the parameter and get transform_silver running again without spending compute rerunning ingest_raw. What should they do?
Correct answer: A — Open the Repair job run dialog, enter the corrected source_path value for the failed task, and confirm; the unsuccessful task re-executes.
- A. Repairing a run re-executes only the tasks that did not succeed, along with any tasks that depend on them, while leaving already-successful upstream tasks untouched; parameters entered in the dialog override the values used for the repaired attempt.
- B. Changing the job-level default and starting a fresh run re-executes every task, including the already-successful upstream task, which wastes the compute the team is trying to avoid spending.
- C. Cloning the job and discarding the failed run's history throws away the audit trail of what happened and still requires a full run of the new job definition rather than a targeted repair of the one failed task.
- D. Starting over with
Run nowre-executes the entire task graph from the beginning, which reruns the task that already completed successfully instead of only the one that failed.
5.Repairing from the CLI and the Jobs API
From the command line, databricks jobs repair-run RUN_ID repairs a run. The CLI command calls the Jobs API repair endpoint and takes the same body through --json. The rules match the UI: repaired tasks run as part of the original run, use the current job and task settings, and appear in that run's history. The run you name must not still be in progress.
| Field / CLI flag | Effect |
|---|---|
| rerun_all_failed_tasks / --rerun-all-failed-tasks | If true, every failed task in the run is repaired, without you listing them |
| rerun_tasks | An explicit list of task keys to re-run; this is also how you force a disabled task to run |
| rerun_dependent_tasks / --rerun-dependent-tasks | If true, also repairs tasks that depend on the tasks in rerun_tasks, even if they previously succeeded |
| job_parameters | Job parameter values for the repair; they override the values from the failed run |
| latest_repair_id / --latest-repair-id | The ID of the latest repair on the run |
| --performance-target | Performance mode for a serverless job: PERFORMANCE_OPTIMIZED or STANDARD |
The fields cover two ways of choosing tasks. rerun_all_failed_tasks lets the service find every task that did not succeed. rerun_tasks lets you pick tasks by key, which is useful when you want to re-run a task that succeeded on stale input. rerun_dependent_tasks reaches downstream tasks that had already succeeded, which a UI repair leaves alone. job_parameters does what the dialog does: values in the request win over the failed run's values for this repair, and the job's saved defaults are untouched, so later runs are unaffected.
Before repairing a run that has been repaired before, look at its history. databricks jobs get-run with --include-history returns the repair history, and --include-resolved-values shows the parameter values each attempt actually resolved. That is the fastest way to confirm that an override reached the task.
Checkpoint 7 of 9· Check yourself
Your team disabled the task validate_schema last week. Tonight's run failed at transform_silver. You plan to repair the run with databricks jobs repair-run, and this time validate_schema must run as well. What do you put in the repair request?
A repair picks tasks by their run state, not by whether they are disabled. A disabled task runs in a repair only when you name it explicitly in rerun_tasks. Neither rerun_all_failed_tasks nor rerun_dependent_tasks adds it.
“To force a disabled task to run during a repair, include it in rerun_tasks in the repair request.”Source: docs.databricks.com
Checkpoint 8 of 9· Exam question
A data engineer is repairing a failed job run through the Jobs API repairrun endpoint and wants to correctly reason about the request before sending it. Which statements about repairrun behavior are accurate? (Select 3.)(Select 3)
Correct answers: A, B, F — Values supplied in job_parameters for the repair request take precedence over the parameter values that were used in the original failed run.; Setting rerun_all_failed_tasks to true tells the service to re-execute every task that did not complete successfully in the prior attempt.; Submitting rerun_tasks with an explicit list of task keys lets the caller target specific tasks instead of relying on the failed-task detection.
- A. Correct: parameters passed in the repair request override the values from the original attempt for the tasks being re-executed, which is exactly how the Repair job run dialog's override behavior works when driven through the API.
- B. Correct: this boolean flag reruns every task that did not succeed in the prior attempt, which is the API equivalent of letting the service auto-detect failed and canceled tasks rather than listing them manually.
- C. Incorrect:
latest_repair_idis only required as a safeguard when repairing a run that has already been repaired at least once, so it does not need to reference anything on a run's very first repair attempt. - D. Incorrect: task parameters can be overridden on any repair attempt, and clearing an overridden field on a later repair returns that parameter to its original value rather than the setting being locked after one use.
- E. Incorrect: a repair request only changes the parameter values used for that specific repaired run; it does not mutate the job definition's stored default parameters used by future runs.
- F. Correct:
rerun_tasksaccepts specific task keys so the caller can target exactly which tasks to re-execute, as an alternative to the automatic failed-task or dependent-task detection flags.
Sources6
6.Run now with different settings
Sometimes a repair isn't possible, or isn't what you want. A failed single-task job cannot be repaired. And when you want a fresh run, with new run IDs and nothing carried over, a repair is the wrong tool. Run now with different settings covers both cases. Open it from the blue caret next to Run now. You can override defaults for existing job parameters, add new key-value parameters, change the serverless Performance optimized setting, and choose which tasks to run. Deselecting a task affects only this run. To skip a task on every run, disable it in the job settings.
Partial runs use task keys with a + modifier. my_task runs only that task. +my_task adds all of its upstream tasks, my_task+ adds all of its downstream tasks, and +my_task+ adds both. In the API, the keys go in the only field of a jobs/run-now request, and leaving only out runs every task. The + expansion skips disabled tasks, so a disabled task runs only if you select it explicitly.
POST /api/2.2/jobs/run-now
{
"job_id": 11223344,
"only": ["+task_1", "task_2+"]
}Jobs deployed with Declarative Automation Bundles accept the same selection as a comma-separated list: databricks bundle run my_job --only +task_1,task_2+. Choose repair when part of a failed run already succeeded and its results should stand. Choose Run now with different settings for a single-task job, or when you want a new run instead of completing the old one.
Continuous jobs fail differently. When consecutive failures pass a threshold, Lakeflow Jobs retries with exponential backoff, and the Job details pane shows the failure count and the time until the next retry. Restart run cancels the active run, resets the retry period and starts a new run. Use it once the cause is fixed and you don't want to wait for the backoff to expire.
Checkpoint 9 of 9· Fill the gap
This partial run should run task_1 together with every task that task_1 depends on, and task_2 together with every task that depends on task_2. Which task key fills the blank?
POST /api/2.2/jobs/run-now
{
"job_id": 11223344,
"only": [" ? ", "task_2+"]
}A + before the key adds the task's upstream tasks, so +task_1 runs task_1 and the tasks it depends on. task_1+ would add its downstream tasks instead, +task_1+ would add both, and task_1 on its own would run only that task.
Source: docs.databricks.comSources
(7)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“A task run may be unsuccessful because it failed or was skipped because a dependent task failed.”
↩︎ Locating the failed task and its cause“The Task run details page appears, displaying the task's output, error message, and associated metadata.”
↩︎ Locating the failed task and its cause“You can still take advantage of the repair run feature covered in the next section after the external issue is resolved.”
↩︎ Locating the failed task and its cause“Unsuccessful tasks are re-run with the current job and task settings.”
↩︎ What a repair run re-runs and what it keeps“The settings for my_job_cluster_v1 are the same as the current settings for my_job_cluster.”
↩︎ What a repair run re-runs and what it keeps“To force a disabled task to run during a repair, include it in rerun_tasks in the repair request.”
↩︎ What a repair run re-runs and what it keeps“The Repair job run dialog appears, listing all unsuccessful tasks and any dependent tasks that are re-run.”
↩︎ What a repair run re-runs and what it keeps“After the repair run finishes, the matrix view is updated with a new column for the repaired run.”
↩︎ What a repair run re-runs and what it keeps“A repair re-runs each unsuccessful task from the beginning.”
↩︎ Partial writes make a repair unsafe“use idempotent operations (such as overwrite or merge instead of append) where duplicate data is a concern”
↩︎ Partial writes make a repair unsafe“Parameters you enter in the Repair job run dialog override existing values.”
↩︎ Overriding parameters in a repair“To cancel the active run, reset the retry period, and start a new job run, click Restart run.”
↩︎ Run now with different settings“running only the subset of unsuccessful tasks and any dependent tasks”
↩︎ Key concept“running only the subset of unsuccessful tasks and any dependent tasks”
↩︎ Exam trap 1“Repair is supported only with jobs that orchestrate two or more tasks.”
↩︎ Exam trap 2“Lakeflow Jobs doesn't make tasks idempotent, so if a task wrote part of its output before it failed, re-running it can duplicate that data.”
↩︎ Exam trap 3“you can return a parameter to its original value by clearing the key and value”
↩︎ Exam trap 4“If one or more tasks share a job cluster, a repair run creates a new job cluster.”
↩︎ Prediction“you can repair failed or canceled multi-task jobs by running only the subset of unsuccessful tasks and any dependent tasks.”
↩︎ Checkpoint“use idempotent operations (such as overwrite or merge instead of append) where duplicate data is a concern.”
↩︎ Checkpoint“On subsequent repair runs, you can return a parameter to its original value by clearing the key and value in the Repair job run dialog.”
↩︎ Checkpoint“To force a disabled task to run during a repair, include it in rerun_tasks in the repair request.”
↩︎ Checkpoint - 2.https://docs.databricks.com/aws/en/jobs/monitorOfficial docs
“Unsuccessful runs are red, skipped runs are pink, and waiting for retry is yellow.”
↩︎ Locating the failed task and its cause - 3.
“The number of times the current task was run (including retries and repairs).”
↩︎ Partial writes make a repair unsafe - 4.
“You can also override job parameters when you repair a job run.”
↩︎ Overriding parameters in a repair - 5.https://docs.databricks.com/aws/en/jobs/parametersOfficial docs
“A default parameter value is not a security control.”
↩︎ Overriding parameters in a repair - 6.
“They use the current job and task settings, and can be viewed in the history for the original job run.”
↩︎ Repairing from the CLI and the Jobs API“If true, repair all tasks that depend on the tasks in rerun_tasks, even if they were previously successful.”
↩︎ Repairing from the CLI and the Jobs API“The run must not be in progress.”
↩︎ Repairing from the CLI and the Jobs API - 7.https://docs.databricks.com/aws/en/jobs/run-nowOfficial docs
“to override default values for existing parameters”
↩︎ Run now with different settings“If you omit only, the job runs all of its tasks.”
↩︎ Run now with different settings