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
- Find a working case: another user, machine, site or environment, or the same system at an earlier time.
- Confirm the working case really works and the failing case really fails, using the same test on both.
- List the differences: software versions, configuration, network position, account, data, and anything that has changed recently.
- Rank the differences by how likely each is to matter.
- 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
- There is no working example to compare with.Eliminationor ahypothesiswill help.
- The two cases differ in hundreds of ways.Divide and conquercan narrow the list.
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
-
Move the problem
: swap a part instead of comparing.
-
Elimination
: clear one suspect at a time.
-
Divide and conquer
: halve a long list of differences or changes.
Sources
- Method name and description:CCNP TSHOOT: Cisco Troubleshooting Techniques (Petri)andHow to Troubleshoot Networks (NetworkLessons).
- Asking what has changed, and comparing with a known-good baseline:CompTIA Network+ N10-008: How to Apply the Network Troubleshooting Methodology (AlphaPrep). CompTIA's steps place "determine if anything has changed" in the first step, identifying the problem.
- The worked examples are this site's own.
$ compare good-host bad-host
- Item 1 Software version ✓ Matches
- Item 2 Patch level ✓ Matches
- Item 3 Configuration file .20 on one, .21 on the other. Test this first. ✕ Differs
- Item 4 Network settings • Not compared
- Item 5 Accounts and data • Not compared
In practice
Examples and contributions
Entries appear here when a contributor tags them with this methodology.