GitLab "The deployment job is older than the latest deployment": what to do
Short answer
"The deployment job is older than the latest deployment, and therefore failed." comes from GitLab's Prevent outdated deployment jobs setting, on by default in new projects: a deploy job that was waiting to run while a newer one deployed to the same environment can't put older code back. It's usually working as intended: the newer version is already live, so don't retry the old job. To deploy an older version on purpose, use Rollback environment under Operate › Environments, which works while Allow job retries for rollback deployments is on, the default; otherwise run a new pipeline for the old commit. To keep deploys in order, use a resource group with the newest_first process mode, and keep Auto-cancel redundant pipelines on.
A deploy job fails without running its script, and the job page says:
The deployment job is older than the latest deployment, and therefore failed.
In the pipeline view, it’s labeled failed outdated deployment job. It’s GitLab protecting the environment: a newer pipeline already deployed there, and this older job would have put older code back. Here’s how it works in GitLab 19.5, and what to do when you do want the older version.
Why GitLab fails the job
The project setting Prevent outdated deployment jobs, on by default in new projects, stops this race:
- You push twice: pipeline A, then pipeline B. Each has a
deployjob toproductionwithresource_group: production, so only one deploy runs at a time. - Both
deployjobs become ready while another deploy is running, A’s first, and wait their turn. - B’s
deployruns first and deploys the newer code. - When A’s turn comes, GitLab fails it instead of deploying the older code over the newer.
GitLab creates a deployment record when each deploy job becomes ready to run, and compares those records, not commit dates. A waiting job whose record is older than the environment’s last successful deployment, from a different commit, can’t run. It applies only to jobs that deploy to an environment with environment:, and only to deployments to the same environment.
It doesn’t catch every out-of-order deploy. If A’s earlier stages finish after B has deployed, A’s deploy becomes ready later, counts as newer, and runs. Cancelling old pipelines, below, helps there.
Manual deploys you can’t run
For a manual deploy job, GitLab disables Run instead, with this message:
This deployment job does not run automatically and must be started manually, but it's older than the latest deployment, and therefore can't run.
The same check can show You are not authorized to run this manual job. What counts is the order in which deploy jobs became ready to run, not the commit date or when you select Run: once a deploy succeeds, manual deploys to the same environment that became ready before it, from other commits, can’t run. So if an older pipeline’s deploy became ready last, deploying it blocks the newer pipeline’s. A rollback is a new deployment too, so it blocks manual deploys that were already waiting.
If the environment is protected, the same not authorized message also appears when you aren’t listed under Allowed to deploy.
Usually: nothing to fix
The newer version is already deployed, which is what you wanted. Don’t retry the failed job: GitLab warns that retrying it could overwrite the environment with the older source code.
Roll back on purpose
To put an older version back:
- Go to Operate › Environments and select the environment.
- Next to a previous successful deployment, select Rollback environment.
The rollback reruns that deployment’s job as a new deployment, so the outdated check doesn’t stop it. It works while Allow job retries for rollback deployments is on, as it is by default. If a Maintainer turned it off, the rollback buttons are hidden or disabled: run a new pipeline for the commit you want instead, such as with Build › Pipelines › New pipeline on a tag, or by reverting the change.
Only deployment jobs rerun in a rollback. If an earlier job produced something the deploy needs, run that job again first.
Keep deploys in order
- One at a time: give deploy jobs a
resource_group, such asresource_group: production, so two deploys to the same environment never run at once. - Newest first: set that resource group’s process mode to
newest_firstornewest_ready_first, through the resource groups API, so the newest waiting deploy runs first. Once it succeeds, the older ones fail as outdated instead of deploying in turn. - Cancel old pipelines: Auto-cancel redundant pipelines, on by default, makes a new pipeline on a branch cancel the older one’s jobs that haven’t started, and its running jobs marked
interruptible: true, unless a job withoutinterruptible: truehas already started. Mark build and test jobsinterruptible: true, not deploy jobs.
To turn the protection off, go to Settings › CI/CD, expand General pipelines, and clear Prevent outdated deployment jobs. Do that only if your deploys don’t depend on order.
On your phone
MergeBell shows each pipeline’s jobs and their status, so a deploy marked outdated stands out, and Retry reruns a job on the free tier. Retrying an outdated deploy can put older code back, so check which pipeline is newer first. Rollbacks and settings need GitLab in a browser. Manual deploys are in how to run a manual job, and resource groups in jobs stuck pending.
Frequently asked questions
Why did my GitLab deploy job fail with "older than the latest deployment"?
The project has Prevent outdated deployment jobs on, the default for new projects. Your deploy job was waiting to run, for example for its resource group, when a deploy job that became ready after it deployed a different commit to the same environment. GitLab failed the waiting job so it couldn't overwrite that deployment with older code. The pipeline view labels it failed outdated deployment job.
Why can't I run a manual deploy job in GitLab?
If a deploy job that became ready after it has since deployed a different commit to the same environment, GitLab disables Run, with a message that the job is older than the latest deployment and can't run. A rollback blocks waiting manual deploys the same way. The same check can make GitLab say You are not authorized to run this manual job, and so does a protected environment that doesn't list you under Allowed to deploy.
How do I roll back a deployment when outdated deployment jobs are prevented?
Go to Operate › Environments, select the environment, and select Rollback environment next to a previous successful deployment. That reruns its deploy job as a new deployment, which works while Allow job retries for rollback deployments is on, as it is by default. If a Maintainer turned it off, run a new pipeline for the commit you want to deploy instead.
How do I turn off Prevent outdated deployment jobs in GitLab?
Go to Settings › CI/CD, expand General pipelines, clear Prevent outdated deployment jobs, and select Save changes. Without it, an older pipeline's deploy job that finishes last overwrites a newer deployment, so keep it on unless your deploys don't depend on order.
How do I stop old GitLab deploy jobs from waiting in line?
Give deploy jobs a resource_group, such as production, so they run one at a time, and set its process mode to newest_first or newest_ready_first through the API, so the newest waiting deploy goes first. Auto-cancel redundant pipelines, on by default, also cancels an older pipeline's jobs that haven't started, and its running interruptible: true jobs, when a new one starts on the same branch, unless a job without interruptible: true has already started.
Sources
- GitLab docs — Prevent outdated deployment jobs
- GitLab docs — Retry or roll back a deployment
- GitLab docs — Resource group process modes
- GitLab docs — Auto-cancel redundant pipelines
- GitLab source — the outdated deployment check (deployable.rb, deployment.rb)
Checked against these pages on 14 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.