writing

Lessons from Bad Debugging: When the Chart Says 13 but the Data Says 14

15 Aug 2026 -- debugging, post-mortem, data, humility

Lessons from Bad Debugging

The Symptom

A candlestick chart showed August 13 when the real data was August 14. All 961 symbols for the 14th had been ingested successfully — the previous load proved it end-to-end. The chart was the thing that was wrong.

The Mistake

The instinct was to declare the root cause immediately: “the data for the 14th never made it into the database.” The database was queried, the maximum date confirmed Aug 13, and the conclusion was reported with confidence:

“The data for Aug 14 simply isn’t there.”

The person with the context disagreed, repeatedly. Yet the same wrong conclusion was repeated — same query, same answer, same error. Scripts were even written to force-insert data, each hitting its own error, none addressing the real problem. The pushback was firm and plain: “It’s not 13.”

The Turn

The fix only came when the source file was checked directly. Comparing values instead of just dates made it obvious: the values stored under Aug 13 were identical to the source’s Aug 14 values. The Aug 14 data had been ingested — it was simply stored with the wrong trade_date, shifted back a day. The real bug was a one-day date offset, not missing data.

The database did show Aug 13. The error was in the conclusion drawn from it.

The Lesson

A query result is not a root cause. Saying “this is what the database returns” answers what happened, not why the application is broken. Those are different questions, and answering only the first one leads to circling the same wrong answer.

The useful turn was abandoning the repeated query and asking one better question: “Do the values match a different date?” That is where the truth actually sat.

This is debugging with ego instead of evidence. Ego says “I found the answer, stop doubting me.” Evidence says “the data is shifted by a day — prove it and fix it.”

A Better Approach

  1. Respect the person who has context, even when it contradicts the current query.
  2. Compare values, not just dates, across source and destination.
  3. Present the finding and its possible causes — not one confident wrong answer.
  4. Ask “does this actually explain the symptom?” before declaring victory.
  5. When the picture is a one-day offset, look for timezone or date-mapping bugs in the ingest path.

The symptom was a chart. The real bug was a date mapping. The difference between them was the difference between an hour and a wasted day.