Skip to content
← Blog

curl says 000 and the service is fine

A monitoring check on an internal service started reporting status 000. Not 500, not a timeout — 000, which is what curl writes when it has no HTTP status to report at all.

That normally means one of the boring things: connection refused, DNS failure, TLS handshake rejected, wrong port. I checked all of them. The port was open, the process was running, the certificate was valid, and the service was demonstrably working because other things were using it successfully.

What it actually was

The service answers with a bare HTTP/0.9 response — a response body with no status line and no headers, which is how HTTP worked before HTTP/1.0.

Modern curl refuses these by default, on reasonable security grounds: a response with no headers is indistinguishable from a non-HTTP service that happened to send some bytes, and treating arbitrary bytes as a web response has caused real vulnerabilities. So curl reads it, declines to interpret it, and reports having received no status.

curl -s -o /dev/null -w '%{http_code}' http://service:8000   # 000
curl --http0.9 -s -o /dev/null -w '%{http_code}' http://service:8000   # 200

The 000 was curl telling me about its own policy. I read it as the service being down.

Why this is worth writing down

The check was wrong in the most expensive direction available. It reported a healthy service as failing, on a host I had every reason to be nervous about. Had that persisted, the outcome is predictable: I would have learned to ignore that alert, and then ignored it on the day it meant something.

False positives are not a lesser problem than false negatives. They are how you train yourself into false negatives.

The general version

When a diagnostic tool returns a value meaning “I have nothing to tell you”, that is a statement about the tool, not about the thing being measured. 000, null, an empty string and an unset exit code all deserve the same question before anything else: did the measurement actually happen?

I now check that before checking the service. It is a faster path to the answer roughly half the time, and it stops me pulling apart something that was never broken.