GitLab CI "resource_group" Jobs Stuck Waiting - Serialization Deadlock
resource_group serializes jobs so only one runs at a time per group - usually deployments. A job can sit in "waiting for resource" if a prior holder never released it or the process mode causes contention.
What this error means
A deploy job stays pending with "waiting for resource" while another pipeline holds the same resource_group. Nothing runs until the holder finishes, is cancelled, or the resource is freed.
This job is waiting for resource: production
(the resource_group 'production' is currently in use by another job)Common causes
A prior job holds the resource
Only one job per resource_group runs at a time. A long-running or stuck deploy in another pipeline keeps the group locked until it completes or is cancelled.
Process mode causes head-of-line blocking
The default unordered mode runs whatever is ready; oldest_first/newest_first change ordering. A mismatched mode can leave newer deploys waiting behind older queued ones.
How to fix it
Find and clear the holder
- Open the environment’s "Deployments" or the project’s pipelines to find the job currently holding the resource group.
- Let it finish, or cancel it if it is genuinely stuck, to release the lock.
- The waiting job then acquires the resource and runs.
Choose an appropriate process mode
Set the resource group’s process mode so the most relevant deploy runs next.
deploy:
script: ./deploy.sh
resource_group: production
environment:
name: productionHow to prevent it
- Keep deploy jobs short so a resource group is not held for long.
- Use
newest_firstprocess mode when only the latest deploy matters. - Pair
resource_groupwithinterruptibleso superseded deploys can be cancelled.