DevOps & CI/CD Bug Report

GitLab CI job stuck pending: no active runners with these tags

After moving to a new group runner, release jobs sat in pending with the stuck-job warning while other jobs ran. The tags did not all match, the runner refused untagged jobs, and it was protected. We fixed the tags, documented the selection rules and added a canary job.

Amara Nwosu Amara Nwosu @amaranwosu · November 29, 2026 · 8 min read · 0 Views
639-gitlab-ci-job-stuck-pending-runner-tags

We migrated our project from instance runners to a group runner fleet on Kubernetes. Most jobs ran fine the same day. The build-arm and release jobs did not start at all. They sat in pending with a yellow banner:

This job is stuck because you don't have any active runners online or available with any of these tags assigned to them: docker, arm64, release

Nothing in the runner logs mentioned the job. The runners were online, green in the group's runner list, and busy with other jobs from the same pipeline.

Reproducing it

Create a job whose tag list is not fully covered by any single runner:

build-arm:
  tags: [docker, arm64]
  script: [make build]

Register one runner with tags docker, amd64 and another with arm64, kubernetes. Neither has both docker and arm64, so the job stays pending forever. GitLab does not fail it; it waits until the pipeline or job timeout, or until a matching runner appears.

What we ruled out

  • Runners offline. gitlab-runner verify on the manager pod reported all runners as alive, and the UI showed a recent "last contact" time.

  • Capacity. Other jobs were picked up within seconds, so the fleet had free slots.

  • Project not allowed to use group runners. Group runners were enabled in the project's CI/CD settings, and untagged jobs from the same project ran on them.

Root cause

Three runner selection rules were in play at once:

  1. A job runs only on a runner that has every tag listed in the job. Our arm64 runner was tagged arm64, kubernetes; jobs asked for docker, arm64. One missing tag excluded it.

  2. The new runners had Run untagged jobs turned off except for one general-purpose runner, so changing tags casually would have pushed jobs onto the wrong pool.

  3. The release runner was protected, so it only accepts jobs from protected branches and tags. We were testing the release job from a feature branch, where it could never be picked up even with correct tags.

What is happening under the hood

GitLab does not push jobs to runners. Each runner polls the GitLab API asking for work. When a request arrives, GitLab looks for a pending job the runner is allowed to take. A runner is eligible for a job only if all of these are true:

  • the runner is available to the project (instance runner enabled, group runner in an ancestor group, or project runner assigned);

  • the runner is not paused;

  • the job's tags are a subset of the runner's tags;

  • the job has no tags and the runner allows untagged jobs, or the job has tags;

  • if the runner is protected, the pipeline runs on a protected branch or tag;

  • the runner's maximum job timeout and other limits do not reject it.

If no eligible runner exists, the job stays pending and GitLab shows the stuck message, listing the tags it is looking for. The message wording varies a little between versions, but it always means "no runner currently passes the eligibility check", not "runners are down".

Environment

Component

Version / value

GitLab

Self-managed GitLab 18.x

GitLab Runner

18.x, Kubernetes executor, Helm chart

Runners

group runners k8s-amd64 (tags docker, amd64, kubernetes), k8s-arm64 (tags arm64, kubernetes), release (tags docker, release, protected)

Untagged jobs

allowed only on k8s-amd64

Pipeline

merge request pipeline on feature/arm-build

Minimal reproduction

stages: [build, release]

build-arm:
  stage: build
  tags: [docker, arm64]     # no runner has both
  script: [make build ARCH=arm64]

release:
  stage: release
  tags: [docker, release]   # runner exists but is protected
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  script: [make release]

Who is affected

Anyone on GitLab.com or self-managed GitLab who:

  • renames or re-registers runners with a different tag set;

  • moves from instance runners to group or project runners;

  • marks a runner protected and tests jobs from feature branches;

  • copies job definitions from another project with its own tag conventions.

On GitLab.com, jobs targeting hosted runners by a mistyped size tag (for example saas-linux-large-amd64 on a plan where it is not available) show the same pending behaviour.

The fix

1. Make tags describe capabilities, and keep jobs to the minimum set they need. We agreed on one tag per dimension: architecture (amd64, arm64) and special purpose (release, gpu). The executor type is an implementation detail, so we dropped docker and kubernetes from job tags.

 build-arm:
   stage: build
-  tags: [docker, arm64]
+  tags: [arm64]
   script: [make build ARCH=arm64]

The Helm release for the arm64 pool only decides where job pods land:

# runners.config in values.yaml for the arm64 runner Helm release
[[runners]]
  [runners.kubernetes]
    node_selector = { "kubernetes.io/arch" = "arm64" }

With the runner authentication token workflow (GitLab 16 and later), tags and the untagged setting belong to the runner object you create in the UI or API, not to the registration command or Helm values. We updated them through the API so the change was reviewable:

curl --request PUT --header "PRIVATE-TOKEN: $ADMIN_TOKEN" \
  --data "tag_list=arm64" --data "run_untagged=false" \
  "https://gitlab.example.com/api/v4/runners/$RUNNER_ID"

2. Run release jobs only where the protected runner can take them.

 release:
   stage: release
   tags: [release]
   rules:
-    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+    - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
   script: [make release]

Version tags matching v* are protected in the project, so the protected runner accepts them. For a dry run in merge requests we added a separate release-dry-run job without the release tag that runs on the general pool with no publishing credentials.

3. Detect pending jobs instead of waiting. A job's timeout: only counts once a runner starts it, so it does nothing for a job that is never picked up. GitLab eventually fails long-pending jobs with the failure reason stuck_or_timeout_failure, but only after hours. We rely on the canary jobs below to notice a missing pool within minutes.

Alternatives and trade-offs

  • Turn on untagged jobs everywhere. Jobs never get stuck, but an arm64-only job may land on amd64 and fail with confusing errors. Keep untagged jobs on one general pool.

  • Unprotect the release runner. Makes testing easier and lets any branch use the runner that holds publishing credentials. Not worth it.

  • Tag-free routing by image architecture. Not supported; GitLab selects runners by tags only.

How to test the fix

List runners available to the project and their tags, then compare them with each job's tags:

curl --silent --header "PRIVATE-TOKEN: $TOKEN" \
  "https://gitlab.example.com/api/v4/projects/$PROJECT_ID/runners?type=group_type" \
  | jq -r '.[] | "\(.id) \(.description) paused=\(.paused) online=\(.online)"'

curl --silent --header "PRIVATE-TOKEN: $TOKEN" \
  "https://gitlab.example.com/api/v4/runners/$RUNNER_ID" \
  | jq '{tag_list, run_untagged, access_level, paused}'

access_level is ref_protected for a protected runner and not_protected otherwise. Then push a branch that runs build-arm and tag a test release v0.0.0-test on a scratch project to confirm the release path.

Confirming in production

After the change, build-arm was picked up within seconds by the arm64 pool, and the next version tag ran release on the protected runner. The GitLab admin area's job list filtered by status pending showed no job older than one minute over the following week.

Regression guard

  • A tiny canary job per tag runs nightly on a schedule. If any of them is still pending after ten minutes, a watcher job alerts the platform channel.

runner-canary-arm64:
  tags: [arm64]
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
  script: [uname -m]
  • A lint step compares every tags: list in .gitlab-ci.yml with the documented tag vocabulary and fails on unknown tags.

  • Runner definitions live in a Terraform module using the GitLab provider, so tag changes go through review.

Security implications

Protected runners exist to keep credentials and privileged access away from unprotected branches. The stuck release job was that control working. The fix routes release jobs through protected tags rather than weakening the runner. Also check that general-purpose runners accepting untagged jobs do not have cloud credentials or Docker socket access that only release jobs should have; anyone who can push a branch can run arbitrary commands on those runners.

Prevention checklist

  • Keep a short, documented tag vocabulary; one tag per capability.

  • Use the smallest tag set a job needs.

  • Allow untagged jobs on exactly one general pool.

  • Run privileged jobs only from protected refs on protected runners.

  • Add nightly canary jobs per runner pool.

References

Add a label

#gitlab-ci #ci-cd #gitlab-runner #runner-tags #protected-runners
Written by
Amara Nwosu @amaranwosu

I build and maintain public and partner APIs, currently for a logistics platform with web, mobile and third-party clients all calling the same endpoints. Before that I worked on identity: login, sessions, OAuth integrations and the long tail of edge cases they create. The bugs I care about sit at the contract between client and server. A PUT that wiped fields the client never sent, a cache that served one user's page to another, a field removal that broke app versions still in the wild, a refresh flow that logged people out when two tabs raced. None of these show up in a happy-path demo. My posts walk through how each one surfaced, what the HTTP or auth spec actually says, the fix we shipped and the tests we added so the next change to the API does not repeat it.

Advertisement

Comments

0

No comments yet. Be the first to comment!

Sign In to post a comment.