GitLab CI job timeout: "execution took longer than" and how to raise it

By Melih Toksari, developer of MergeBell · Updated · 3 min read

Short answer

A GitLab CI job fails with "execution took longer than 1h0m0s seconds" when it runs past its timeout. The project timeout, 60 minutes by default, is under Settings › CI/CD › General pipelines › Timeout. A job's timeout keyword replaces it, longer or shorter, and a runner's Maximum job timeout caps the result; the job's page shows which applies, such as "1h (from project)". On GitLab.com, jobs on GitLab-hosted runners stop after 3 hours whatever you set. To keep artifacts from a job that runs out of time, stop the script first with RUNNER_SCRIPT_TIMEOUT.

The job runs for an hour, then stops:

WARNING: step_script could not run to completion because the timeout was exceeded. For more control over job and script timeouts see: https://docs.gitlab.com/ci/runners/configure_runners/#set-script-and-after_script-timeouts
ERROR: Job failed: execution took longer than 1h0m0s seconds

“1h0m0s seconds” is the runner printing the job’s timeout as a duration. GitLab marks the job failed: “The script exceeded the maximum execution time set for the job.” Here’s where that limit comes from in GitLab 19.5, and how to change it.

Which timeout applies

  • The project timeout, 60 minutes by default, applies to every job.
  • A job’s timeout keyword replaces it for that job, longer or shorter.
  • A runner’s Maximum job timeout caps both. When it’s lower, it wins.

The job’s page shows the result in its sidebar, such as Timeout: 1h (from project). “From job” and “from runner” tell you which setting to change.

On GitLab.com, jobs on GitLab-hosted runners stop after 3 hours, whatever the project or job says. A longer job needs a runner you host yourself.

Raise the project timeout

With the Maintainer role, go to Settings › CI/CD, expand General pipelines, and set Timeout as a duration, such as 90m or 2 hours: a bare number counts as seconds. It must be at least 10 minutes and less than a month.

Set a timeout for one job

integration-tests:
  script: make integration
  timeout: 2h 30m
  • Only in jobs. GitLab accepts timeout under default: without an error, but ignores it there.
  • Longer than the project timeout is allowed, but never longer than the runner’s maximum.
  • Shorter is useful too: a hung test then fails in minutes instead of holding a runner for an hour.

Raise a runner’s maximum

A runner’s Maximum job timeout is in seconds, at least 600. Empty means the runner doesn’t cap jobs.

  • Instance runners, on GitLab Self-Managed: an administrator, in Admin › CI/CD › Runners, then Edit.
  • Group runners: the group’s Owner, in Build › Runners.
  • Project runners: a Maintainer or Owner of the project, in Settings › CI/CD › Runners.
  • Through the API: PUT /runners/:id with maximum_timeout.

Keep the artifacts when time runs out

When the job timeout hits, there’s no time left to upload artifacts or cache. Stop the script a little earlier with RUNNER_SCRIPT_TIMEOUT, and the upload still fits:

long-tests:
  timeout: 1h
  variables:
    RUNNER_SCRIPT_TIMEOUT: 50m
  script: make test
  artifacts:
    when: on_failure
    paths:
      - test-results/

after_script gets 5 minutes by default, and RUNNER_AFTER_SCRIPT_TIMEOUT changes that. The two together must fit inside the job timeout. A failed job saves no cache unless cache:when is on_failure or always. The log still prints the job’s timeout, “execution took longer than 1h0m0s seconds”, even when the script timeout stopped it. More on uploads in GitLab CI artifacts.

Other timeouts

  • “The job was running but showed no activity for an extended period.” GitLab stopped hearing from the runner for about half an hour: it crashed, restarted or lost its connection. A script that hangs on a working runner runs into the job timeout instead.
  • Stuck in pending. A job that no runner picks up fails after about an hour when no matching runner is online, or after a day when one is: see jobs stuck pending.
  • Job failed (system failure): timed out waiting for pod to start. On the Kubernetes executor, the pod didn’t start within the runner’s poll_timeout, 180 seconds by default. Raise it in the runner’s config.toml.

On your phone

MergeBell shows a job’s log live, including the execution took longer than line, and Retry reruns the job on the free tier. A retry picks up a raised project or runner timeout; a changed timeout in .gitlab-ci.yml needs a new pipeline. The timeout settings need GitLab in a browser. More in how to retry a failed GitLab pipeline.

Frequently asked questions

Why does GitLab CI say "execution took longer than 1h0m0s seconds"?

The job ran past its timeout, and the runner stopped it. The default is the project timeout of 60 minutes. Raise it under Settings › CI/CD › General pipelines › Timeout, or give the job a timeout keyword. A runner's Maximum job timeout caps both, and on GitLab.com, GitLab-hosted runners stop every job after 3 hours.

How do I increase the job timeout in GitLab?

For every job in a project, a Maintainer sets Settings › CI/CD › General pipelines › Timeout to a duration such as 2h, from 10 minutes to just under a month; a bare number counts as seconds. For one job, add timeout: 2h to it in .gitlab-ci.yml. If the job page then still says "from runner", the runner's Maximum job timeout is lower: an administrator raises it for instance runners, the group's Owner for group runners, and a project Maintainer for project runners.

What is the maximum job timeout on GitLab.com?

Jobs on GitLab-hosted runners on GitLab.com stop after 3 hours, regardless of the project or job timeout. A longer job needs a runner you host yourself, registered to your project or group, where the project timeout and the job's timeout keyword apply.

Why doesn't my GitLab job's timeout keyword work?

Usually a runner's Maximum job timeout is lower: the job page shows the timeout with "(from runner)". Under default:, timeout is accepted but ignored: set it in each job. And GitLab-hosted runners on GitLab.com stop jobs at 3 hours whatever it says.

How do I keep artifacts when a GitLab job times out?

Stop the script before the job timeout with the RUNNER_SCRIPT_TIMEOUT variable, for example 50m in a job with timeout: 1h, and set artifacts:when, plus cache:when if you need the cache, to on_failure or always. The script then fails in time for the runner to upload them.

Sources

Checked against these pages on 6 November 2026. GitLab changes quickly — if something here no longer matches, tell us and we will fix it.

Do this from your phone with MergeBell

Free for the whole review loop: the To-Do inbox, diffs and line comments, approve and merge, pipelines with retry, and push alerts for your To-Dos. Works with gitlab.com and self-managed GitLab 16.0+.

Get MergeBell for iPhoneGet MergeBell for Android

On the App Store for iOS 26 or later and on Google Play for Android 12 or later. An independent app, not affiliated with GitLab Inc.