Files
Pulse/internal/agentcontext
rcourtman 2552267e1a Say why a container's health check fails
"Health is unhealthy" sends the owner to the host to find out why, and
on a default install Patrol cannot do better: it reads no logs and no
probe output. On the fault set a default agent could only call the dead
web worker's cause unconfirmed.

Docker's inspect result, which the agent already reads every cycle,
holds the last probe results. The agent now classifies the newest
failure on the host and reports a reason code from a closed set:
connection refused, timed out, name not resolved, an HTTP status, TLS
error, command not found, or other. It sends the exit code and the
failing streak with it and never the output, which can hold credentials
like the health-check command the agent already keeps on the host. The
server maps any reason outside the set to "other", so the field cannot
carry text.

The reason is named only when the output states it in the words curl,
wget and the engine print. Anything else is "other" with the exit code,
because a wrong reason sends the owner the wrong way.

It shows in the alert ("health is unhealthy (health check: connection
refused)"), in the container's Health check row and State tooltip, and
in what Patrol reads: the scoped seed table, the unhealthy line of a
full run and the container payload. The start of the alert message is
unchanged and the streak stays out of it, so the text is stable while
the reason is.

An agent that does not report the reason leaves everything as it was.

Scored on the fault set before merging, both profiles, one run per
cell. On a default agent Patrol's finding on the dead web worker now
names the cause ("health check sustained failure (connection refused)").
The rubric accepted only the spaced spelling, and the conclusion wrote
the code and "refusing connections", so the decisive terms gain those
spellings and the run regrades to "Handed over". That is a rubric
changed after seeing a transcript. Default agent 4 of 7, commands on 6
of 7, no cell worse except the stopped service on a default agent,
whose conclusion did not say the exit was clean.
2026-11-12 20:35:15 +00:00
..