Hey everyone,
Today, I battled a unique bug (and no, it wasn't in my code!). This experience highlighted the importance of creative thinking, and taking well-timed breaks while debugging.
I was working on a video streaming project with media uploads using Multer and Cloudinary and an unfamiliar error popped up. Following best practices, I narrowed down the culprit – Cloudinary (sorry Cloudinary, false alarm!). I double-checked my API key, environment variables, controller, and utility files, but nothing worked. A Google search yielded no solutions. The only clues were cryptic error snippets mentioning internal event loop task queues.
process.processTimers (node:internal/timers:514:7)
process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Four frustrating hours later, I was on the verge of rewriting the entire codebase. That's when I decided to step away and clear my head.
Upon returning, I reviewed the situation with fresh eyes. The same code worked before in a full-fledged OS instead of a virtual machine (VM). Since I recently switched from dual boot to a VM, I thought it might be worth investigating.
Here's where things get interesting. I consulted Gemini, considering the VM context. It suggested checking various factors, including the network adapter of the guest OS (VM). Knowing a thing or two about VMs, I switched the adapter from NAT to Bridge mode. Restarted everything... and voila! It worked!
Lesson learned: Sometimes, taking a break can lead to a fresh perspective. The error might not be where you're initially looking.
Bonus: This fearless debugging attitude was inspired by a lot of great programmer YouTubers, one of which is Hitesh Choudhury and his channel Chai and Code that I recently stumbled upon.. It's an underrated gem offering free and in-depth coding knowledge and deserves millions of views! Big thanks to Hitesh Choudhury for reminding us not to fear bugs – they're an inevitable part of the programming journey.
What are your experiences with debugging non-code related issues? Share your stories in the comments!