Skip to content
Latchkey

GitHub Actions "exceeded the maximum execution time" - Job Timeout

The runner stopped the job because it ran longer than its allowed time. The job did not crash - it was cut off at the time limit, which means the fix is either a faster job or a longer (but bounded) timeout.

What this error means

A job is cancelled with The job running on runner ... has exceeded the maximum execution time of N minutes. It was still doing work when the limit hit. Sometimes a transient slowdown pushed an otherwise-fast job over; sometimes the timeout is genuinely too low.

CI log
The job running on runner GitHub Actions 12 has exceeded the maximum
execution time of 360 minutes.
##[error] The operation was canceled.

Common causes

A transient slowdown pushed the job over the limit

Slow downloads, a congested runner, or a flaky dependency made a normally-fast job exceed its timeout. On a retry it finishes in time - the mechanical/transient case.

The timeout is set too low for the work

If the job legitimately needs more time than timeout-minutes allows, it will hit the limit every run. This is a real config issue, not a blip - raise the bound or speed up the job.

How to fix it

Set an explicit, realistic timeout

Bound the job so a hang fails fast, but leave enough headroom for the real work.

.github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 30   # was hitting the default 360 only on hangs

Make the job finish faster

  1. Cache dependencies so installs do not dominate the runtime.
  2. Parallelize or shard long test/build steps.
  3. Add per-step timeout-minutes so one slow step fails fast instead of consuming the whole job budget.

How to prevent it

  • Set explicit job and step timeouts rather than relying on the default.
  • Cache and parallelize to keep runtimes well under the limit.
  • Track job duration trends so a creeping slowdown is caught early.

Frequently asked questions

Should I just raise the timeout?
Raise it only if the job legitimately needs the time. If a hang or a transient slowdown caused it, a retry or a fix to the slow step is better than masking the problem with an ever-larger timeout.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card