2.7 KiB
Den API deployment incident runbook
Owner: OpenWork platform on-call
Service: production Den API on Render
Prevention and promotion
The canonical native production contract is:
pnpm install --frozen-lockfile --trust-lockfile
pnpm --filter @openwork-ee/den-api run build
pnpm --filter @openwork-ee/den-api start
The build resolves Den API's workspace dependency graph, builds every package with
a build script, and rejects production exports whose target file is absent.
packaging/docker/Dockerfile.den invokes the same package build. CI additionally
cold-starts dist/main.js without development conditions in
evals/specs/den-api-production-package.test.ts.
Render must use the commands above or deploy the CI-validated
ghcr.io/different-ai/openwork-den-api image. Promotion must require both the
production-package spec and the Publish EE Artifacts / Build openwork-den-api
image smoke check.
Alert contract
Configure Render deployment notifications for build failure, pre-deploy failure,
startup failure, unhealthy service, canceled deploy, and rollback. Route production
events to the platform incident channel and on-call integration. Alert within five
minutes of the first failed phase; deduplicate updates for the same Render deploy ID,
but escalate when /ready remains unhealthy for ten minutes or an automatic rollback
occurs.
Every alert must include:
- service and environment
- commit SHA and deployment URL
- Render deploy ID and failing phase
- error excerpt
- owner: OpenWork platform on-call
- this runbook URL
- Render rollback and redeploy links
Render notification destinations, on-call schedules, and secrets are intentionally managed outside this public repository. Verify them quarterly with a safe synthetic deployment that has an invalid start command, confirm receipt time is under five minutes, then cancel or roll back that deploy. Record the drill in the incident system without committing destination URLs or credentials.
Response
- Open the Render deployment and identify whether build, pre-deploy, startup, or health failed.
- For
ERR_MODULE_NOT_FOUND, runpnpm evals:pr specs/den-api-production-package.test.tsat the failing SHA. Do not promote a native build that differs from the canonical contract. - Inspect
/healthfor process liveness and/readyfor database readiness. A live process with a failing/readyusually indicates a database or migration incident rather than an artifact failure. - Roll back to the most recent healthy deploy when production impact persists. Do not rebuild the same unverified SHA with an ad hoc package list.
- After recovery, attach the failed deploy, commit, alert-delivery timestamp, rollback, and corrective test evidence to the incident.