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