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