Runbook: CircleCI / Bitbucket Pipelines failure¶
Template (#17). The agent has no CircleCI or Bitbucket Pipelines API client (tracked in #76). It diagnoses from the logs you send and suggests fixes; it can't retry or read builds itself.
How incidents arrive¶
-
Your pipeline's failure step posts to
/webhook/manual:{"type": "cicd", "platform": "<circleci|bitbucket>", "repo": "<org/repo>", "run_id": "<build number>", "raw_logs": "<last 200 lines>", "description": "<job> failed on <branch>"} -
CircleCI: add an
on_failstep or a webhook-to-script bridge. Bitbucket: anafter-scriptthat runs whenBITBUCKET_EXIT_CODE != 0.
Environment facts (fill in)¶
- Default branch and protected branches:
<main> - Where secrets live (CircleCI contexts / Bitbucket repository variables):
<…> - Docker images, caches and runners in use:
<…> - Owner and on-call channel:
<team, #channel>
Diagnosis order¶
- The first error in
raw_logs, not the last line. Check whether it's a dependency resolution, test, lint or deploy step. - Does the same job pass on the default branch? If yes, the change is the cause; if no, check the environment (images, caches, expired secrets).
- Is it flaky (timeouts, network)? Check the job's recent history in the UI or API.
- Secret or permission errors (
401,403,permission denied): check for an expired token or a rotated context variable.
Allowed actions¶
suggest_fixwith the exact diff or config change and how to verify it.- Open a PR with the fix (
create_cicd_pr) only for config files in this repo. - Never re-run deploy jobs or change pipeline secrets: a human does that.
Escalate when¶
- A credential is expired or missing, the failure is in a deploy to production, or the same job failed 3+ times on the default branch.