Introduction GitLab CI jobs stuck in "pending" state means no runner is available to pick them up. This blocks the entire pipeline and can delay critical deployments.

Symptoms - Pipeline jobs show "pending" with spinner indefinitely - Error: "This job is stuck because there are no active runners online" - Runners registered but not picking up jobs - Jobs queued but runner count shows 0 available - Runner connected but shows as offline

Common Causes - No runner registered for the project or group - Runner tags do not match job tags - Runner executor not properly configured - Runner max jobs limit reached - GitLab Runner token expired

Step-by-Step Fix 1. **Check runner status**: ```bash # In GitLab: Settings > CI/CD > Runners # Or via API curl --header "PRIVATE-TOKEN: <token>" "https://gitlab.example.com/api/v4/projects/<id>/runners" ```

  1. 1.Register a new runner:
  2. 2.```bash
  3. 3.gitlab-runner register \
  4. 4.--url https://gitlab.example.com/ \
  5. 5.--registration-token <token> \
  6. 6.--executor docker \
  7. 7.--docker-image alpine:latest \
  8. 8.--tag-list "docker,linux"
  9. 9.`
  10. 10.Check runner logs:
  11. 11.```bash
  12. 12.journalctl -u gitlab-runner -f
  13. 13.gitlab-runner --debug run
  14. 14.`
  15. 15.Verify runner tags match job requirements:
  16. 16.```yaml
  17. 17.# .gitlab-ci.yml
  18. 18.build:
  19. 19.tags:
  20. 20.- docker
  21. 21.- linux
  22. 22.`

Prevention - Maintain multiple runners for redundancy - Monitor runner queue depth with alerts - Use autoscaling runners for variable workloads - Register runners with appropriate tags - Test runner connectivity after GitLab upgrades