GitHub Actions "The job running on runner has exceeded the maximum execution time"
GitHub canceled the job because it ran longer than its allowed time - either the 6-hour default ceiling, a tighter timeout-minutes you set, or a step that hung waiting on input or a lock.
What this error means
The job is canceled mid-run with a message that it exceeded the maximum execution time. The last visible step often shows no progress for a long stretch before the cancellation.
Error: The job running on runner GitHub Actions 5 has exceeded the maximum
execution time of 360 minutes.Common causes
A step hung or waited on input
A command that blocks on a prompt, a lock, or a network resource that never responds runs until the timeout kills the whole job.
Genuinely slow work near the cap
A large test suite or build legitimately approaching the 360-minute hosted-runner limit gets cut off before it finishes.
How to fix it
Set a sensible timeout and fail fast
Add timeout-minutes at the job or step level so a hang fails quickly instead of burning the full ceiling.
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- run: ./run-tests.sh
timeout-minutes: 20Find and unblock the hanging step
- Add non-interactive flags (for example apt-get -y, CI=true) so nothing waits on a prompt.
- Parallelize or shard long suites to fit comfortably under the limit.
- Set explicit network timeouts on calls so a dead endpoint fails instead of hanging.
How to prevent it
- Always set timeout-minutes so a hang fails in minutes, not hours.
- Run commands non-interactively in CI to avoid silent input waits.
- Shard slow test suites across matrix jobs.