Azure Pipelines "##[error]The operation was canceled"
A cancel signal stopped the job mid-step. This is not a step failure: a timeout, a manual cancel, or a newer run with cancelTimeoutInMinutes or branch concurrency superseded this one.
What this error means
A step ends abruptly with ##[error]The operation was canceled. and the run is marked canceled, often while a long command was still running.
Azure DevOps
##[error]The operation was canceled.
##[warning]The job was canceled because a newer run was queued for the same branch.Common causes
A newer run superseded this one
Batched or auto-cancel triggers stop an in-progress run when a newer commit queues for the same branch.
A timeout or manual cancel fired
The job timeout elapsed, or someone canceled the run, sending the cancel signal to the active step.
How to fix it
Decide whether the cancel was intended
- Check the run summary for who or what canceled it.
- If a newer run superseded it, that is expected; the latest run is what matters.
- If it was a timeout, address the duration; if manual, re-run.
Control auto-cancel behavior
Tune trigger batching so in-progress runs are not canceled when you want every commit built.
azure-pipelines.yml
trigger:
batch: false
branches:
include: [main]How to prevent it
- Read the run summary to see the cancel source before debugging steps.
- Tune
batchand concurrency so supersede behavior matches intent. - Treat cancellation as distinct from a failing step.
Related guides
Azure Pipelines "ran longer than the maximum time" (timeout)Fix Azure Pipelines "The job running on agent ... ran longer than the maximum time" - the job hit its timeout…
Azure Pipelines "agent lost communication with the server"Fix Azure Pipelines "The agent ... lost communication with the server" - a self-hosted agent dropped its conn…
Azure Pipelines "The process '...' failed with exit code"Fix Azure Pipelines "##[error]The process '/usr/bin/...' failed with exit code N" - a wrapped tool (dotnet, g…