Skip to content
Latchkey

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.

Actions log
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.

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - run: ./run-tests.sh
        timeout-minutes: 20

Find and unblock the hanging step

  1. Add non-interactive flags (for example apt-get -y, CI=true) so nothing waits on a prompt.
  2. Parallelize or shard long suites to fit comfortably under the limit.
  3. 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.

Related guides

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