Back to Coding

When Is the Bug Not in Your Code?

When Is the Bug Not in Your Code?
AI Tutorials Team 5 June 2026

The assumption that the bug is yours is usually correct and occasionally expensive. Some problems are genuinely external, and the signals are recognisable enough to check before spending an afternoon reading code that was working fine.

What are the signals?

  • Nothing changed. Code that has run untouched for weeks.
  • It affects everything. Rather than one feature.
  • It started at a specific moment. Cleanly, rather than gradually.
  • It works elsewhere. One environment fails and another does not.
  • Others report it. On the same platform or service.

What are the common external causes?

A provider incident, an expired credential or certificate, a quota reached, a dependency updated automatically, a platform change, or something in the data rather than the code.

The expiry cases catch people most, because they are invisible until the day they happen and produce a sudden failure in something nobody touched.

What should you check first?

The status page of anything you depend on. Thirty seconds, and it resolves a certain proportion of incidents entirely, which is a considerably better use of the first minute than reading your own code.

How do you check for automatic updates?

Whether your dependency versions are pinned. A project installing whatever is current will eventually break because something upstream released a change, and the failure appears with no commit on your side.

This is one of the strongest arguments for pinning versions.

What about the data?

The most common genuinely external cause. An export that gained a column, a file with a different encoding, a value nobody anticipated, or a record with something unusual in it produces failures in code that is entirely correct.

This has worked for months and started failing today with no deployment. Here is the error. What external causes would produce this: expiry, quota, provider changes, dependency updates or data differences?

What is the danger of assuming it is external?

Waiting for somebody else to fix something that is yours. The assumption cuts both ways, and the check should be quick rather than a conclusion, since most problems really are in your own code.

How do you confirm it?

By reproducing it outside your application. If a minimal example using only the external service fails identically, the problem is not in your code, and you have something worth reporting.

What should you do about it?

Handle it rather than only diagnose it. An external dependency that failed once will fail again, and the useful output of the investigation is a timeout, a retry or a clear message rather than a conclusion that it was not your fault.

How do you check a provider without a status page?

By testing the dependency directly, outside your application. A single call from a command line establishes whether the service is responding, which separates an outage from a problem in your integration.

Searching for recent reports is the other quick check, since widespread problems are usually being discussed somewhere within minutes. Neither takes long, and both are considerably faster than reading your own code on the assumption that something you did not change has stopped working for a reason you caused.

What is the balance?

Check external causes first when nothing changed, and assume it is yours otherwise. That ordering costs a minute and it is right often enough to be worth making automatic.