Readiness names the daemon, not a Go template error - #237
Merged
Conversation
Building the deployment image found this: the image has the Docker CLI and no
daemon, and `check()` reported
template: :1:2: executing "" at <.ServerVersion>: reflect: indirection
through nil pointer to embedded struct field Info
Asked with `--format`, an unreachable daemon still makes the CLI render a
mostly-nil `Info` struct, so the template error is the LAST line of stderr and
"Cannot connect to the Docker daemon" is above it. `check()` took the last
line, so `/api/readiness` and `doctor` would have blamed reflection for a
stopped service — a message naming the wrong component, which is the failure
this repository keeps paying for.
`docker info` is now asked without a format, the exit code decides, and the
reported line is the one a person can act on: template noise is a consequence
of the daemon being absent, never the reason. A daemon that answers reports
its parsed `Server Version:`.
Found by deploying, not by reading. The dev host has the same CLI-without-
daemon shape and never surfaced it, because the failing assertion only fires
where `docker info` produces the template error rather than a plain refusal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while building the deployment image, which is a host with the Docker CLI installed and no daemon reachable.
DockerEnvironmentFactory.check()randocker info --format {{.ServerVersion}}and reported the last line of stderr. With a format string an unreachable daemon still renders a mostly-nilInfostruct, so the last line is a Go template error aboutindirection through nil pointer to embedded struct field Info, and the line that saysCannot connect to the Docker daemonsits above it.So
/api/readinessanddoctorwould have told an operator that reflection was stopping the fleet. That is a message naming the wrong component — the failure class this repository has paid for repeatedly.docker infois now asked with no format, the exit code decides readiness, and the reported line is the one a person can act on. A daemon that answers reports its parsedServer Version:.Two regression tests pin it, including that empty stderr still names the component instead of going blank.
Failing run: https://github.com/TheDancingDeveloper-org/agent-harness/actions/runs/31245089056