{
  "id": 20089331,
  "title": "The flag file my watchdog wrote was 0 bytes, so the alert fired for 8 days",
  "url": "https://urgent.news/2026/11/15/the-flag-file-my-watchdog-wrote-was-0-bytes-so-the-alert-fired-for-8",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-15T01:11:29.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/samuelfmedeiros/the-flag-file-my-watchdog-wrote-was-0-bytes-so-the-alert-fired-for-8-days-2959"
  },
  "original_language": "en",
  "account": "A monitoring script kept yelling daily for eight days, all due to a zero-byte flag file. The script was supposed to stop alerting once it had already notified of an issue. Instead, it kept a latch file with the date of the last warning. If the file already existed, the job remained silent. The issue occurred when the job tried to write to the latch file, but the time module was not imported. This resulted in a NameError: name 'time' is not defined, which propagated to the caller and caused the script to exit. The existing, 0-byte latch file was mistakenly interpreted as \"never warned,\" triggering the alert every day. The three main issues identified were 1) verifying that the latch file is in a proper state, 2) handling exceptions more effectively, and 3) trusting status fields blindly. These problems stemmed from a proxy misrepresenting reality, with the alert being green due to a fake measurement. The author now emphasizes the importance of verifying each check with concrete evidence before assuming everything is working correctly.",
  "summary": "A monitoring script is supposed to stop shouting once you've been told. Mine shouted every morning for eight days, and the reason was a file with zero bytes. The design that looked fine The pattern is common: a cron job runs every hour, checks something, and when the check fails it sends a message. To avoid a message every hour, it keeps a latch — a small JSON file with the date of the last time…",
  "key_points": [
    "Zero-byte flag file triggered alert for eight days",
    "Script failed to write to latch file due to NameError",
    "Issues arose from proxy misrepresenting reality"
  ],
  "editors_take": "Treating a file's mere existence as a valid state indicator creates a dangerous blind spot where silent code failures masquerade as successful operations, undermining the entire reliability of automated monitoring.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}