Troubleshooting a CI/CD run
Start with the first failed or missing boundary. Record the failing job, command, exit status and first meaningful error before editing the workflow.
1. Diagnose by symptom
| Symptom | First thing to inspect | Evidence that isolates it |
|---|---|---|
| Workflow is absent | Workflow directory, event, branch and path filters | A minimal push workflow creates a run |
| Manual workflow has no button | Workflow on the default branch and platform support | A default-branch workflow with workflow_dispatch is listed |
| Job stays queued | Runner registration, scope, exact label and capacity | The runner probe is picked up with the same label |
| Job runs as root | Runner log and container startup | Job container and configured runner mode are identified |
| Checkout fails | Action source, Gitea URL reachability, Node or Git | Error separates failure fetching action code from failure cloning the repository |
| A shell step works locally only | Working directory, interpreter and executable paths | pwd, tool versions and the exact command match the intended environment |
| pytest is missing under uv | Dev dependency, group selection and sync command | uv run --locked python -m pytest --version works inside that job |
| CI fails on a stale lock | Commit includes metadata and lockfile | The lockfile diff matches the dependency change |
| A downstream job is skipped | Upstream results and event or condition | needs graph shows which gate failed or skipped |
| A required check stays pending | PR path filters, workflow name and merge queue event | The intended job reports its stable status name |
| Artifact upload fails on Gitea | Runner version, action pair and job-side endpoint reachability | One-file upload/download probe succeeds |
| Artifact download succeeds but file is missing | Artifact name, extraction path and glob | File list inside the receiving job contains the expected path |
| Cache keeps missing | Key, dependency inputs, accessible scope and runner machine | Two runs with identical keys report miss, then hit |
| Docker publish is denied | Registry path and token scope | Intended owner, package settings and authentication match |
Pod shows ImagePullBackOff | Pod events, pull credentials and digest | Cluster can pull the same image for its node architecture |
| Rollout times out | New Pods, readiness and Deployment events | The first failed pulling, scheduling or readiness event is identified |
| Rollout succeeds but app fails | Service routing and the smoke endpoint | Actual HTTP code and response distinguish routing from behavior |
| Deployment was overwritten | Concurrent jobs and other writers | Deploy audit shows the workflow or operator that changed the reference |
2. Narrow the reproduction
- Keep the same platform, event and runner label.
- Keep one affected job and the steps it needs to fail.
- Reproduce against a dummy service or a disposable branch.
- Change one input and capture the before and after result.
- Restore the original job and rerun the full path.
See Gitea runner probes, pipeline diagnostics and the lab sequence.