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.
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.
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30 # was hitting the default 360 only on hangsMake the job finish faster
- Cache dependencies so installs do not dominate the runtime.
- Parallelize or shard long test/build steps.
- Add per-step
timeout-minutesso 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.