Skip to content
ModuleM7 — Incidents
After this session you canRestore service in three common incidents on a live release, handle a dead-letter queue safely, and record each incident so the next operator learns from it.
TimeFacilitated: 54 min · On your own: 53 min
Before you startM7-S1: the method, the catalogue and the safety rules. The release healthy; the core-rest transport back on.
Go deeperRunbooks: replay the message bus · Maintenance operations: RabbitMQ

◆ Orientation (1 min) — Practise where it is safe

Section titled “◆ Orientation (1 min) — Practise where it is safe”

The first time you follow a runbook should not be at three in the morning on Northwind’s production. Here you cause three incidents on your own lab, each from a short “injection” card, and then work them from the symptom, as if someone else had caused them. Keep the clock running: each incident has a time limit, as a real one would.

Goal. Each incident diagnosed, recovered, verified and written up within its time limit.

How the drill works. With a facilitator, the facilitator injects each incident while you are away from the keyboard, and you work it alone or in a pair. On your own, run the injection, then close it, start a timer, and work from the symptom only: do not look at the model answer until the incident note is written.

Keep an incident note for each, in inventory.md:

Incident <n> | started <time> | resolved <time>
Symptom:
Layer and store:
What I did (with times):
Verified by:
What would have caught it sooner:

Before you start. Two terminals; the Mailpit and RabbitMQ management port-forwards available.

Incident 1: “Search has not updated since lunch” (12 minutes)

Section titled “Incident 1: “Search has not updated since lunch” (12 minutes)”

Injection: kubectl -n northwind scale deploy/nw-osos-indexing --replicas=0

  1. In the portal, change Drill Marker’s job title twice, so there is work to index.
  2. Work the incident from the symptom. Useful evidence: the indexing queue’s consumers (rabbitmqctl list_queues -p nw name consumers messages), the pods, and osos_queue_depth.
  3. Restore the release to its values, not by hand: helm upgrade nw ./osos -n northwind $values --wait --timeout 10m.
  4. Verify: the indexing queue has a consumer again and its messages fall to 0.

Incident 2: “Strange messages in a dead-letter queue” (15 minutes)

Section titled “Incident 2: “Strange messages in a dead-letter queue” (15 minutes)”

Injection: place an unreadable message on the timeline application’s dead-letter queue through RabbitMQ’s management API, as if the platform had given up on it:

Terminal window
kubectl -n datastores port-forward svc/rabbitmq 15672:15672 &
curl -s -u lab:lab-only-rabbit -H "content-type: application/json" \
-X POST http://localhost:15672/api/exchanges/nw/amq.default/publish \
-d '{"properties":{},"routing_key":"timeline-service-queue-dead-letter","payload":"lab-poison-message","payload_encoding":"string"}'
  1. Find the dead-letter queue that now holds a message: open http://localhost:15672 (user lab, the lab password), Queues, and look for a …-dead-letter queue with a count above 0.

    Screenshot pending RabbitMQ management Queues tab for the nw virtual host, with timeline-service-queue-dead-letter holding one message What to notice: the work queue is empty and has its consumer; only the dead-letter queue holds the message, waiting for your decision.

  2. Inspect it without removing it: open the queue, Get messages, with Ack mode set to Nack message requeue true, and read the payload.

  3. Decide: replay or purge? Write your reasoning in the note first.

  4. Act on your decision: Purge Messages on that dead-letter queue if it is poison.

  5. Verify: the dead-letter queue is at 0, and the timeline queue has its consumer.

Incident 3: “Scheduled reminders stopped after this morning’s change” (13 minutes)

Section titled “Incident 3: “Scheduled reminders stopped after this morning’s change” (13 minutes)”

Injection: an upgrade with a mistyped database host:

Terminal window
helm upgrade nw ./osos -n northwind $values \
--set scheduler.config.mongodb.url="mongodb://mongo-x.datastores.svc.cluster.local:27017/nw-scheduler?replicaSet=rs0" \
--wait --timeout 3m
  1. Work the incident from the symptom. Useful evidence: helm history, the scheduler pod’s state, its events and its previous logs.
  2. Stabilise with the release’s own history, not with a new hand-made fix.
  3. Verify: the scheduler pod ready, helm history showing the rollback, and the smoke test.

Check.

  • Incident 1: indexing restored through helm upgrade, and its queue drained.
  • Incident 2: the poisoned message inspected before it was removed, and your reasoning written down.
  • Incident 3: the release rolled back to the last good revision, and the scheduler ready.
  • Each incident has a note with times, the layer and store, and how you verified it.
  • No incident took more than its time limit, or your note says why it did.
  • No step used FLUSHALL, deleted a queue, or edited a Deployment by hand.

Pass condition. All six checks hold.

If something goes wrong

What you seeWhat to do
Incident 2: no dead-letter queue fillsCheck the injection’s routing key: timeline-service-queue-dead-letter, on the nw virtual host.
Incident 2: Get messages removed the messageAck mode was not Nack message requeue true. Nothing is lost in the drill; note it, and use the right mode next time.
Incident 3: the upgrade did not failThe host may resolve in your cluster; use an obviously wrong host such as mongo-x.
Incident 3: the rollback waitskubectl -n northwind describe pod on the scheduler; the previous revision should start within a minute.
You ran out of timeFinish the incident anyway, and record how long it took. The time limit is there to make you notice where time went.
Model answer

Incident 1. Layer and store: everything works but search is late: the bus and the indexing workers. list_queues shows indexing-service-queue with 0 consumers and messages waiting; kubectl get pods shows no indexing pod. Restoring the release to its values (helm upgrade with the same files) brings the replica back; the queue drains to 0. Sooner: an alert on a service queue with no consumer, and on readiness (M5-S1). Using helm upgrade rather than kubectl scale keeps the cluster equal to the values.

Incident 2. Layer and store: the bus. timeline-service-queue-dead-letter holds one message whose payload is lab-poison-message, not a platform event. Decision: purge, because no fix makes this message valid, and replaying it would only send it back after five retries. Before purging, its payload and time are recorded in the note. Had the dead letters been real events from an outage, the decision would have been the opposite: fix the cause, then move them back in small batches. Sooner: an alert on any dead-letter queue above 0.

Incident 3. Layer and store: a failed release; the scheduler cannot reach its MongoDB. helm history shows the newest revision failed; the scheduler pod is not ready and its log shows a connection error to mongo-x. Stabilise: helm rollback nw <last deployed revision> -n northwind --wait; no migration ran in the failed revision, so the rollback is complete (M2-S3). Sooner: a render-and-diff step before every upgrade, and a values review by a second person.

✳ Discussion (8 min) — The blameless review

Section titled “✳ Discussion (8 min) — The blameless review”

Pick incident 3. In a blameless review the question is never “who typed the wrong host?” but “what let a wrong host reach production, and what will catch it next time?”

  1. List two changes to the process (not to people) that would have stopped incident 3.
  2. Which signal would have told you first, before a user did?

With a facilitator. Pairs swap incident notes and review each other’s incident 3 for five minutes, then each pair shares its best process change; the room keeps the top three.

On your own. Write your answers to both prompts, then compare with the model answer.

Model answer
  1. Process changes. Render and diff every upgrade against the running release before applying it (M2-S3), with the diff reviewed by a second person; keep values changes in Git with a pull request, so a stray --set on the command line is not how production changes. A staging release that receives the same values first catches a wrong host before production does.
  2. Earliest signal. The upgrade itself: --wait failed after three minutes and Helm marked the revision failed. Treat a failed upgrade as an incident at once, and alert on any release pod not ready for five minutes, so a failure outside a watched upgrade is caught too.

✓ Practice (5 min) — Check your understanding

Section titled “✓ Practice (5 min) — Check your understanding”
PracticeChoose one answer.

A dead-letter queue holds 30 messages that are real DataEntryCreated events, dead-lettered while the reaction application’s database was unreachable for an hour. The database is back. What do you do?

  1. Explanation for A

    ✗ Incorrect

    Not this one: they are real events whose automations never ran; purging loses that work. See Three incidents.

  2. Explanation for B

    ✓ Correct

    Correct: real events are replayed once the cause is fixed; poison is purged. See Three incidents.

  3. Explanation for C

    ✗ Incorrect

    Not this one: dead-lettered messages stay where they are after a restart; they must be moved. See Three incidents.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

Why inspect a dead-letter queue with Nack message requeue true?

  1. Explanation for A

    ✓ Correct

    Correct: inspecting must never remove the evidence you are about to decide on. See Three incidents.

  2. Explanation for B

    ✗ Incorrect

    Not this one: requeue puts them back in the queue they came from, the dead-letter queue. See Three incidents.

  3. Explanation for C

    ✗ Incorrect

    Not this one: other modes show them too, but remove them. See Three incidents.

Check your answer

The correct answer is A. Open the explanation under each option to see why.

PracticeChoose one answer.

During an incident, an engineer fixes a stopped worker with kubectl scale --replicas=1. Why does the drill restore it with helm upgrade instead?

  1. Explanation for A

    ✗ Incorrect

    Not this one: it works; the problem is what it leaves behind. See Three incidents.

  2. Explanation for B

    ✓ Correct

    Correct: the values stay the source of truth, even under pressure. See Three incidents.

  3. Explanation for C

    ✗ Incorrect

    Not this one: Helm knows nothing about queue contents. See Three incidents.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

Which line belongs in a blameless incident review?

  1. Explanation for A

    ✗ Incorrect

    Not this one: it names a person and changes nothing that would prevent a repeat. See The blameless review.

  2. Explanation for B

    ✓ Correct

    Correct: a process change that catches the same mistake whoever makes it. See The blameless review.

  3. Explanation for C

    ✗ Incorrect

    Not this one: it delays risk and security fixes instead of reducing the risk. See The blameless review.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

↺ Recap (1 min) — After Module 7 you can

Section titled “↺ Recap (1 min) — After Module 7 you can”

After this module you can turn a reported symptom into a layer, a store and a runbook, recover the common incidents on a live release, handle a dead-letter queue safely, use the combined-pod rollback ladder, and write and review incidents so the next one is shorter.

Next. Module 8 looks beyond one release: how tenants are provisioned, moved and retired in a multi-tenant deployment, and what the function and package services are for.