Most of this course has dealt with organizational problems: lead times, processes, teams, decisions. But if you work in a tech team, many of your day-to-day problems are of a different kind: a service that fails intermittently, a piece of data that shows up duplicated, an app that crashes only on some phones, a build that suddenly takes twice as long. With these problems, the temptation is to "try things": restart, change a setting, add a print, test again. Sometimes it works; often it eats up hours and leaves the problem not understood. Systematic troubleshooting is the technical version of the problem-solving process you've learned in this course: define the symptom precisely, reproduce it, gather evidence, narrow it down, divide the search space, move forward with one hypothesis and one change at a time, check your assumptions, document as you investigate, know when to ask for help, and close with the root cause and prevention. In the previous lesson, you saw the module's broadest perspective, systems thinking; this is the most concrete. You'll apply it alongside Nuria and Raúl as they investigate a real failure in an ERP integration: orders that show up duplicated in LogiTrack, intermittently, after a connector update.
Contents
- What systematic troubleshooting is
- The method on one page
- Defining the symptom precisely
- Containing before investigating, if there's ongoing damage
- Reproducing the problem
- Gathering evidence: logs, metrics, and traces
- Narrowing it down: what changed and where it happens
- Divide and conquer: binary search and git bisect
- One hypothesis and one change at a time
- Checking your assumptions: "Is it plugged in?"
- Documenting as you investigate
- When to escalate or ask for help
- Closing: root cause, fix, and prevention
- TechSolutions: the duplicate orders in INT-66
- Investigation notebook template
- What systematic troubleshooting is
Troubleshooting (also called fault diagnosis or technical incident resolution) is the process of finding and removing the cause of a failure in a technical system. "Systematic" means following an explicit method instead of trying random changes.
| Approach | How you work | Typical result |
|---|---|---|
| Trial and error ("poke at it until it works") | Several things are changed at once based on intuition | Sometimes it gets fixed, but nobody knows why; the failure comes back; other things break |
| Systematic troubleshooting | Precise symptom → evidence → hypothesis → test that confirms or refutes it → next hypothesis | The cause is found, it can be explained, and it can be prevented |
How it's similar to and different from the rest of the course:
| Aspect | Organizational problems (Modules 1-6) | Technical problems (troubleshooting) |
|---|---|---|
| Typical cycle | Weeks or months | Minutes, hours, or a few days |
| Evidence | Indicators, interviews, observation | Logs, metrics, traces, code, configuration |
| Experiments | Pilots, expensive and slow | Reproductions, often cheap and repeatable |
| Causes | Usually several, with loops | Often one main technical cause and several factors that allowed it |
| Shared tools | Framing, "Is / Is Not," 5 Whys, verification with data, postmortems | The same ones, applied to systems |
The great advantage of the technical world is that experiments are usually cheap: you can reproduce, change one variable, and test again in minutes. The method is about taking advantage of that with discipline.
- The method on one page
flowchart TD
A["1 Define the symptom precisely"] --> B{"Is there ongoing damage?"}
B -->|"Yes"| C["2 Contain"]
B -->|"No"| D["3 Reproduce"]
C --> D
D --> E["4 Gather evidence"]
E --> F["5 Narrow down: what changed, where it happens"]
F --> G["6 Divide and conquer"]
G --> H["7 One hypothesis, one change, one test"]
H -->|"Refuted"| F
H -->|"Confirmed"| I["8 Root cause, fix, and prevention"]
How to read the diagram: the main flow runs from top to bottom, but it has a loop: when a hypothesis is refuted, you narrow things down again with the new information. Containment is only done if the failure is still causing damage. Throughout the whole process, there are two cross-cutting activities that don't appear as boxes: documenting (Section 11) and knowing when to ask for help (Section 12).
- Defining the symptom precisely
Half of all long investigations start with a vague symptom: "it's slow," "it fails sometimes," "the orders come out wrong." A well-defined symptom answers these questions:
| Question | Vague | Precise |
|---|---|---|
| What exactly is observed? | "Orders are coming out repeated" | "Two records in LogiTrack with the same external ERP reference and the same customer" |
| What was expected? | — | "One record per external reference" |
| Where? | "In production" | "INT-66's customer; ERP-A connector" |
| When did it start, and how often? | "Sometimes" | "Since November 3; 37 cases in 2 days" |
| How was it detected? | — | "Customer ticket: their warehouse picked the same order twice" |
| What's the impact? | "Serious" | "Duplicate orders in the customer's warehouse; some shipped twice" |
An operational definition lets you count the cases (as you saw in the "Collecting Data and Evidence" lesson). If you can't write a query, a grep, or a rule that tells a case apart from a non-case, the symptom isn't well defined yet.
- Containing before investigating, if there's ongoing damage
In "The Problem-Solving Process: An Overview" lesson, you saw that when there's ongoing damage, you contain before analyzing. In the technical world, this is even more important: a failure that corrupts data keeps corrupting it while you investigate.
| Typical containment measure | When to use it | Caution |
|---|---|---|
| Roll back the last change | The failure started after a deployment | Roll back the configuration too, not just the code (factor F3 in the Friday outage postmortem) |
| Disable a feature (feature flag) | The failure is in a specific feature | Let whoever uses it know |
| Limit the scope | It only affects one customer or one region | Check that it really only affects that scope |
| Stop a process | An automated process is damaging data | Know what stops working when you stop it |
Containing isn't solving. A rollback that makes the symptom disappear is also a very valuable piece of evidence (a before/after test), but it doesn't explain the cause. If you stop there, the failure will come back with the next deployment.
- Reproducing the problem
Reproducing means getting the failure to happen at will, in an environment where you can observe it and change things without risk. It's the step that speeds up everything else the most: with a reliable reproduction, each hypothesis can be tested in minutes.
How to do it:
- Copy the conditions of the failure: same version, same configuration, similar data, same load.
- If the failure is intermittent, look for what the cases have in common: time of day, size, data type, latency, concurrency. Intermittent failures are almost never random: they depend on a condition you don't know about yet.
- Reduce the case to the minimum: remove everything that isn't needed for it to fail. A minimal case is easier to understand and to turn into an automated test.
- Automate the reproduction: a script that returns "fails" or "doesn't fail." You'll use it for the binary search and as a regression test.
If you can't reproduce it: don't get stuck. Improve observability (more logs at the suspicious point, traces) and wait for the next occurrence, or work with the evidence from production. But note down that the cause won't be confirmed until you can trigger the failure and make it go away.
- Gathering evidence: logs, metrics, and traces
Observability is the ability to understand what's happening inside a system from what it emits. Its three classic sources, plus two that are often forgotten:
| Source | What it tells you | Example of a question it answers |
|---|---|---|
| Logs | What happened, event by event, in detail | What did the connector do with order PV-2027-118734? |
| Metrics | How much and with what trend: latencies, errors, volume | When did the ERP's latency start to rise? Is that normal? |
| Traces | A request's path through several services | How many times did the connector call the LogiTrack API in this operation? |
| Change events | Deployments, configuration changes, migrations | What changed just before it started? |
| Business data | The real effect on the database | How many orders are duplicated, and since when? |
Basic command-line tools for searching logs:
# Count the lines that contain a string, per file
grep -c "TimeoutError" connector.log
# See the context: 3 lines before and 3 after each match
grep -B 3 -A 3 "order=PV-2027-118734" connector.log
# Extract only a fragment of each matching line (-o) and count repetitions
grep -o "order=PV-[0-9-]*" connector.log | sort | uniq -c | sort -rn | headExplanation:
grep -c "text" filecounts how many lines contain the text.-B 3 -A 3(before and after) shows the surrounding lines: very useful for seeing what happened just before an error.grep -oprints only the part that matches the pattern (here, the order identifier);sortsorts;uniq -ccounts how many times each value appears (it needs sorted input);sort -rnsorts by that number, from largest to smallest;headshows the first ten.
Two rules about evidence:
- Save the evidence before it disappears. Logs rotate, metrics get aggregated, environments get restarted. Copy whatever is relevant into the investigation notebook.
- Tell what you see apart from what you interpret. "The log shows a TimeoutError at 10:14:32" is evidence; "the ERP went down" is an interpretation that needs to be checked.
- Narrowing it down: what changed and where it happens
Narrowing down means shrinking the space where the cause might be. Two questions do most of the work:
- What changed? Almost every new failure in a system that used to work has a change behind it: a deployment, a configuration, a dependency, a certificate that expired, a data volume that crossed a threshold, a change in an external system. Review the change log for the period just before the first case.
- Where does it happen, and where doesn't it? This is the "Is / Is Not" tool you learned in the "Situation Analysis" lesson, applied to a system: which customers, versions, servers, times, or data types are affected and which ones, although they could be, aren't. The key question is the same: what's different about what fails compared with what doesn't?
In systems, the most useful "Is / Is Not" dimensions are: code version, configuration, environment (production, pre-production, local), customer or tenant, time slot, data type or size, load, and external dependency.
- Divide and conquer: binary search and git bisect
When the search space is large but ordered (a list of commits, a chain of services, a long configuration file), the most efficient technique is binary search: test at the midpoint, discard the half where the failure isn't, and repeat.
| Items to check | Tests needed, one by one (worst case) | Tests with binary search |
|---|---|---|
| 8 | 8 | 3 |
| 24 | 24 | 5 |
| 100 | 100 | 7 |
| 1,000 | 1,000 | 10 |
Examples of binary search in systems:
- In time (commits): the failure wasn't in version 2.3 and it is in 2.4; there are 24 commits between them.
git bisectautomates this. - In space (components): a request goes through five services; you check the data at the third; if it's fine, the failure is in the fourth or the fifth.
- In configuration: you disable half of the new options; if the failure disappears, it's in that half.
git bisect in a nutshell. You tell git about a "good" commit (without the failure) and a "bad" one (with the failure); git takes you to the commit in between; you test and tell it whether it's good or bad; it repeats until it finds the first bad commit:
git bisect start # start a search
git bisect bad v2.4.0 # this version has the failure
git bisect good v2.3.0 # this version doesn't
# git switches to the commit in between; you test and answer:
git bisect good # or: git bisect bad
# ...repeat until git announces "... is the first bad commit"
git bisect reset # go back to the branch you were onEven better, automatically: if you have a script that reproduces the failure, git bisect run ./script runs it at each step. The script must exit with code 0 if the commit is good, with a code between 1 and 127 (except 125) if it's bad, and with 125 if that commit can't be tested (for example, because it doesn't compile).
- One hypothesis and one change at a time
This is the golden rule of troubleshooting, and the one most often broken under pressure:
- One hypothesis at a time. Write down the hypothesis, the prediction ("if it's this, doing X should cause Y"), and the test. It's the same heart of the PDCA cycle you saw in "The Deming Cycle (PDCA)" lesson: a written prediction before testing.
- One change at a time. If you change three things and the failure disappears, you don't know which of the three fixed it, or whether the other two broke something.
- Undo the changes that don't work. A change that doesn't fix anything and is left in place "just in case" becomes a new variable that will confuse the next test.
- Start with the hypotheses that are most likely and cheapest to check, not the most interesting ones.
- Try to refute, not confirm. A test that can only come out "yes" teaches you nothing. Ask yourself what result would prove you wrong (remember confirmation bias from Module 1).
- Checking your assumptions: "Is it plugged in?"
There's a classic joke in IT support: the first question is always "Is it plugged in?" It's a joke, but it contains a truth: many investigations drag on because something is taken for granted that isn't true. Before looking for sophisticated causes, check the basics:
| Assumption that's often taken for granted | How to check it |
|---|---|
| "The version I think is deployed is deployed" | Check the running version, not the one in the repository |
| "There's only one instance running" | Deployment dashboard, instance identifier in the logs |
| "The configuration is the one in the repository" | Read the effective configuration in the environment |
| "The times in the log and the customer's times match" | Check the time zone of each source |
| "The test environment is the same as production" | Compare versions, data, latencies, and configuration |
| "The data I've been given is from the failing case" | Ask for the exact identifier and look it up |
Tip: write the assumptions down in the investigation notebook with a "checked" box. Anything that hasn't been checked is just another hypothesis.
- Documenting as you investigate
An investigation notebook is a chronological record of what you do and what you find: time, action, result, conclusion. It seems like a waste of time in the middle of a failure, and it's exactly the opposite:
- It keeps you from repeating tests that have already been run and ruled out.
- It lets you ask for help without having to explain everything again: the person who joins reads the notebook.
- It's the postmortem timeline ("Blameless Postmortems" lesson), with real timestamps instead of memories.
- It organizes your thinking: writing down the hypothesis and the prediction forces you to phrase them precisely.
A shared document or the ticket itself is enough, updated every time you do something significant. You'll see a complete one in Section 14.
- When to escalate or ask for help
Asking for help in time isn't a weakness: it's part of the method. Some clear signs that the time has come:
| Sign | What to do |
|---|---|
| You've spent a set amount of time (for example, 1-2 hours) without making progress on a hypothesis | Explain the status to someone else; change your approach |
| The impact is growing or affecting more customers | Escalate according to the incident guide; contain if you haven't already |
| You need access, permissions, or knowledge from another team | Ask for it explicitly, with the notebook as context |
| You're trying random things | Stop, go back to the notebook and to narrowing things down |
| You're tired or it's very late | Contain and continue with a fresh head, or hand over with the notebook |
Rubber duck debugging: explaining the problem out loud, step by step, to another person or even to an object (the famous rubber duck). As you put each step into words ("here we create the order, here we mark it in the ERP, and if that fails..."), you very often discover the wrong assumption or the missing detail. It works because it forces you to move from System 1 (what you "know" the code does) to System 2 (what it really does, line by line), as you saw in the "Cognitive Biases and Mental Traps" lesson.
- Closing: root cause, fix, and prevention
A technical incident isn't closed when the symptom disappears, but when four questions can be answered:
- What was the root cause? With its mechanism, explained so that someone who wasn't involved can understand it. And why does this case fail and that one doesn't? If the cause doesn't explain the narrowing down, it isn't the whole cause.
- How has it been fixed? The permanent fix, not just the containment.
- How is it proven? The reproduction that used to fail now passes; the symptom doesn't reappear in production for a reasonable period.
- How do you keep it, or something similar, from happening again? An automated test that detects it, an alert, a barrier in the design. And, if the impact warrants it, a blameless postmortem, with the actions ranked by effectiveness.
- TechSolutions: the duplicate orders in INT-66
The symptom
INT-66 is the ERP integration for an electrical supplies distributor with two warehouses, delivered in June 2027. It was one of the first with a request sent directly to the customer's IT department ("The Deming Cycle (PDCA)" lesson). Its ERP belongs to the ERP-A family, the most common one, and it uses the shared ERP-A connector, which all the customers in that family share, INT-63 among them. Every minute, the connector reads new orders from the ERP, creates them in LogiTrack through its API, and then marks them as exported in the ERP.
On Tuesday, November 2, 2027, at 19:00, version 2.4.0 of the connector is deployed to a first group of five ERP-A customers (it's a gradual rollout: the rest would get it two weeks later): 24 commits since 2.3.0, with logging improvements, a new warehouse field, and automatic retries on calls to the ERP.
On Thursday, November 4, at 11:20, a ticket comes in from INT-66's customer: their warehouse has picked the same order twice, and in LogiTrack "there are repeated orders, especially mid-morning." With continuous triage newly in place, Carmen escalates it to integrations within ten minutes. At 11:45, Nuria takes it on; Raúl joins later.
The first thing Nuria does is turn "repeated orders" into a symptom that can be counted. She asks the platform team to run this query on the LogiTrack database:
SELECT external_ref,
COUNT(*) AS times,
MIN(created_at) AS first_created,
MAX(created_at) AS last_created
FROM orders
WHERE customer_id = 'INT-66'
AND created_at >= '2027-10-01'
GROUP BY external_ref
HAVING COUNT(*) > 1
ORDER BY first_created;Explanation: the query groups INT-66's orders by their external reference (the ERP order number) and keeps only the references that appear more than once (HAVING COUNT(*) > 1). The MIN and MAX of the creation date show when the original and the duplicate were created.
Result: 0 duplicates in October; the first one on Wednesday, November 3, at 11:14 (local time, Spanish mainland); up to that point, 30 duplicated references, never triplicated. One detail stands out: in every case, the duplicate is created about 32 seconds after the original.
Containment
At 12:30, Nuria and Diego assess the damage: the customer's warehouse is picking orders that don't exist, and some have already shipped. The failure started after Tuesday's deployment, and only INT-66 has complained. They decide to contain: roll INT-66 back to version 2.3.0 (with its configuration) and keep an eye on the other four customers. The rollback is done by 16:30.
Meanwhile, Carmen and Nuria call the customer, give them the list of duplicated references, and agree to cancel the duplicates. By the end of the day, the total is 37 duplicate orders in two days, of which 11 were shipped twice. The estimated cost (shipping and returns) is about €640, which TechSolutions covers.
After the rollback, Thursday afternoon and Friday morning go by without a single duplicate. It's strong before/after evidence that version 2.4.0 is involved, but it doesn't explain why.
Evidence and assumptions
Nuria downloads the logs of INT-66's connector since the deployment. An excerpt from the first case she reviews:
2027-11-04T10:14:02.118Z INFO erp-a-connector inst=7f9c INT-66 trace=3be1a0 order=PV-2027-118734 export_order: start 2027-11-04T10:14:02.640Z INFO erp-a-connector inst=7f9c INT-66 trace=3be1a0 order=PV-2027-118734 POST /v2/orders -> 201 id=8841207 2027-11-04T10:14:32.652Z WARN erp-a-connector inst=7f9c INT-66 trace=3be1a0 order=PV-2027-118734 mark_exported: TimeoutError after 30000 ms 2027-11-04T10:14:32.653Z WARN erp-a-connector inst=7f9c INT-66 trace=3be1a0 order=PV-2027-118734 retry 1/3 of export_order in 2 s 2027-11-04T10:14:34.701Z INFO erp-a-connector inst=7f9c INT-66 trace=3be1a0 order=PV-2027-118734 POST /v2/orders -> 201 id=8841311 2027-11-04T10:14:41.210Z INFO erp-a-connector inst=7f9c INT-66 trace=3be1a0 order=PV-2027-118734 mark_exported -> 200 (6.5 s)
How to read the excerpt: each line has the time in UTC (the trailing Z), the level (INFO, WARN), the service, the instance (inst=7f9c), the customer, the trace identifier, and the order. The sequence tells a story: the connector creates the order in LogiTrack (response 201, id 8841207); it tries to mark it as exported in the ERP; after 30 seconds without a response, it gets a TimeoutError; two seconds later, it retries the entire export; it creates the order again (id 8841311, a duplicate), and this time the marking responds in 6.5 seconds. The 32 seconds between the original and the duplicate are 30 of timeout plus 2 of waiting.
Before building on that story, Raúl insists on checking the assumptions:
- Time zone. The customer said "mid-morning, around 11"; the logs are in UTC. In November, Spanish mainland time is UTC+1. Raúl had first searched between 11:00 and 12:00 UTC without finding anything and lost twenty minutes. Noted in the notebook.
- A single instance? The deployment dashboard shows one connector instance for INT-66, and both creations of the same order carry the same identifier,
inst=7f9c. Two connectors reading at the same time is ruled out. - Deployed version? The status endpoint of INT-66's connector confirmed 2.4.0 until the rollback.
Next, Nuria quantifies things from the command line:
# 1. How many timeouts when marking as exported were there each day?
grep -c "mark_exported: TimeoutError" erp-a-connector-INT66-2027-11-0[2-4].log
# 2. List of orders created more than once in LogiTrack (according to the log)
grep -h "POST /v2/orders -> 201" erp-a-connector-INT66-2027-11-0[3-4].log \
| grep -o "order=PV-[0-9-]*" | sort | uniq -c \
| awk '$1 > 1 {print $2}' > duplicates.txt
wc -l < duplicates.txt
# 3. List of orders with a timeout when marking
grep -h "mark_exported: TimeoutError" erp-a-connector-INT66-2027-11-0[3-4].log \
| grep -o "order=PV-[0-9-]*" | sort -u > with_timeout.txt
# 4. How many duplicates had a timeout when marking beforehand?
comm -12 duplicates.txt with_timeout.txt | wc -lExplanation of each command:
grep -cwith a file pattern (0[2-4]covers the 2nd, 3rd, and 4th) counts the marking timeouts in each file. Result: the 2nd, 0; the 3rd, 21; the 4th, 16. Total: 37.- It takes the successful creation lines (
201), extracts the order identifier, sorts, and counts withuniq -c.awk '$1 > 1 {print $2}'keeps the orders whose count (first column) is greater than 1 and prints only the identifier (second column).wc -l < duplicates.txtcounts the lines: 37, the same as the database query (which, by the end of Thursday, also returned 37). - The same for the orders with a timeout;
sort -usorts and removes duplicates. comm -12compares two sorted files and shows only the lines they have in common (the-12suppresses the columns of lines unique to each file). Result: 37 out of 37. Every duplicate had a marking timeout, and every marking timeout produced a duplicate.
Raúl adds two pieces of evidence from other sources:
- Metrics: the p95 latency of INT-66's ERP API is 1.2 seconds for most of the day, but it rises to between 35 and 90 seconds from 11:00 to 12:30 and from 18:00 to 19:00 (local time), when the customer's ERP runs its batch processes. That pattern already existed in October. For the other four ERP-A customers, p95 latency never exceeds 4 seconds.
- Traces: trace
3be1a0shows twoPOST /v2/orderscalls to the LogiTrack API within the same export operation.
Narrowing it down
With all this, Nuria and Raúl write a short "Is / Is Not," without going into the details of the method:
| Dimension | Is | Is not, although it could be | What sets it apart |
|---|---|---|---|
| Customer | INT-66 | The other 4 customers on 2.4.0 (INT-63 included) | INT-66's ERP takes up to 90 s during its batch processes |
| Version | 2.4.0, since November 3 | 2.3.0 (October, and after the rollback) | Change between versions |
| Time | 11:00-12:30 and 18:00-19:00 | The rest of the day | The ERP's batch process time slots |
| Operation | Orders with a timeout when marking | Orders marked quickly; timeouts when reading orders (4, no duplicates) | It only affects the operation that creates data |
Explanation: the last row is particularly subtle. During those days, there were also 4 timeouts when reading the list of pending orders, and none of them produced duplicates: reading can be repeated with no side effects. The problem only appears when an operation that creates something is repeated. The narrowing down points to a mechanism: something in 2.4.0 makes a timeout during marking trigger a second creation, and it only shows up where the ERP takes more than 30 seconds.
Hypotheses, one at a time
The notebook records three hypotheses, checked in order of likelihood and cost:
| Hypothesis | Prediction if it were true | Test | Result |
|---|---|---|---|
| H1. The ERP returns the order twice (it shows up as pending again on the next read, every minute) | Duplicates would appear at least 60 s after the original, at varying intervals, and the ERP would show a second read | Times between original and duplicate; ERP export log (the customer's IT department provides it to Raúl within an hour) | Refuted: always about 32 s; a single read per order in the ERP |
| H2. Two connector instances process the same orders | Different instance identifiers on the original and the duplicate | Deployment dashboard and the log's inst field |
Refuted: one instance, the same inst |
| H3. The automatic retry in 2.4.0 repeats the creation when marking exceeds the timeout | With an ERP that's slow only at marking, 2.4.0 duplicates and 2.3.0 doesn't | Reproduction in pre-production with an ERP simulator that takes 40 s to mark | Confirmed: 2.4.0, 5 out of 5 orders duplicated; 2.3.0, 0 out of 5 |
Explanation: notice that H1 and H2 were reasonable hypotheses and, above all, cheap to refute. Each one had a different prediction from H3 (the 60 seconds, the different instance), which is why they could be ruled out with data that was already available. And in the reproduction, only one thing was changed compared with a normal environment: the marking latency.
Binary search with git bisect
The reproduction confirms that the problem lies between 2.3.0 and 2.4.0, but there are 24 commits. Raúl turns the reproduction into a script:
#!/usr/bin/env bash
# tests/repro_duplicates.sh
# Reproduces the duplicates: the ERP simulator takes 40 s to "mark exported".
# Exit: 0 = no duplicates (good commit), 1 = duplicates (bad commit),
# 125 = this commit can't be tested (for example, it doesn't compile).
set -u
make build > /dev/null 2>&1 || exit 125
./erp-simulator --mark-latency=40s --orders=5 &
SIM=$!
./erp-a-connector --config tests/int66-local.yaml --single-pass
kill "$SIM"
DUP=$(./tests/count_duplicates.sh)
echo "Duplicates: $DUP of 5 orders"
[ "$DUP" -eq 0 ]Line-by-line explanation:
#!/usr/bin/env bashindicates that the script runs with bash.set -umakes the script fail if an undefined variable is used, to avoid misleading results.make build ... || exit 125compiles the connector.> /dev/null 2>&1hides its output. If the build fails,||runsexit 125: it tellsgit bisectthat this commit can't be evaluated and should be skipped../erp-simulator --mark-latency=40s --orders=5 &starts a simulated ERP that offers 5 orders and takes 40 seconds to respond to the marking; the&leaves it running in the background.SIM=$!stores its process ID../erp-a-connector ... --single-passruns the connector just once against the simulator.kill "$SIM"stops the simulator.DUP=$(...)stores in a variable the number of duplicates counted by another helper script.[ "$DUP" -eq 0 ]is the last command: it returns 0 (success) if there are no duplicates and 1 if there are. Since it's the last one, its result is the script's exit code, which is exactly whatgit bisect runneeds.
And he runs the search:
git bisect start
git bisect bad v2.4.0
git bisect good v2.3.0
git bisect run ./tests/repro_duplicates.shOutput (abridged):
Bisecting: 11 revisions left to test after this (roughly 4 steps)
running './tests/repro_duplicates.sh'
Duplicates: 0 of 5 orders
Bisecting: 5 revisions left to test after this (roughly 3 steps)
running './tests/repro_duplicates.sh'
Duplicates: 5 of 5 orders
Bisecting: 2 revisions left to test after this (roughly 2 steps)
running './tests/repro_duplicates.sh'
Duplicates: 0 of 5 orders
Bisecting: 0 revisions left to test after this (roughly 1 step)
running './tests/repro_duplicates.sh'
Duplicates: 5 of 5 orders
a41c9e2 is the first bad commit
Automatic retries on ERP calls and 30 s timeoutExplanation: in four tests (about 12 minutes, because each one waits for the simulated latency), git has found commit a41c9e2 among 24 candidates. Raúl finishes with git bisect reset to go back to his branch and reviews the change with git show a41c9e2.
The rubber duck
With the commit in front of her, Nuria explains it to Raúl out loud, line by line. The change was small:
@retry(attempts=3, wait_s=2, on=(TimeoutError, ConnectionError))
def export_order(erp_order):
order = convert(erp_order)
logitrack.create_order(order) # 1. creates the order in LogiTrack
erp.mark_exported(erp_order.id, timeout_s=30) # 2. marks it in the ERP (before: 60 s)"We convert the order, create it in LogiTrack, mark it in the ERP... and the @retry decorator wraps the whole function. If the marking times out, it retries from the start... and creates the order again." Nuria goes quiet for a second. The commit had added the decorator with the ERP calls in mind, since those are the ones that fail; nobody noticed that the function also contained the creation in LogiTrack, which isn't idempotent: every call creates a new order. And the same commit had lowered the marking timeout from 60 to 30 seconds, below the latency of INT-66's ERP during its batch processes.
Explanation: an operation is idempotent when repeating it produces the same result as doing it once (reading a piece of data, marking something as exported). Retrying idempotent operations is safe; retrying ones that aren't (creating an order, charging a payment, sending an email) produces duplicates, unless they're given an idempotency key that lets the receiver recognize it has already processed them. The LogiTrack API has accepted that key since 2026, but the connector never sent it: until 2.4.0 there were no retries, and nobody missed it.
Root cause, fix, and prevention
Root cause: creating the order in LogiTrack wasn't idempotent (the connector didn't send an idempotency key), and version 2.4.0 added an automatic retry that wrapped the entire export, so a timeout during marking also repeated the creation.
Why only INT-66: the same commit reduced the marking timeout to 30 seconds, and only INT-66's ERP exceeds that latency (up to 90 seconds during its batch processes). For the other four customers, the timeout is never reached: the defect was there, but dormant.
Factors that made it possible: the ERP simulator used in the automated tests responds in milliseconds (no tests with latency); the code review saw a "harmless" decorator without looking at what it wrapped; and there was no alert for duplicate orders, so the customer detected it, about 24 hours after the first case.
Fix (version 2.4.1, deployed on Tuesday, November 9, to all ERP-A customers):
def export_order(erp_order):
order = convert(erp_order)
logitrack.create_order(order, idempotency_key=erp_order.reference)
mark_exported_with_retries(erp_order.id) # only the marking is retriedExplanation: the creation now sends the order's ERP reference as the idempotency key; if it's repeated, LogiTrack returns the order that was already created instead of creating another one. The retry is applied only to the marking, which is idempotent. In addition, the timeout becomes configurable per customer (90 seconds for INT-66).
Prevention:
| Action | Type | Owner | Date |
|---|---|---|---|
| Unique constraint per customer and external reference in LogiTrack's orders table | Eliminates the failure for any connector | Platform team | Nov 30, 2027 |
| Automated test with simulated ERP latency (the reproduction script, adapted) | Detection before production | Raúl | Nov 19, 2027 |
| Daily alert for duplicate references across all integrations | Detection in production | Nuria | Nov 16, 2027 |
| Review the ERP-B connector and the store connectors for the same pattern | Prevention | Diego | Nov 26, 2027 |
| Question in code review: "Does this retry something that isn't idempotent?" | Review aid | Diego | Nov 16, 2027 |
The review of the ERP-B connector found the same decorator wrapping a creation; it hadn't shown up because its ERPs respond quickly. It was fixed before it surfaced.
Since a customer detected the failure, a short blameless postmortem is held on November 12, following the rule from the "Blameless Postmortems" lesson. The person who wrote the commit takes part and explains why the change made sense: another customer's ERP had had brief outages, and retries would have avoided them. Nobody asks them "Why didn't you test it?", but rather "What would have helped you see that the function was creating data?"
Total duration: from the ticket (Thursday 11:20) to the confirmed cause (Friday 13:10), a little under two working days, with containment done in five hours.
The investigation notebook
This is how Nuria's notebook ended up, and it served as the timeline for the postmortem:
# Investigation: duplicate orders in INT-66
Owner: Nuria · Support: Raúl · Ticket: received Thu Nov 4 11:20
Symptom: two records in LogiTrack with the same external reference and the same
customer (INT-66). Expected: one per reference.
Impact: 37 duplicates (Nov 3-4), 11 shipped twice, ~€640.
## Assumptions
- [x] Running version: 2.4.0 until the rollback (status endpoint)
- [x] A single connector instance (dashboard + inst field)
- [x] Time zone: logs in UTC; customer on Spanish mainland time (UTC+1)
## Timeline (local time)
| Time | Action | Result / conclusion |
|-------------|------------------------------------------------|-------------------------------------------------|
| Thu 11:45 | Pick up the ticket; request duplicates query | 30 duplicates since Nov 3; 0 in October |
| Thu 12:05 | Compare original/duplicate times | Always ~32 s. Note: 30 s timeout + 2 s? |
| Thu 12:30 | Decision with Diego: roll INT-66 back to 2.3.0 | Containment approved |
| Thu 12:40 | Search logs 11:00-12:00 UTC | Nothing. MY MISTAKE: customer uses local time |
| Thu 13:00 | Search 10:00-11:30 UTC | Marking timeout + retry before every dup |
| Thu 13:30 | 2 h without reproducing: ask Raúl, ask traces | Raúl joins; platform grants trace access |
| Thu 16:30 | Rollback done | Thursday afternoon: 0 duplicates |
| Thu 17:10 | H2 (two instances) | Refuted: one instance, same inst |
| Fri 09:30 | H1 (ERP returns it twice) | Refuted: fixed 32 s; one read in the ERP |
| Fri 10:15 | grep/comm: duplicates vs timeouts | 37 of 37. Timeouts on read: 4, no duplicates |
| Fri 11:20 | H3: reproduction with 40 s latency | 2.4.0: 5/5 duplicates; 2.3.0: 0/5. Confirmed |
| Fri 12:40 | git bisect run (4 steps) | First bad commit: a41c9e2 |
| Fri 13:10 | Read the commit aloud with Raúl | Retry wraps the creation, not idempotent |
## Root cause
Non-idempotent creation + retry wrapping the entire export (2.4.0).
Only INT-66: 30 s timeout shorter than its ERP's latency during batches.
## Fix and prevention
2.4.1 (Nov 9): idempotency key, retry only on marking, timeout per
customer. Prevention actions in the Nov 12 postmortem.Explanation: notice three details. The notebook also records your own mistakes ("MY MISTAKE: customer uses local time"), without drama: they're useful information for next time. It records when help was requested and why (2 hours without reproducing). And every row has a result, even if it's "nothing": that way, nobody repeats a search that's already been done.
- Investigation notebook template
# Investigation: [short title of the symptom]
Owner: [ ] · Support: [ ] · Source: [ticket, alert...] · Start: [date and time]
## 1. Symptom
- What exactly is observed:
- What was expected:
- Where (customer, service, version, environment):
- Since when, and how often:
- Operational definition (query, grep, or rule that identifies a case):
- Impact:
## 2. Containment
- Is there ongoing damage? [yes/no] · Measure: [ ] · Done at: [ ]
- Effect observed after containment:
## 3. Assumptions (check off once verified)
- [ ] Running version:
- [ ] Number of instances:
- [ ] Effective configuration:
- [ ] Time zones of the sources:
- [ ] Test environment comparable with production in: [ ]
## 4. Evidence saved
| Source (logs, metrics, traces, changes, data) | What it shows | Where the copy is |
|-----------------------------------------------|---------------|-------------------|
## 5. Narrowing down (Is / Is Not)
| Dimension | Is | Is not, although it could be | What sets it apart |
|-----------|----|------------------------------|--------------------|
Recent changes in the period before the first case:
## 6. Hypotheses (one at a time)
| Hypothesis | Prediction if it were true | Test | Result |
|------------|----------------------------|------|--------|
## 7. Timeline
| Time | Action | Result / conclusion |
|------|--------|---------------------|
Time limit without progress before asking for help: [ ] h
## 8. Closure
- Root cause (mechanism):
- Does it explain why it fails here and not there? [yes/no]
- Permanent fix and how it's proven:
- Prevention (action, type, owner, date):
- Postmortem? [yes/no; why]How to use the template:
- Open it in the first minute, not at the end. Its value lies in writing while you investigate.
- Section 1: if you can't write the operational definition, you don't yet know what you're looking for.
- Section 3: every unchecked assumption is a hidden hypothesis.
- Section 6: writing down the prediction before testing is what turns a test into an experiment.
- Section 7: the time limit, decided in advance, makes asking for help a rule and not a matter of pride.
- Section 8: the question "Does it explain why it fails here and not there?" is the final check: a cause that doesn't explain the narrowing down is incomplete.
Common Mistakes and Tips
- Starting to change things before defining the symptom. Ten minutes spent writing down what's observed, where, and since when save hours.
- Investigating while the damage continues. If data is being corrupted or customers are affected, contain first.
- Confusing containment with a solution. The rollback made the duplicates disappear, but the defect was still in the code, dormant for the other four customers in the first group, waiting to reach the rest of the ERP-A customers, and also present in the ERP-B connector.
- Changing several things at once. If the failure disappears, you won't know why. One change, one test, and undo whatever doesn't work.
- Looking only for tests that confirm. Design tests that can refute your hypothesis, as Nuria and Raúl did with H1 and H2.
- Not checking the obvious. Version, instances, configuration, time zone. Raúl lost twenty minutes because of a time zone.
- Ignoring the narrowing down. "Why here and not there?" is the question that gets you closest to the cause.
- Reviewing commits one by one. With 24 commits, binary search needs 5 tests at most. Automate the reproduction and use
git bisect run. - Not documenting. Without a notebook, you'll repeat searches, you won't be able to ask for help with context, and the postmortem will depend on memory.
- Asking for help too late. Set a time limit without progress and stick to it.
- Closing without prevention. If there's no test, alert, or barrier, the same failure, or another one from the same family, will come back.
- Tip: when you find the cause, ask yourself where else the same pattern might be. The review of the ERP-B connector prevented the next incident.
Exercises
Exercise 1: From vague symptom to precise symptom
Rewrite each symptom as in Section 3 (what's observed, what was expected, where, since when, impact) and state which operational definition you'd use to count the cases. Make up any missing data consistently.
- "LogiTrack's mobile app for delivery drivers has been terrible since the last version."
- "Notifications to shoppers sometimes don't arrive."
- "The game hangs on some computers."
Exercise 2: Planning a binary search
Since Monday's release, LogiTrack's shipment tracking page takes 4 seconds to load instead of 1. The release included 57 commits. (a) How many tests would you need at most with git bisect? (b) Write the sequence of commands to do it automatically, assuming you have a measure_load.sh script that prints the load time in milliseconds. (c) What should the script return for git bisect run to work? (d) Before starting the bisect, which assumptions would you check?
Exercise 3: Ranking hypotheses
A LogiTrack service that generates shipping labels has been returning 500 errors on 3% of requests since Wednesday. The "Is / Is Not" shows: it's only with one carrier (out of five); it's only with labels for packages over 30 kg; it started on Wednesday; there were no TechSolutions deployments that week. Propose three hypotheses, rank them by likelihood and cost of checking, and write the prediction and the test for each one.
Solutions
Exercise 1
- What: the app crashes when opening the route map screen. Expected: the map opens. Where: version 5.2.0, only on Android 12 and earlier (not on Android 13 and 14). Since when: since 5.2.0 was published on the 8th; 18% of sessions with the map end in a crash. Impact: drivers can't see their route and call their depot. Operational definition: sessions with an "open map" event followed by an unexpected crash report within 10 seconds, by version and operating system. Common mistake: stopping at "it's terrible" without separating crashes, slowness, and battery drain, which are different symptoms with different causes.
- What: "order shipped" notifications that aren't delivered to the shopper. Expected: notification within 5 minutes. Where: email only, not SMS; mostly to domains from one specific email provider. Since when: for the last 10 days; 7% of emails aren't recorded as delivered. Impact: more inquiries from shoppers to the stores. Operational definition: notifications with "sent" status in LogiTrack without a "delivered" event from the email provider within 30 minutes.
- What: the game freezes (the image stops; it doesn't crash) when loading level 4. Expected: loads in less than 20 seconds. Where: computers with 8 GB of RAM or less; it doesn't happen with 16 GB. Since when: since patch 1.3, which added new textures to that level. Impact: 9% of level 4 games are abandoned. Operational definition: sessions with no frames rendered for more than 30 seconds while loading level 4. Notice that the narrowing down (memory) already suggests a hypothesis, but it's still a hypothesis.
Exercise 2
- (a) With 57 commits, about 6 tests (2^6 = 64 ≥ 57).
- (b) You need a script that turns the measurement into a good or bad result, for example
tests/load_ok.sh:
#!/usr/bin/env bash
# Good (0) if the page loads in under 2,000 ms; bad (1) if it takes longer
make build > /dev/null 2>&1 || exit 125
MS=$(./measure_load.sh)
echo "Load: $MS ms"
[ "$MS" -lt 2000 ]git bisect start
git bisect bad HEAD # or the tag for Monday's release
git bisect good previous-release
git bisect run ./tests/load_ok.sh
git bisect reset- (c) Code 0 if the commit is good (fast load), 1 if it's bad (slow load), and 125 if it can't be tested. An important detail: the threshold (2,000 ms) must be well away from the measurement noise (if the normal load time ranges between 0.8 and 1.4 seconds, 2 seconds is a good cutoff); otherwise, the bisect will give contradictory results. It's a good idea to measure several times and use the median.
- (d) That the slowness also shows up in the test environment (if not, the bisect won't help); that the previous release really is fast in that environment; that nothing else has changed at the same time (data, infrastructure, an external service); that you're measuring the same thing users see. Common mistake: launching the bisect without checking the "good" commit and finding out at the end that it was slow too.
Exercise 3
| Rank | Hypothesis | Prediction | Test |
|---|---|---|---|
| 1 | The carrier has changed its API (for example, a new limit or format for heavy packages) | Since Wednesday, the carrier's responses for packages over 30 kg come back with an error or a new format; our service turns it into a 500 | Review the logs of the calls to the carrier and its changelog or announcements; reproduce a 31 kg request against its test environment |
| 2 | A configuration or data change on our side (rates, weight tables) went in on Wednesday without a code deployment | There's a change recorded on Wednesday in that carrier's configuration or tables | Review the configuration and master data history for that carrier |
| 3 | A certificate or credential specific to that carrier has partially expired | Authentication errors in the logs, not validation errors | Look in the logs for the exact type of error the carrier returns |
Explanation of the order: the narrowing down ("only one carrier," "only over 30 kg," "no deployments of ours") points outside TechSolutions' code: the most likely explanation is a change at the carrier or in the configuration. Hypothesis 1 is the most likely and the cheapest (reading logs). Number 3 fits less well with "only over 30 kg," which is why it goes last. Checking assumptions: "there were no deployments" needs to be verified (what about configuration changes? and dependencies that update themselves?). Common mistake: starting by reviewing the label service's code, when the narrowing down indicates that the change isn't there.
Conclusion
In this lesson, you've learned a disciplined method for technical problems. You've seen that systematic troubleshooting is the technical version of the problem-solving process, with the advantage that experiments are cheap; that it starts with a precise symptom with an operational definition and, if there's ongoing damage, with containment that isn't mistaken for the solution; that reproducing the failure speeds up everything else; that logs, metrics, traces, change events, and business data are the sources of evidence, and that it's worth saving them and telling what you see apart from what you interpret; that narrowing down with "What changed?" and "Why here and not there?" gets you much closer to the cause; that binary search and git bisect find one change among dozens in just a few tests; that you need to move forward with one hypothesis, one change, and one test at a time, trying to refute and checking the most obvious assumptions; that an investigation notebook keeps you from repeating work and becomes the postmortem timeline; that asking for help in time, and explaining the problem out loud, is part of the method; and that an incident is only closed with a root cause, a proven fix, and prevention. At TechSolutions, Nuria and Raúl went from "repeated orders mid-morning" to a retry that was repeating a non-idempotent creation, explained why only INT-66 was failing, fixed the connector, strengthened the platform for all connectors, and found the same defect lying dormant in the ERP-B connector before it surfaced.
With this lesson, you complete Module 7, "Advanced Tools and Techniques." In it, you've taken a deep dive into seven tools that you had only seen in passing in the rest of the course, each with its place in the process: SWOT and the TOWS matrix for looking at the overall situation and deciding what to tackle; the Ishikawa diagram for looking for causes in every direction and verifying them with data; the Six Thinking Hats for talking things through and deciding as a group without turning the meeting into a tug-of-war; Pareto analysis for separating the vital few from the trivial many, by frequency and by cost; logic trees and the MECE principle for breaking down problems and metrics with no overlaps or gaps; systems thinking for seeing the loops, delays, and archetypes that make some problems persist; and systematic troubleshooting for solving technical failures methodically. Along the way, the way of working of Laura's group has spread to other areas of TechSolutions: the 2028 integrations plan, support response time, the tracking page, the margin on ERP integrations, and a technical incident in a connector. You now have the complete process and the toolbox. In Module 8, "Case Studies and Exercises," you'll put them to work together on complete cases, starting with "Case Study 1: Delivery Delays," where you'll go through the problem that has run through the entire course from start to finish, this time deciding for yourself at each phase which tool to use and why.
Problem Solving Course
Module 1: Introduction to Problem Solving
- Definition and Types of Problems
- Why Problem Solving Matters
- Key Problem-Solving Skills
- The Problem-Solving Process: An Overview
- Cognitive Biases and Mental Traps
Module 2: Problem Identification
- Recognizing Problems
- Collecting Data and Evidence
- Situation Analysis
- Framing Problems
- Prioritizing Problems
Module 3: Generating Solutions
- Cause and Effect Analysis
- Brainstorming Techniques
- Creative and Lateral Thinking
- Evaluating Options: From Long List to Shortlist
Module 4: Evaluating and Selecting Solutions
- Evaluation Criteria
- Selection Methods
- Risk Analysis
- Deciding with Incomplete Information
- Team Decision-Making
Module 5: Implementing Solutions
- Implementation Planning
- Pilots and Controlled Experiments
- Change Management
- Stakeholder Communication
- Monitoring and Evaluation
Module 6: Continuous Improvement
- The Deming Cycle (PDCA)
- Feedback and Adjustments
- Documentation and Lessons Learned
- Blameless Postmortems
Module 7: Advanced Tools and Techniques
- SWOT Analysis
- The Ishikawa Diagram
- The Six Thinking Hats Method
- Pareto Analysis
- Logic Trees and the MECE Principle
- Systems Thinking
- Troubleshooting: A Systematic Method for Technical Problems
Module 8: Case Studies and Exercises
- Case Study 1: Delivery Delays
- Case Study 2: Production Bugs
- Case Study 3: Friction Between Teams
- Practical Exercises
