DEV Community

Cover image for The Joy of Debugging: How One Tiny Typo Kept Us Busy for Hours
Boopathi
Boopathi

Posted on

3 3 3 3 3

The Joy of Debugging: How One Tiny Typo Kept Us Busy for Hours

Hey friends! 👋

Today, I want to share a little debugging adventure that started with what seemed like a small issue but turned into an hour-long hunt. Spoiler: it was all caused by a single typo in Meilisearch's documentation. 🙃

We’ve been using Meilisearch to enhance our product’s search functionality, and recently, we got a new requirement: We needed to trigger some business logic every time Meilisearch completed indexing.

After exploring Meilisearch’s features, we stumbled upon something that seemed like the perfect solution—task webhooks. This feature allows you to get notified when an indexing task is completed, exactly what we needed!

According to the official docs, all we had to do was set up two environment variables: one for the webhook URL and another for the authorization header.

meilisearch doc

So, we set it up as per the documentation, started indexing some data, and patiently waited for the webhook to trigger. 🎉 It did! But... our business logic didn’t execute as expected. 😕

We checked the server logs to ensure the webhook was triggering, and it was. But something wasn’t right—our business logic still wasn't running. When we dug into the logs, we found that our server was returning a 401 status code. Uh-oh! 😟

Naturally, we thought we messed something up on our server’s side, particularly with the webhook authorization header validation. We double-checked our Meilisearch environment setup—everything looked fine. So, we decided to log the incoming request headers to see if the auth header was even being passed correctly.

To our surprise, it was completely empty. 😅

At this point, it became clear that the issue wasn’t on our side. After a lot of Googling, reading forums, and countless debugging attempts, we still couldn’t crack it.

Finally, I decided to take matters into my own hands and dive into Meilisearch’s codebase. I wanted to see exactly how they were sending the webhook event and attaching the authorization header.

code base
And that’s when I discovered the culprit: a simple typo in their documentation. 🤦‍♂️

In the code, they were using the environment variable MEILI_TASK_WEBHOOK_AUTHORIZATION_HEADER, but the docs listed it as MEILI_TASK_AUTHORIZATION_HEADER. They’d accidentally left out the "WEBHOOK" part!

Once we corrected the typo in our environment variable, everything worked like a charm.

Feeling like a true detective, I didn’t stop there. I went ahead and submitted a pull request to fix the typo in their documentation so that future developers wouldn’t have to go through the same ordeal. The PR got merged, and for a brief moment, I felt like a superhero 😂

pull request

Finally, don’t forget to share your own typo debugging adventures in the comments! Let’s all laugh (or cry) together.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay