Intermittent 502s After a Release: Why One Answer Is the Wrong Answer
“Our API started returning intermittent 502 errors after yesterday’s deployment.” It’s tempting to blame the deployment. TicketResolve’s root-cause engine lists every plausible cause with a probability, runs the read-only diagnostic that best tells them apart, updates and repeats, treats failed checks as non-evidence, and doesn’t call anything the root cause until a person confirms it.

"Our API started returning intermittent 502 errors after yesterday's deployment."
It's tempting to read that sentence and blame the deployment. Sometimes that's right. But a 502 means a proxy didn't get a good answer from what's behind it, and there are plenty of ways for that to happen: a regression in the release, a proxy or load-balancer setting, a service crashing behind the proxy, a database running out of connections, too much traffic, a third-party dependency failing, or the network. An experienced engineer keeps all of them in mind and goes looking for whatever tells them apart.
Here's what happens when nobody does. At a company that runs a booking API, that exact sentence arrives on a Wednesday. The on-call engineer rolls back yesterday's release. The 502s continue. She rolls it forward again and raises the load balancer's timeout. Fewer 502s, slower responses. On Thursday, someone notices the database's connection count is at its limit: the release added a code path that opens a connection per request and doesn't close it, but the rollback hadn't helped because a migration had already changed the connection settings. Two days, three wrong fixes, one right answer that required looking at several explanations together.
That's what the Root cause tab on every investigation does.
First, the basics
- A 502 (Bad Gateway) means a proxy or load balancer got a bad answer from the service behind it.
- A hypothesis is a possible explanation; a probability says how likely it currently seems.
- "Something not on this list" is kept as a small probability so the engine never sounds surer than it is.
- A diagnostic is a read-only check; it's chosen for how well it separates hypotheses, for what it costs.
- An experiment record says what was tested, what each hypothesis predicted, what was found, and probabilities before and after.
- "Consistent with" means every explanation predicts that result, so it barely helps.
- An allowlist is the set of hosts an admin has approved for endpoint checks.
- Calibration compares the engine's probabilities with how often it turned out right.
Why does this matter? Jumping to the first explanation wastes time and can make things worse. Keeping every plausible cause in play, testing what tells them apart, and stopping honestly when the evidence runs out, gets to the right answer faster and shows the work.
The problem, in plain terms
- The first explanation gets acted on.
- Checks follow a fixed list, not the evidence.
- Failed checks are read as "no problem".
- Investigations restart when new information arrives.
- Tools name a cause without a person confirming it.
Every explanation, with a probability
The engine starts from the problem as the customer stated it: the symptoms, what they expected and what happened, the error messages, when it started, their environment, and whether it's one user or everyone. Then it lists every plausible explanation with a probability. "After the deployment" makes a regression more likely, but not certain. "Intermittent" makes capacity and upstream instability more likely. A little probability is always kept for "something not on this list", so the engine never sounds surer than it is.
If your team has confirmed or ruled out causes before, those decisions set the starting probabilities for your workspace. If there aren't enough decisions yet, they don't.
The next most useful check
Then it picks the read-only diagnostic that would best separate the remaining explanations, for what it costs. It compares errors before and after the release, lists configuration changes, classifies the error signatures, checks database latency against its usual level, looks at CPU, memory, traffic and containers, reads synthetic checks, counts who else is affected, and compares with past cases your team confirmed. After each result it updates the probabilities and picks again. It doesn't follow a fixed checklist: once the evidence points one way, the plan changes with it.
Every diagnostic is recorded as an experiment: what it tested, what we'd expect if the hypothesis were true and if it weren't, what it found, and the probabilities before and after. A result that every explanation predicts ("consistent with") barely moves anything. Only a result that tells explanations apart counts.
Failure is not evidence
If a diagnostic can't run (the source isn't connected, the policy doesn't allow it, there's nothing to check, or the tool timed out), that's recorded for what it is. It never counts as evidence about the customer's problem, and it isn't repeated. A tool failure is retried once, later. If TicketResolve's own monitoring connection is failing, the investigation says the evidence may be incomplete instead of reading silence as "no problem".
Endpoint checks (DNS, connection, certificate and an HTTP request) only go to hosts your admin has allowlisted, and by default a person approves each one. Nothing runs shell commands, and nothing changes your systems.
Knowing when to stop
The engine stops in one of three ways:
- one explanation is strongly supported;
- nothing you've connected can tell the remaining ones apart, so it lists the questions to ask the customer;
- it reaches its step budget.
When the customer replies or new evidence arrives, it carries on from where it stopped instead of starting over.
In our 502 example, the release brought a new "too many connections" error and database latency at seven times its usual level. The engine ends up with two linked explanations: a database connection problem that is likely a consequence of the release. It doesn't pick one and call it done.
People decide
The engine never confirms a root cause by itself. Your engineers confirm or rule out hypotheses, add evidence or their own hypothesis, approve or reject diagnostics, and ask for more investigation. Over time, their verdicts show how often the engine's leading explanation turns out right at a given probability. That's the calibration you see next to it, and it's measured from your own cases, not claimed.
A worked example, start to finish
Here's the booking API's Wednesday, with the Root cause tab. The details are illustrative.
09:00, starting probabilities. From the customer's words (intermittent, after yesterday's deployment, everyone): regression 30%, database 15%, capacity 15%, proxy setting 10%, crash behind proxy 10%, third party 8%, network 7%, something not on this list 5%. Starting points shaped by the team's past confirmed cases.
09:01, diagnostic 1: errors before and after the release. Chosen because it separates regression from almost everything else cheaply. Result: a new error signature, too many connections, appears only after the release. Regression ↑ to 45%; database ↑ to 30%; network and third party ↓.
09:02, diagnostic 2: database latency against its usual level. Seven times normal. Database ↑ to 50%; regression stays high: the two are linked.
09:03, diagnostic 3: configuration changes. A migration in the release changed max_connections handling. Recorded as an experiment: expected if regression: a related config change; found: yes.
09:04, diagnostic 4: synthetic checks. Not connected for this service. Recorded as can't run: not evidence, not repeated.
09:05, stop. One explanation is strongly supported: a database connection problem that is likely a consequence of the release. Two linked hypotheses, not one forced answer.
09:10, people decide. The on-call engineer reads the four experiment records. She confirms both: the release's new code path leaks connections, and the migration made the limit easier to hit. She doesn't roll back blindly; she ships a fix for the leak and adjusts the limit, both reviewed.
09:40. 502s stop. Her verdict adds to the workspace's calibration: next time, the engine's starting probabilities and its stated confidence are checked against cases like this one.
Five more real-world scenarios
1. Nothing can tell them apart
Situation. Two explanations remain, and no connected source separates them.
How TR handles it. The engine stops and lists the questions to ask the customer.
2. The customer replies
Situation. The customer adds that it only happens on mobile.
How TR handles it. The engine carries on from where it stopped.
3. A monitoring outage
Situation. TicketResolve's own monitoring connection is failing.
How TR handles it. The investigation says the evidence may be incomplete, instead of reading silence as "no problem".
4. An endpoint check
Situation. The next useful diagnostic checks the customer's API endpoint.
How TR handles it. Only allowlisted hosts, and by default a person approves it.
5. A new workspace
Situation. There aren't enough past decisions yet.
How TR handles it. Past decisions don't set starting probabilities until there are enough.
Before and after
Before. A rollback that didn't help, a timeout raised to hide the symptom, and two days to find a database connection leak.
After. Every plausible cause with a probability, four diagnostics chosen for what they'd tell apart, a missing source recorded as not evidence, two linked explanations, and a person confirming the cause within ten minutes.
How to tell it's working
- Fewer "fixes" applied before the cause is known.
- Investigations stop honestly with questions when evidence runs out.
- Calibration shows the engine's probabilities match reality.
Who it's for
- On-call engineers and SREs.
- Support engineers investigating technical tickets.
- Engineering leads who want to see how a conclusion was reached.
How it fits with the rest of TicketResolve
The Root cause tab sits on every investigation. It's extended by deeper diagnostics, the service dependency graph, novel-issue handling, the evidence graph and engine evaluation.
Why "consistent with" barely counts
If every explanation predicts a result, seeing it tells you nothing about which one is true. "The error rate went up" is consistent with all eight explanations for a 502, so it barely moves the probabilities. "A new error signature appeared only after the release" is predicted by some explanations and not others, so it moves them a lot. That's how the engine picks its next diagnostic: by how much the possible results would separate what's still in play.
Mistakes to avoid
- Acting on the first explanation.
- Reading a failed check as a clean result.
- Expecting the engine to confirm a cause by itself.
Do it in TicketResolve, step by step
Where: the investigation's Root cause tab (/dashboard/investigate). You'll need: telemetry and deployments connected; an admin to allowlist hosts for endpoint checks. Full guides: TR Investigate: from a ticket to a verified fix and How the investigation engine works.
- Open the Root cause tab. Read the hypotheses and their probabilities.
- Follow each diagnostic: what it tested, expectations, result, probabilities before and after.
- Note checks that couldn't run. They're not evidence.
- Approve endpoint checks to allowlisted hosts if needed.
- Read why it stopped: strong support, questions for the customer, or step budget.
- Confirm or rule out hypotheses, add evidence, or ask for more investigation.
- Check calibration next to the leading explanation.
How to check it worked: every diagnostic shows its experiment record, and the root cause is confirmed only by a person.
Frequently asked questions
Does the engine pick one cause? It lists every plausible one with a probability and keeps some for "something not on this list".
How does it choose the next check? The read-only diagnostic that best separates the remaining explanations, for what it costs.
What if a check fails? It's recorded as not run, never as evidence, and retried once later for tool failures.
Can it change our systems? No. Nothing runs shell commands or changes your systems.
Where do endpoint checks go? Only to allowlisted hosts, approved by a person by default.
When does it stop? When one explanation is strongly supported, when nothing can tell the rest apart, or at its step budget.
Does it start over when the customer replies? No. It carries on from where it stopped.
Who confirms the root cause? A person. The engine never does.
Explore Topics
Written by
Ghulam Shabbir
Content creator and writer sharing insights and stories.


