amir20/dozzle · error
error fetching host info for agent
Error message
error fetching host info for agent: %w
What it means
Returned by AgentTestCmd.Run when agent.Host(ctx) fails or times out fetching host info over the established gRPC connection. The dial succeeded but the Host RPC returned an error, was rejected, or hit the --timeout deadline.
Solutions
- Increase --timeout, e.g. --timeout 30s, and retry.
- Verify the agent's local Docker daemon is healthy on the remote host (`docker info` there).
- Align versions: run the same dozzle release for CLI/tester and agent.
- Check agent logs on the remote host for RPC errors at call time.
- Retry after network blips; if persistent, restart the remote agent.
Example fix
// before ./dozzle agent-test 10.0.0.5:7007 # default timeout too short over WAN // after ./dozzle agent-test --timeout 30s 10.0.0.5:7007
Defensive patterns
Strategy: retry
Validate before calling
# pre-check: agent port reachable and reasonable latency
nc -zv "${ADDR%%:*}" "${ADDR##*:}" Try / catch
err := agentTestCmd.Run(args, embeddedCerts)
if err != nil && strings.Contains(err.Error(), "error fetching host info") {
time.Sleep(2 * time.Second)
args.Timeout = 30 * time.Second
err = agentTestCmd.Run(args, embeddedCerts)
} Prevention
- Set a generous --timeout for WAN or slow links
- Keep agent and CLI on the same dozzle version
- Monitor the remote Docker daemon health
- Retry transient failures before diagnosing deeper
When it happens
Trigger: --timeout too small for a slow link; agent accepts the connection but its internal Docker client is unhealthy so the RPC errors; agent version incompatibility causes a proto mismatch; stream reset mid-call.
Common situations: Testing a remote agent over a high-latency WAN with the default short timeout; agent up but Docker daemon hung; running a very old agent against a new CLI (or vice versa).
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- deadline exceeded: with
- failed to parse certificate
- failed to connect to
- EOF error while converting gRPC to error
- canceled: with
AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07).
Data as JSON: /api/errors/8709a873d1defffa.
Report an issue: GitHub.
Appendix: source
Thrown at internal/support/cli/agent_test_command.go:32
}
func (at *AgentTestCmd) Run(args Args, embeddedCerts embed.FS) error {
certs, err := ReadCertificates(embeddedCerts, args.CertPath, args.KeyPath)
if err != nil {
return fmt.Errorf("error reading certificates: %w", err)
}
log.Info().Str("endpoint", args.AgentTest.Address).Msg("Connecting to agent")
agent, err := agent.NewClient(args.AgentTest.Address, certs)
if err != nil {
return fmt.Errorf("error connecting to agent: %w", err)
}
ctx, cancel := context.WithTimeout(context.Background(), args.Timeout)
defer cancel()
host, err := agent.Host(ctx)
if err != nil {
return fmt.Errorf("error fetching host info for agent: %w", err)
}
log.Info().Str("endpoint", args.AgentTest.Address).Str("version", host.AgentVersion).Str("name", host.Name).Str("id", host.ID).Msg("Successfully connected to agent")
return nil
}
View on GitHub (pinned to d9463cbe21)