How do I replace stuck_or_timeout_failure in GitLab retry:when before 20.0?
Short answer
Replace stuck_or_timeout_failure with the specific reasons that split it in GitLab 19.0: stuck_pending_with_matching_runners, stuck_pending_no_matching_runners, no_updates_running and no_updates_canceling. Replace job_execution_timeout with server_timeout_running and server_timeout_canceling. Both old values were deprecated in GitLab 19.1 and are scheduled for removal in GitLab 20.0 (May 2027) as a breaking change.
If your .gitlab-ci.yml has retry: when: stuck_or_timeout_failure or job_execution_timeout, it still works today, but both values are on GitLab’s list of breaking changes for GitLab 20.0, planned for May 2027. Here is what replaced them and the YAML to switch to, checked against the docs for GitLab 19.6 (released 19 November 2026).
Why were stuck_or_timeout_failure and job_execution_timeout deprecated?
GitLab 19.0 split those two generic failure reasons into more specific ones, so a job is no longer recorded as just “stuck or timed out”. It now says whether it waited with no matching runner, waited despite matching runners, went silent while running, or hit the server-side timeout. New jobs are never recorded with the old reasons; GitLab keeps them only for historical data.
The deprecation was announced in GitLab 19.1 (June 2026), with removal in GitLab 20.0 marked as a breaking change.
Does my pipeline break right now?
No. To avoid silently breaking existing configuration, GitLab treats the old values under retry:when as aliases for the full set of reasons that replaced them. You’ll see a non-blocking warning in CI lint output and in the pipeline editor while you still use them. The deprecation notice doesn’t describe what a pipeline that still lists them will do after 20.0, so update before you upgrade, or before GitLab.com moves to 20.0.
What are the new failure reasons?
| Old value | Replace with | The job failed because |
|---|---|---|
stuck_or_timeout_failure |
stuck_pending_with_matching_runners |
It stayed pending for a long time even though matching runners exist |
stuck_pending_no_matching_runners |
It stayed pending because no runner matches its requirements, such as tags or protected status | |
no_updates_running |
It was running but showed no activity for a long time, for example a hung script or a runner that lost its connection | |
no_updates_canceling |
It was canceling but showed no activity for a long time | |
job_execution_timeout |
server_timeout_running |
A running job exceeded its maximum execution time and server-side timeout enforcement dropped it |
server_timeout_canceling |
A canceling job exceeded its maximum execution time and was dropped during cancellation |
How do I update retry:when?
Find every job and default: block that uses the old values:
grep -rn "stuck_or_timeout_failure\|job_execution_timeout" --include="*.yml" .
Check included files and CI templates in other projects too, because include: pulls their retry settings into your pipeline.
The exact one-to-one replacement for the old behavior lists every new reason:
# Before (deprecated in 19.1, removed in 20.0)
test:
script: make test
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
# After: same behavior, new reasons
test:
script: make test
retry:
max: 2
when:
- runner_system_failure
- stuck_pending_with_matching_runners
- stuck_pending_no_matching_runners
- no_updates_running
- no_updates_canceling
And for timeouts:
deploy:
script: ./deploy.sh
retry:
max: 1
when:
- server_timeout_running
- server_timeout_canceling
retry:max can be 0, 1 or 2. When the failure reason isn’t in the list, the job isn’t retried.
Should I keep all four stuck reasons?
Usually not, and that’s the point of the split. The deprecation note says to replace the old value with “the relevant subset”. A short way to decide:
stuck_pending_no_matching_runners: leave it out. A retry creates the same job with the same tags, and it waits for the same runner that doesn’t exist. Fix the tags or the runner instead; see why a GitLab job is stuck pending.stuck_pending_with_matching_runners: keep it if your runners are autoscaled or often busy. A retry gets the job back in the queue.no_updates_running: keep it for jobs that can safely run twice, like tests. Think twice for deploys: the first attempt may have done part of its work before it went silent.no_updates_canceling: rarely worth retrying, because you or GitLab already wanted the job to stop.
For timeouts, server_timeout_running covers a job that really ran out of time. Retrying a job that’s simply too slow just doubles the wait, so raise the job’s timeout or speed it up first; see GitLab CI job timeouts.
What else changed in failure reasons in GitLab 19.1?
Two other reasons got narrower in 19.1, which matters if your retry:when lists them:
- Some failures that used to be
script_failureare nowrunner_configuration_error, for example an invalid image or tag, an incompatible pull policy or a misconfigured runner. - Some failures that used to be
runner_system_failureare nowrunner_external_dependency_failure(the runner couldn’t reach an image registry because of a network or DNS problem) orrunner_interrupted(the runner was restarted, shut down or its host reclaimed mid-job).
So a retry: when: runner_system_failure written to survive registry blips or spot-instance reclaims no longer catches them. Add the new reasons if you relied on that:
default:
retry:
max: 2
when:
- runner_system_failure
- runner_external_dependency_failure
- runner_interrupted
- stuck_pending_with_matching_runners
- no_updates_running
A default: block applies to every job that doesn’t set its own retry.
Migration checklist
- Search every
.gitlab-ci.yml, included file and CI template forstuck_or_timeout_failureandjob_execution_timeout. - Replace each with the subset of new reasons that makes sense for that job.
- Add
runner_external_dependency_failureandrunner_interruptedwhere you usedrunner_system_failurefor infrastructure flakes. - Validate the file in the pipeline editor or CI lint and confirm the deprecation warning is gone.
- Watch the next few failed jobs’ failure reasons to check your retry list matches what actually fails.
When a retry still fails, the job’s failure reason tells you which bucket it fell into, and you can retry a failed GitLab pipeline by hand once the cause is gone. If that happens while you’re away from your desk, MergeBell shows pipelines and job log tails on iPhone and Android, with retry, cancel and play manual on the free tier.
Frequently asked questions
Is stuck_or_timeout_failure removed from GitLab?
Not yet. It was deprecated in GitLab 19.1 and is scheduled for removal in GitLab 20.0, planned for May 2027, as a breaking change. Until then GitLab treats it under retry:when as an alias for stuck_pending_with_matching_runners, stuck_pending_no_matching_runners, no_updates_running and no_updates_canceling, and shows a non-blocking warning in CI lint and the pipeline editor.
What replaces job_execution_timeout in retry:when?
server_timeout_running, for a running job that exceeds its maximum execution time and is dropped by server-side timeout enforcement, and server_timeout_canceling, for a job that exceeds it while canceling. List one or both.
Will my existing retry:when config break today?
No. Since GitLab 19.0 new jobs are recorded with the specific reasons, but GitLab maps the two old values to the new ones, so retries keep working. Only the removal in 20.0 is the breaking change. You'll see a warning in CI lint and the pipeline editor until you update.
Which reason should I retry when a job is stuck because no runner has the right tags?
That job fails with stuck_pending_no_matching_runners. Retrying it rarely helps, because the same job will wait for the same missing runner. Fix the tags, the runner's protected setting or its availability instead, and keep stuck_pending_with_matching_runners for capacity hiccups.
How many times can retry:max retry a job?
retry:max can be 0, 1 or 2, the same as the plain retry keyword. With retry:when, the job is retried only when its failure reason is one of the listed values.
Sources
- GitLab docs — Deprecations and removals by version (GitLab 20.0)
- GitLab docs — CI/CD YAML syntax reference: retry:when
- GitLab docs — GitLab 19.6 release notes
Checked against these pages on 19 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.