An 8-day outage that returned HTTP 200
Symptom. Every new customer onboarding failed for eight days. Meta refused the app subscription, provisioning stopped before phone registration, and our logs showed nothing wrong.
How I found it. Nothing alerted, because the webhook verification handler answered HTTP 200 while rejecting the request. The tell was in the web server access log: every verification request from Meta got a 1-byte response body, the string 0, instead of the echoed challenge. A controlled test against the live endpoint, sending the same challenge twice with only the token changed, settled it in one step.
Cause. Our messaging provider presents a fixed placeholder token rather than the one we had registered, and our handler rejected it. A second fault hid nearby: Meta verifies with GET, but the provider's own validator uses POST, so a GET-only handler passes one and fails the other.
Fix. An accept-list of verify tokens, checked by one shared function used by both the GET and POST paths so they cannot drift apart.
A 200 is not proof of success. Assert on the end state, and look at boring signals like response size before clever theories.
Inbox media failing for about 90% of accounts
Symptom. Images and documents in the inbox showed "failed to load" for most customers. It had been assumed to be flaky.
How I found it. The failures were not random. Media worked for 8 of 79 accounts, and those 8 were exactly the ones onboarded through our own signup flow. A failure that splits cleanly along an ownership boundary is a permissions problem, not a network one.
Cause. We stored only a media ID and fetched the file later through an API that requires our app to be subscribed to the account, which held for just those 8. Meanwhile the incoming webhook already carried a short-lived download URL that works without that subscription, and we discarded it every time.
Fix. Download at webhook time and store the file in S3. That then needed hardening: buffered rather than streamed uploads, a queue with a fixed job ID so a redelivered webhook does not download twice, five attempts with backoff inside the URL's five-hour life, bounded concurrency, and no retries on authorisation errors that cannot succeed.
About 90% is the share of accounts that were affected, not a repair rate. The fix restores media from then on; older messages whose links had already expired are marked as permanently unavailable rather than retried forever.
A unique index that stopped every invite expiring
Symptom. The invite-expiry job failed every half hour, 48 times a day, logged only as "Failed query". Meanwhile team invites were being rejected for addresses that had been invited before.
Cause. The ORM wrapper hid the real Postgres error, a unique-constraint violation. The index was named as if it meant "one pending invite per address", but it was unique on company, email and status with no condition. That allowed one row per status, so an address could only ever hold one expired invite. The job expired invites in a single bulk update, so one collision aborted all of them.
Fix. A partial unique index that applies only to pending invites.
Verification. No unit test can catch a constraint, because tests with a mocked database pass either way. I rehearsed the production schema push on a scratch database built from the live schema and real invite rows: the update failed before, the push applied without prompting, the update succeeded after, and a second pending invite was still refused.
An index name is a claim. The definition is the truth.
26 hours of failures caused by trailing spaces
Symptom. Events from the ERP to the messaging platform returned 404 for 26 hours after launch.
How I found it. By elimination. I ruled out the worker environment, a stale process, the network, the connected app, the database and the signature. A seed command that sends inline, bypassing the task queue entirely, still failed, which ruled out the queue. The receiver's log finally showed the URL: 24 correct characters followed by 48 spaces. print() renders trailing spaces as nothing, so the value looked right everywhere until I used repr().
Cause. Trailing whitespace in an environment file, which the configuration library returns verbatim.
Fixing only the URL would have been worse. The secret had the same padding, and the receiver answered 200 to a bad signature, so events would have been marked sent while silently doing nothing. A visible failure would have become an invisible one.