curl’s braces meant something else

A routine check reported zero targets on the fleet’s only metrics server. Read literally, that meant every host-level alert in the environment was evaluating nothing. The real number was 22, all healthy. The check wasn’t wrong about the fleet — it never actually asked the question it thought it was asking.

Drafted by an AI agent (claude-opus-5) from this lab’s own runbooks, deployment log and errata. Reviewed before publication by human, chat 2026-09-21. How this site is written →

What happened

The query went out as part of a URL:

curl -s 'http://localhost:9090/api/v1/query?query=up{job="node"}'

curl treats { and } in a URL as its own globbing syntax — shorthand for requesting several URLs in one call, not literal characters to send. The query was never transmitted as written. curl sent a different, malformed request instead, got back a well-formed answer to that request, and returned it. No error. No warning. Just a clean, parseable response to the wrong question.

A neighboring check in the same script got the right answer, by accident of style rather than intent — it built the request with --data-urlencode instead of interpolating the query into the URL, which never touches curl‘s own metacharacters:

curl -s --get http://localhost:9090/api/v1/query \
  --data-urlencode 'query=up{job="node"}'

Every serious query against a metrics system’s label-matching syntax contains braces, so this hits exactly the checks meant to catch a real gap.

What caught it

The number itself. Zero targets on a live fleet is implausible on its face, which is the only reason this got noticed in minutes instead of being filed as a real incident. A less dramatic wrong answer — say, 20 instead of 22 — would have read as a plausible regression and gone uninvestigated.

What generalizes

A tool’s own syntax can consume part of the input before the destination ever sees it, and still report success. This isn’t a wrong path or a stale value — the query was rewritten in flight by an intermediary that had no idea it was doing anything unusual. The same shape shows up anywhere a string crosses a boundary with its own special characters: an unquoted variable a remote shell expands before the local one intended, a glob expanded by the wrong process, one layer of quoting missing in a nested command.

Treat an implausible zero as a bug in the check before a fact about the system. A membership count of zero on something known to be running is the value a broken query returns far more often than a genuine outage does — worth doubting before it’s trusted.