Back to Coding

What Do You Do When It Breaks in Production?

What Do You Do When It Breaks in Production?
AI Tutorials Team 5 June 2026

The application is broken and somebody is trying to use it. The instinct is to work out why, and the correct first action is to get it working, which is frequently a different and much faster operation.

What is the order?

  1. Confirm it is actually broken, and for whom.
  2. Restore service, usually by reverting the last change.
  3. Tell anybody affected, briefly.
  4. Then work out what happened.
  5. Then prevent it recurring.

Steps two and four get swapped constantly, and that swap turns a five-minute outage into an hour.

Why is reverting the right first move?

Because it is fast, reliable and does not require understanding anything. If the application worked an hour ago and the only change was a deployment, going back to the previous version restores service while you still have no idea what went wrong.

Diagnosing under pressure produces worse decisions, and the pressure disappears once it works again.

When is fixing forward correct?

When the cause is obvious and the fix is small, or when reverting would lose data because a migration ran. The second case is the one to be careful about, since database changes are frequently not reversible.

Where do you look first?

  • What changed. A deployment, a configuration change, a dependency update.
  • Error tracking. Which usually names the failure directly.
  • Whether it is you. A platform or provider incident is common.
  • Resources. Storage full, connections exhausted, quota reached.

Why is what changed the best question?

Because applications that were working generally stop for a reason, and the reason is usually recent. Something that has run for six months and failed this afternoon points at today rather than at the code.

What about communication?

A short honest message beats silence by a considerable margin. Saying that something is broken, that you are looking at it, and roughly when you will update, costs a minute and prevents the impression that nobody is there.

People are remarkably tolerant of a small project having problems and considerably less tolerant of being ignored.

How does AI help here?

With the diagnosis rather than the response. Pasting an error and a recent diff produces useful hypotheses quickly, which is genuinely valuable at three in the afternoon with people waiting.

The application started failing after this deployment. Here is the error and here is what changed. Give me the three most likely causes in order, and the fastest way to confirm each.

Checking whether anything was lost during the outage is worth doing before moving on, since a failure partway through an operation can leave records in a state that nothing will correct on its own.

What should happen afterwards?

A few lines written down: what broke, why, how you noticed and what would have caught it earlier. Not a formal process, just a note, because the third time something similar happens you will want the first two.

What if it broke without a deployment?

Look outward rather than at your code. Something that has run untouched for weeks and failed this morning usually has an external cause: a provider incident, an expired credential, a certificate, a quota reached or a dependency updated automatically.

Expiry is the one that catches people most, because it is invisible until the day it happens and produces a sudden failure in something nobody changed. Keeping a note of anything with an expiry date, and what would happen when it passes, turns a mystery outage into a calendar entry you saw coming.

What is the preparation that matters?

Knowing how to revert without looking it up, having a recent backup you have actually restored once, and having error tracking that reaches you. All three are set up calmly beforehand and are impossible to arrange during an incident.