Skip to content

Methodologies

Spot the differences

Compare a case that works with one that does not, or the system as it is now with how it was, and list every difference. The fault is usually in one of them.

Also known as: spot-the-differences, in Cisco training material. Also described as comparing a working and a non-working case, or comparing against a known-good baseline.

How it works

  1. Find a working case: another user, machine, site or environment, or the same system at an earlier time.
  2. Confirm the working case really works and the failing case really fails, using the same test on both.
  3. List the differences: software versions, configuration, network position, account, data, and anything that has changed recently.
  4. Rank the differences by how likely each is to matter.
  5. Change one difference in the failing case to match the working one, and retest. Stop when the symptom changes.

When to use it

  • Some users or machines work and others do not.
  • Something worked before and does not now, and you have a record of how it was.
  • Two environments, such as test and live, behave differently.

When another approach is better

Worked example: two servers

Illustrative example

An application works on one server and fails on an identical one. The software versions and patch levels already match, so the comparison moves to the configuration files:

$ diff <(ssh good-host cat /etc/app/app.conf) \
       <(ssh bad-host cat /etc/app/app.conf)
12c12
< upstream = 198.51.100.20
---
> upstream = 198.51.100.21

One line differs. The failing server points to a different upstream address. That is now the first suspect. Changing it to match, and nothing else, then retesting, shows whether it was the cause.

Worked example: the same system, earlier

Illustrative example

A service began failing this morning, and it worked yesterday. The difference to find is what changed in between.

# source code or configuration kept in version control
$ git log --since="2 days ago" --oneline

# recently installed packages on an RPM-based Linux system
$ rpm -qa --last | head

# recently installed updates on Windows (PowerShell)
> Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 5

Merge the results into one list with times, alongside any deployment and network change records. The change nearest before the first failure becomes the first suspect. Reverse it, or test with it removed, in a way that can be undone.

Watch for

  • Too many differences. Change one at a time, or you will not know which mattered.
  • A "working" case that differs in ways you have not seen, such as data, load or time of day.
  • Copying the whole working configuration across. It may fix the symptom without showing you the cause. Cisco course material makes the same warning.
  • Treating correlation as cause. A change that happened just before the fault may be unrelated.
  • Unrecorded changes. Someone may have changed something by hand, and nobody wrote it down.
  • Time-based faults. An expired certificate or a scheduled job looks like a change, though nobody touched anything.

Related methodologies

Sources

$ compare good-host bad-host

  1. Item 1 Software version 4.2.1 and 4.2.1 ✓ Matches
  2. Item 2 Patch level same updates installed ✓ Matches
  3. Item 3 Configuration file line 12: upstream address .20 on one, .21 on the other. Test this first. ✕ Differs
  4. Item 4 Network settings not compared yet • Not compared
  5. Item 5 Accounts and data not compared yet • Not compared
The first worked example. One difference is changed at a time, and the rest are left alone.

In practice

Examples and contributions

Entries appear here when a contributor tags them with this methodology.