DevOps & monitoring

When health checks report success but measure nothing

A developer found three monitoring checks that always passed despite being broken, highlighting the danger of silent validation failures in production systems.

Server rack lights with a magnifying glass showing a wiring fault
Illustration created for this article

On November 5, 2026, a developer shared a detailed post-mortem on DEV Community describing how three separate monitoring checks in their system reported successful status codes while completely failing to perform their intended functions. The incident reveals a subtle class of bugs where validation logic returns true positives for incorrect reasons, creating a false sense of security that can persist indefinitely without manual intervention or negative test cases.

What happened

The first failure involved an SMTP pre-flight gate designed to verify email addresses before sending outreach messages. The probe attempted to connect to a domain's mail exchange host and issue an RCPT TO command, treating a 250 response code as proof that the mailbox existed. However, a bug in the socket handling meant the code did not read the initial server greeting banner. This caused every subsequent command to consume the reply from the previous command. The rcpt() function was actually reading the response to the MAIL FROM command, which almost always returns 250. Consequently, the gate accepted every address, including invalid ones, because it never actually evaluated the recipient check.

The second issue stemmed from how external mail providers handle verification probes. The developer noticed that Zoho-hosted custom domains returned identical rejection messages for both real and fake email addresses. While the provider correctly distinguished between existing and non-existing users on its own primary domain, it applied a generic policy rejection code to customer domains regardless of the mailbox status. Treating these identical error codes as equivalent led to false negatives, where valid contacts were marked as undeliverable. The developer resolved this by splitting the verdict logic and refusing to verify any address that returned a policy-based rejection, accepting the loss of some prospects to protect domain reputation.

The third case involved an attempt to deduplicate notifications using two independent sources: an API watcher and email notifications from Dev.to. The plan was to extract a unique comment identifier from incoming emails to match against API events. Testing against thirteen real notification emails revealed that none contained the expected identifier. Instead, all links were wrapped in SendGrid click-tracking redirects, obscuring the original destination. The email content was a rendered view of an event rather than a structured serialization, making it impossible to extract the specific ID needed for deduplication. The developer demoted the email channel from a data source to a simple watchdog that only signals if the primary API path fails entirely.

Key details

  • The SMTP probe bug occurred because the code failed to consume the initial 220 banner, causing every server reply to be read one command late.
  • Invalid email addresses passed the verification gate because the code checked the response to MAIL FROM (usually 250) instead of RCPT TO.
  • Zoho-hosted custom domains return the same 550 5.7.1 policy error for both valid and invalid mailboxes, unlike their primary domain which returns 550 5.1.1 for missing users.
  • Dev.to notification emails use SendGrid click-tracking wrappers that hide the original URL parameters, preventing regex extraction of comment IDs.
  • The developer emphasizes that monitors often report on their own execution success rather than the actual state of the external system they are checking.
  • Negative testing, such as probing with known-invalid addresses, is identified as the only reliable way to detect these silent failures.

Background

In network protocols like SMTP, communication happens in a strict sequence of commands and responses. If a client does not read a response before sending the next command, the buffer fills with unread data, and subsequent reads pull the wrong messages. This is a common pitfall when managing raw sockets or low-level library connections. Additionally, email providers often implement anti-spam measures that obscure the difference between a non-existent user and a blocked sender to prevent address harvesting. These policy decisions can break naive verification tools that rely on specific error codes. Finally, modern email marketing and notification platforms frequently wrap links in tracking domains to monitor engagement, which alters the HTML structure and breaks parsers expecting direct URLs.

Why it matters

For teams running self-hosted software, this story illustrates the risk of "green dashboard" syndrome. When a health check or validation script runs without errors, operators assume the underlying service is healthy. However, if the check itself is flawed, it validates its own ability to run rather than the target system's state. This is particularly dangerous in automated pipelines, such as email outreach or data synchronization, where false positives can lead to data corruption, domain blacklisting, or duplicated actions.

Silent failures are harder to detect than outright crashes because they do not trigger alerts. A script that exits with code 0 but performs no useful work is indistinguishable from a healthy script unless you verify its output against known bad inputs. This requires a shift in testing strategy from ensuring the code runs to ensuring the code fails when it should. Without negative test cases, such as checking against known-invalid emails or malformed data, these logic errors can remain hidden for months or years.

What you can do

  • Implement negative testing for all validation probes by including known-invalid inputs, such as non-existent email addresses, to ensure the check correctly identifies failures.
  • Log full server response text, including enhanced status codes, rather than just boolean pass/fail results, to distinguish between different types of rejections.
  • Test data extraction logic against real-world input samples captured from production traffic, not just synthetic examples created during development.
  • Verify that network clients properly consume all expected responses in a protocol sequence, especially initial banners or greetings, before issuing subsequent commands.
  • Treat ambiguous or policy-based error responses from third-party services as unverified rather than failed, to avoid acting on incorrect assumptions.
  • Regularly audit monitoring checks to confirm they are measuring the intended external state and not just reporting their own successful execution.

More news

All news