Skip to content
Latchkey

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

  1. Check the run summary for who or what canceled it.
  2. If a newer run superseded it, that is expected; the latest run is what matters.
  3. 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 batch and concurrency so supersede behavior matches intent.
  • Treat cancellation as distinct from a failing step.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →