Skip to content
Latchkey

Azure Pipelines "ran longer than the maximum time" (timeout)

The job exceeded its allowed wall-clock time and Azure DevOps canceled it. The cap is timeoutInMinutes if set, otherwise the platform default, which is lower for free hosted parallelism on public-only access.

What this error means

The job fails with ##[error]The job running on agent X ran longer than the maximum time of N minutes and is marked canceled, not failed on a step.

Azure DevOps
##[error]The job running on agent Hosted Agent ran longer than the maximum
time of 60 minutes. For more information, see https://aka.ms/azpipes-job-timeout

Common causes

The job genuinely takes longer than the cap

A slow build or test suite exceeds timeoutInMinutes or the default hosted limit, so the platform stops it.

A step hangs waiting on input or a resource

A command that waits for stdin, a lock, or an unreachable service never returns, and the job runs out the clock.

How to fix it

Raise timeoutInMinutes to a realistic value

Set the job timeout above the real runtime (self-hosted and paid hosted allow higher limits).

azure-pipelines.yml
jobs:
  - job: build
    timeoutInMinutes: 120
    steps:
      - script: ./build.sh

Find and fix the hang

  1. Check which step was running when the timeout fired.
  2. Add non-interactive flags so commands never wait for input.
  3. Add per-step timeouts so a hang fails fast instead of burning the job budget.

How to prevent it

  • Set timeoutInMinutes to match real job duration with headroom.
  • Use non-interactive flags so steps never block on input.
  • Split very long jobs into parallel jobs to stay under limits.

Related guides

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