Skip to content

Runbook — DeploymentFailed

DeploymentFailed

critical

ops

deployment_status{status="failed"} == 1. The alert label deployment_id identifies the run. The CI / deploy log carries the failure reason.

  • Best case: the rollback in the deploy script succeeded; running version is the previous one; impact = the new feature isn’t live yet.
  • Worst case: the deploy half-applied — new code on the backend, old code on the frontend, or mid-migration. Customers see broken endpoints.
  1. Which version is actually running?

    Terminal window
    curl -fsS https://hub.innoqualis.com/api/status | jq '.version'
    docker inspect innoqualis-backend --format '{{.Config.Image}}'

    Compare with the intended new version in the deploy log.

  2. What failed?

    Terminal window
    gh run view <run-id> --log-failed

    Or tail /var/log/innoqualis/deploy.log. Typical: migration timeout, image pull failure, health-check timeout.

  3. Migration state?

    Terminal window
    docker exec innoqualis-db psql -U postgres -d eqms -c "SELECT version_num FROM alembic_version;"

    Compare with head in the new code. Mismatch = mid-migration state — DANGEROUS.

  • Half-applied deploy → full rollback:
    Terminal window
    ssh ops@prod 'cd /opt/innoqualis && git reset --hard HEAD~1 && make prod-up'
  • Mid-migration → either complete it (docker compose run --rm backend python -m alembic upgrade head) or roll back (alembic downgrade -1) — pick based on whether the new code or old code is currently serving.
  • Communicate via status page if customer impact is observed.
  • Reproduce the deploy failure in staging.
  • Fix the root cause, write a regression test for the deploy script (Phase 28 test methodology).
  • Re-attempt deploy.
  • Blue/green or canary deploys (Phase 26).
  • Migration dry-run in CI before any deploy.
  • Atomic deploy script: deploy.sh must either fully succeed or fully roll back. No half-states.

2026-05-29 — ops