Skip to content
Latchkey

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.

Job page
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

  1. Open the environment’s "Deployments" or the project’s pipelines to find the job currently holding the resource group.
  2. Let it finish, or cancel it if it is genuinely stuck, to release the lock.
  3. 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.

.gitlab-ci.yml
deploy:
  script: ./deploy.sh
  resource_group: production
  environment:
    name: production

How to prevent it

  • Keep deploy jobs short so a resource group is not held for long.
  • Use newest_first process mode when only the latest deploy matters.
  • Pair resource_group with interruptible so superseded deploys can be cancelled.

Related guides

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