{"record":{"id":"e026908b287ead21","repo":"amir20/dozzle","slug":"host-s-not-found","errorCode":null,"errorMessage":"host %s not found","messagePattern":"host (.+?) not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/support/docker/multi_host_service.go","lineNumber":59,"sourceCode":"\ttimeout             time.Duration\n\tnotificationManager *notification.Manager\n\tpersister           *notification.Persister\n\tcloudNotifyFn       atomic.Pointer[func()]\n}\n\nfunc NewMultiHostService(manager ClientManager, timeout time.Duration) *MultiHostService {\n\tm := &MultiHostService{\n\t\tmanager: manager,\n\t\ttimeout: timeout,\n\t}\n\n\treturn m\n}\n\nfunc (m *MultiHostService) FindContainer(host string, id string, labels container.ContainerLabels) (*container_support.ContainerService, error) {\n\tclient, ok := m.manager.Find(host)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"host %s not found\", host)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), m.timeout)\n\tdefer cancel()\n\tcontainer, err := client.FindContainer(ctx, id, labels)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn container_support.NewContainerService(client, container), nil\n}\n\nfunc (m *MultiHostService) ListContainersForHost(host string, labels container.ContainerLabels) ([]container.Container, error) {\n\tclient, ok := m.manager.Find(host)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"host %s not found\", host)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), m.timeout)\n\tdefer cancel()","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/support/docker/multi_host_service.go#L41-L77","documentation":"`MultiHostService.FindContainer` looks up a Docker client for the given host ID via the ClientManager. If no client is registered under that host ID, the container lookup cannot proceed and this error is returned before any container search.","triggerScenarios":"API calls like /api/hosts/{host}/containers/{id}/... with a host ID that isn't in the client manager: stale host IDs after an agent disconnects, mistyped host names, or remote agent hosts that are offline/unreachable at startup.","commonSituations":"Bookmarked URLs referencing a removed remote host; agent containers restarted with a new host ID; frontend sending a host id from stale state while the remote agent is down.","solutions":["Check the host ID against the hosts listed in the Dozzle UI / /api/hosts endpoint","Ensure remote agent containers are running and reachable (port 7007, TLS certs)","Use the correct host identifier ('local' for the local Docker daemon or the remote host's actual ID)","Restart Dozzle so it rediscovers hosts"],"exampleFix":"// before\nGET /api/hosts/stale-agent-abc/containers/xyz/logs\n// after\nGET /api/hosts/local/containers/xyz/logs","handlingStrategy":"try-catch","validationCode":"hosts=$(curl -s /api/hosts | jq -r '.[].id')\necho \"$hosts\" | grep -qx \"$HOST_ID\" || { echo \"unknown host: $HOST_ID\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"svc, err := multiHostService.FindContainer(host, id, labels)\nif err != nil {\n  // treat as stale host: refresh host list and retry with discovered IDs\n  return retryWithDiscoveredHosts()\n}","preventionTips":["Resolve host IDs from the live /api/hosts list instead of cached/bookmarked values","Monitor remote agent health so disconnected hosts are pruned from requests"],"tags":["docker","multi-host","not-found"],"backgroundTag":"resource-not-found","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"}