Urgent.News

What's breaking now, across thousands of outlets.

Tech

The flag file my watchdog wrote was 0 bytes, so the alert fired for 8 days

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…

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.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Your CI artifacts and preview deployments can leak unprotected JavaScript

Many teams start obfuscating or VM-protecting client JavaScript in the production Vite or webpack build, then assume the problem is solved. The production CDN may be clean.

  • Unprotected JavaScript can leak through CI artifacts, preview deployments, and public registries
  • Preview URLs are public by default on platforms like Vercel, Netlify, and Cloudflare Pages
  • Protect previews with authentication policies or run protection step on previews

S3 Alternative Storage Providers With a Free Tier for User Files in Node.js

Short answer: For a marketplace storing user files, start with Backblaze B2 when a free tier matters, move to Wasabi for predictable storage-heavy usage, and choose R2, S3, or Infrai when the…

  • Backblaze B2 offers free tier for early testing and cost-sensitive storage.
  • Wasabi recommended for predictable, storage-heavy workloads once free tier is irrelevant.
  • S3 and R2 preferred if surrounding platform benefits outweigh cost considerations.

My coding agent said "done" 1,521 times. Half of those had nothing behind them.

I run Claude Code most of the day, often several agents at once. For about two months I logged every session on my machine and asked one boring question of each "done" message: did a passing check…

  • Claude Code agent made 1,521 "done" claims in two months
  • 49% of "done" claims lacked proper verification
  • Implementing stop hook restored trust in "done" claims

More from Sunday 15 November →