{"name":"postmortem-template","title":"Incident postmortem template","description":"A blameless incident postmortem template with summary, impact, timeline, root cause, what went well and action items, shown on a realistic outage.","category":"writing","updated":"2026-11-30","url":"https://sniptide.com/templates/postmortem-template","files":[{"name":"docs/postmortems/2026-11-18-checkout-errors.md","language":"markdown","content":"# Postmortem: Checkout errors after a database migration\n\n- Date of incident: 2026-11-18\n- Duration: 47 minutes (14:12 to 14:59 UTC)\n- Severity: SEV-2\n- Author: Payments team\n- Status: Action items in progress\n\n## Summary\n\nFor 47 minutes, 31% of checkout attempts failed with a server error. A migration added a\n`NOT NULL` column without a default while the previous app version was still serving traffic.\nRolling back the app did not help, and the incident ended when we added a default to the column.\nAbout 1,900 customers saw an error, and 240 of them did not retry.\n\n## Impact\n\n- 31% of checkout requests returned `500` between 14:12 and 14:59 UTC.\n- An estimated 240 orders were lost, worth about EUR 18,000.\n- No data was lost or corrupted. Payments that failed were never charged.\n\n## Timeline\n\nAll times UTC.\n\n| Time | Event |\n| --- | --- |\n| 14:08 | Deploy 2026.11.18-3 starts. The migration adds `orders.tax_region NOT NULL`. |\n| 14:12 | The migration finishes. Old app pods still insert orders without `tax_region`. Errors begin. |\n| 14:15 | The checkout error-rate alert fires and pages the on-call engineer. |\n| 14:21 | On-call declares an incident and opens #inc-checkout. |\n| 14:26 | The deploy is rolled back. Errors continue, because the column stays. |\n| 14:41 | Logs show `null value in column \"tax_region\" violates not-null constraint`. |\n| 14:55 | `ALTER TABLE orders ALTER COLUMN tax_region SET DEFAULT 'unknown'` runs. |\n| 14:59 | The error rate returns to normal. |\n| 15:30 | The incident is closed and customers who saw errors are identified. |\n\n## Root cause\n\nThe migration and the code that writes the new column shipped in one deploy. During a rolling\ndeploy, old and new app versions run at the same time for several minutes. The old version\ndidn't know about `tax_region`, so its inserts failed once the column became required.\n\nOur migration rules require expand and contract changes, but nothing checks them, and the review\ndidn't catch it.\n\n## What went well\n\n- The alert fired three minutes after errors began.\n- Failed checkouts never charged a customer.\n\n## What went wrong\n\n- Rollback was the first response, but a rollback can't undo a schema change.\n- It took 15 minutes to find the error in logs, because checkout errors log only a generic message.\n\n## Action items\n\n| Action | Owner | Due | Issue |\n| --- | --- | --- | --- |\n| Add a CI check that fails on `NOT NULL` without a default in a migration | Platform | 2026-12-05 | #1412 |\n| Log the database error message on checkout failures | Payments | 2026-11-28 | #1413 |\n| Add \"schema changes can't be rolled back\" to the incident runbook | On-call lead | 2026-11-25 | #1414 |\n| Email affected customers with a discount code | Support | 2026-11-20 | Done |\n"}]}