amir20/dozzle · error
local host not found
Error message
local host not found
What it means
`MultiHostService.LocalHost` tries to identify the local host among connected clients; in Swarm mode no host matches that check, so it falls back to the first local Docker client. If the manager has no local clients at all, this error is returned.
Solutions
- Ensure the Docker socket is mounted and accessible (/var/run/docker.sock) and the daemon is running
- Wait/retry until the RetriableClientManager has established the local client connection
- Check DOZZLE environment/config so local mode isn't accidentally disabled
- Check Dozzle startup logs for local Docker client connection errors
Example fix
// before
host, err := multiHostService.LocalHost() // immediately at startup
// after
// wait for clients, or guard:
if host, err := multiHostService.LocalHost(); err != nil { time.Sleep(time.Second); retry() } Defensive patterns
Strategy: retry
Validate before calling
// Go: wait until local docker client is ready
poll.Poll(time.Second, 30*time.Second, func() bool { return multiHostService.List() != nil }) Try / catch
host, err := multiHostService.LocalHost()
if err != nil {
time.Sleep(time.Second)
host, err = multiHostService.LocalHost()
if err != nil { log.Fatal("no local docker client: check socket mount") }
} Prevention
- Mount /var/run/docker.sock read-only into the dozzle container
- Delay cloud instance-ID registration until clients are connected
When it happens
Trigger: Calling LocalHost() when manager.LocalClients() is empty: Docker client failed to initialize (daemon unreachable, socket not mounted) or is still connecting during startup.
Common situations: Cloud client requesting an instance ID before the local Docker connection is established; running Dozzle without access to /var/run/docker.sock; transient daemon unavailability.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- invalid connection string
- host not found
- container not found
- registry requires authentication
- image not found in registry
AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07).
Data as JSON: /api/errors/cb530eca7ffb4c19.
Report an issue: GitHub.
Appendix: source
Thrown at internal/support/docker/multi_host_service.go:176
func (m *MultiHostService) Hosts() []container.Host {
ctx, cancel := context.WithTimeout(context.Background(), m.timeout)
defer cancel()
return m.manager.Hosts(ctx)
}
func (m *MultiHostService) LocalHost() (container.Host, error) {
for _, host := range m.Hosts() {
if host.Type == "local" {
return host, nil
}
}
// Swarm mode marks every host as "swarm" so the loop above never matches.
// Fall back to the local docker client directly — its host ID is stable
// per node and is what callers (cloud client instance ID, etc.) actually want.
for _, client := range m.manager.LocalClients() {
return client.Host(), nil
}
return container.Host{}, fmt.Errorf("local host not found")
}
func (m *MultiHostService) SubscribeAvailableHosts(ctx context.Context, hosts chan<- container.Host) {
m.manager.Subscribe(ctx, hosts)
}
func (m *MultiHostService) LocalClients() []container.Client {
return m.manager.LocalClients()
}
func (m *MultiHostService) LocalClientServices() []container_support.ClientService {
return m.manager.LocalClientServices()
}
// ClientServices returns every client this Dozzle serves — the local docker
// daemon, --remote-host daemons and --remote-agent agents alike. Unlike
// LocalClientServices it does not filter by client type, so a caller that needs
// the whole fleet (the cloud client) sees agents too.View on GitHub (pinned to d9463cbe21)