Three days. Forty-two hours of staring at code. Multiple panic-induced Slack messages to my teammate. And it turned out the problem was nowhere near where I was looking.
Here’s what happened.
The Problem
We had a production issue. Users were reporting that their data wasn’t saving. The error message was vague: “Something went wrong.” Classic.
I jumped in, saw the error was coming from our API endpoint, and immediately assumed it was a database issue. The endpoint was trying to write to PostgreSQL, so I started checking:
- Connection pool exhaustion?
- Query timeout?
- Schema changes?
- Missing required fields?
I checked all of these. I added logs. I checked the database directly. Everything looked fine. But users still couldn’t save.
The Mistake
I was solving the wrong problem. I was so sure the database was the culprit that I never questioned whether the data even reached the database call.
It wasn’t until I added a log at the very first line of the function that I realized: the function wasn’t even being called. The request was failing before it got to our API endpoint.
Turns out, our frontend was sending the data to a URL that no longer existed. We had migrated endpoints a week earlier and missed updating one of the API calls.
What I Learned
Here’s the thing about debugging: your first instinct is usually wrong. And the more certain you are, the more likely you’re missing something obvious.
Now I follow a simple checklist before diving deep:
- Verify the entry point — Is the function even being called? Is the request reaching your server?
- Check the request/response — Use your browser’s network tab. Don’t assume.
- Trace backward, not forward — Start from the error and work toward the source, not the other way around.
- Explain it out loud — Seriously. Tell a rubber duck what you think is happening. I once caught a typo this way.
The Fix
It took 15 seconds to fix once I found it. Changed the URL. Done.
Three days for 15 seconds of work. But I won’t forget that lesson anytime soon.
The bug is always in the place you least expect. But more often, it’s in the place you’re most confident about.
Next time you’re stuck, step back. Check the obvious thing. The thing that feels too simple to be the answer.
