{"record":{"id":"8709a873d1defffa","repo":"amir20/dozzle","slug":"error-fetching-host-info-for-agent-w","errorCode":null,"errorMessage":"error fetching host info for agent: %w","messagePattern":"error fetching host info for agent: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/support/cli/agent_test_command.go","lineNumber":32,"sourceCode":"}\n\nfunc (at *AgentTestCmd) Run(args Args, embeddedCerts embed.FS) error {\n\tcerts, err := ReadCertificates(embeddedCerts, args.CertPath, args.KeyPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error reading certificates: %w\", err)\n\t}\n\n\tlog.Info().Str(\"endpoint\", args.AgentTest.Address).Msg(\"Connecting to agent\")\n\n\tagent, err := agent.NewClient(args.AgentTest.Address, certs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error connecting to agent: %w\", err)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), args.Timeout)\n\tdefer cancel()\n\thost, err := agent.Host(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error fetching host info for agent: %w\", err)\n\t}\n\n\tlog.Info().Str(\"endpoint\", args.AgentTest.Address).Str(\"version\", host.AgentVersion).Str(\"name\", host.Name).Str(\"id\", host.ID).Msg(\"Successfully connected to agent\")\n\n\treturn nil\n}\n","sourceCodeStart":14,"sourceCodeEnd":39,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/support/cli/agent_test_command.go#L14-L39","documentation":"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.","triggerScenarios":"--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.","commonSituations":"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).","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."],"exampleFix":"// before\n./dozzle agent-test 10.0.0.5:7007  # default timeout too short over WAN\n// after\n./dozzle agent-test --timeout 30s 10.0.0.5:7007","handlingStrategy":"retry","validationCode":"# pre-check: agent port reachable and reasonable latency\nnc -zv \"${ADDR%%:*}\" \"${ADDR##*:}\"","typeGuard":null,"tryCatchPattern":"err := agentTestCmd.Run(args, embeddedCerts)\nif err != nil && strings.Contains(err.Error(), \"error fetching host info\") {\n  time.Sleep(2 * time.Second)\n  args.Timeout = 30 * time.Second\n  err = agentTestCmd.Run(args, embeddedCerts)\n}","preventionTips":["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"],"tags":["grpc","timeout","host-info"],"backgroundTag":"request-timeout","analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}