Postmortem debugging
By the time you are called, the fire is out. The bad node was recycled, the
process that hung is gone, and rerunning proves nothing because the conditions
have passed. All that survives is what the system happened to record. The job
is to reconstruct a causal story from cold artifacts, knowing you cannot ask
the system a single new question.
Method
- Build the timeline before forming any theory. Pull logs, metrics,
deploy events, and alerts into one time-ordered view, all in a single
timezone, usually UTC. Fix the moment of first impact from the earliest
symptom, not the first alert, which often fires minutes late. The sequence
constrains cause: nothing after the first symptom caused it.
- Separate the trigger from the cause. The deploy at 14:02 may be the
trigger, but the latent bug it exposed is the cause. Ask what changed just
before first impact, config, traffic, a dependency, and what condition made
that change fatal when the same change was harmless yesterday.
- Mine the artifacts for the state you cannot query live. A heap or core
dump captured during the incident still yields a backtrace and variable
values under
gdb or the runtime's dump tool. Metrics show the shape:
memory climbing to a ceiling, a thread pool pinned at max, error rate
stepping up at a specific minute. Read them as the frozen state they are.
- Correlate across signals to place the failure. Line up the latency
spike with the GC log, the error burst with the deploy marker, the
saturation with the traffic curve. A cause leaves a coincident signature in
more than one place; a single suspicious line that nothing else corroborates
is usually a symptom, not the origin.
- Distinguish absence of evidence from evidence of absence. A missing log
can mean the event did not happen or that the process died before flushing,
or that sampling dropped it. Note which signals you would expect and did
not get, and treat a silent gap right before the crash as itself a clue
rather than a dead end.
- Write the reproduction hypothesis the artifacts support, then test it
offline. State the specific sequence you believe occurred and the one
condition that made it fatal. Try to reproduce it in a controlled
environment; a story that cannot be reproduced from the stated preconditions
is not yet a root cause, only a plausible narrative.
Checks
- Does the timeline place first impact before every candidate cause?
- Does the root cause show a coincident signature in at least two signals?
- Could someone reproduce the failure from the preconditions you wrote down?
Boundaries
Postmortem work is bounded by what was recorded: if the logging level was too
coarse or the dump was never captured, the answer may be permanently out of
reach, and the honest output is a ranked set of hypotheses plus the
instrumentation to add before next time. Live faults you can still touch
belong to interactive debugging, which can ask new questions this one cannot.
1---2name: postmortem-debugging3description: Reconstruct what happened from the artifacts a dead incident left behind: logs, metrics, dumps, and a timeline, when there is no live system left to poke. Use when the outage is over, the process is gone, and all you have is what was written down while it burned.4---56# Postmortem debugging78By the time you are called, the fire is out. The bad node was recycled, the9process that hung is gone, and rerunning proves nothing because the conditions10have passed. All that survives is what the system happened to record. The job11is to reconstruct a causal story from cold artifacts, knowing you cannot ask12the system a single new question.1314## Method15161. **Build the timeline before forming any theory.** Pull logs, metrics,17 deploy events, and alerts into one time-ordered view, all in a single18 timezone, usually UTC. Fix the moment of first impact from the earliest19 symptom, not the first alert, which often fires minutes late. The sequence20 constrains cause: nothing after the first symptom caused it.212. **Separate the trigger from the cause.** The deploy at 14:02 may be the22 trigger, but the latent bug it exposed is the cause. Ask what changed just23 before first impact, config, traffic, a dependency, and what condition made24 that change fatal when the same change was harmless yesterday.253. **Mine the artifacts for the state you cannot query live.** A heap or core26 dump captured during the incident still yields a backtrace and variable27 values under `gdb` or the runtime's dump tool. Metrics show the shape:28 memory climbing to a ceiling, a thread pool pinned at max, error rate29 stepping up at a specific minute. Read them as the frozen state they are.304. **Correlate across signals to place the failure.** Line up the latency31 spike with the GC log, the error burst with the deploy marker, the32 saturation with the traffic curve. A cause leaves a coincident signature in33 more than one place; a single suspicious line that nothing else corroborates34 is usually a symptom, not the origin.355. **Distinguish absence of evidence from evidence of absence.** A missing log36 can mean the event did not happen or that the process died before flushing,37 or that sampling dropped it. Note which signals you would expect and did38 not get, and treat a silent gap right before the crash as itself a clue39 rather than a dead end.406. **Write the reproduction hypothesis the artifacts support, then test it41 offline.** State the specific sequence you believe occurred and the one42 condition that made it fatal. Try to reproduce it in a controlled43 environment; a story that cannot be reproduced from the stated preconditions44 is not yet a root cause, only a plausible narrative.4546## Checks4748- Does the timeline place first impact before every candidate cause?49- Does the root cause show a coincident signature in at least two signals?50- Could someone reproduce the failure from the preconditions you wrote down?5152## Boundaries5354Postmortem work is bounded by what was recorded: if the logging level was too55coarse or the dump was never captured, the answer may be permanently out of56reach, and the honest output is a ranked set of hypotheses plus the57instrumentation to add before next time. Live faults you can still touch58belong to interactive debugging, which can ask new questions this one cannot.