amir20/dozzle · error

host is not served by this Dozzle instance

Error message

host %s is not served by this Dozzle instance

What it means

MultiHostService.FindContainer looks up the host ID in the set of configured/known hosts; if the requested host ID is not served by this Dozzle instance, it returns this error. It guards against requests naming hosts from another deployment or stale IDs.

Solutions

  1. List current hosts via the hosts API/UI and use the exact host id in the request
  2. Verify remote agents are configured and connected (correct endpoint, shared certs) so the host is registered
  3. Restart/refresh the frontend to clear stale host ids after agents changed
  4. Confirm the request is hitting the Dozzle instance that manages that host

Example fix

// before
svc, err := multiHostService.FindContainer("stale-host-id", containerID, labels)
// after
hosts := multiHostService.List()
if len(hosts) > 0 {
    svc, err = multiHostService.FindContainer(hosts[0].ID, containerID, labels)
}
Defensive patterns

Strategy: validation

Validate before calling

const hosts = await (await fetch('/api/hosts')).json();
if (!hosts.some(h => h.id === hostId)) throw new Error(`unknown host ${hostId}`);

Try / catch

try {
  await fetch(`/api/hosts/${hostId}/containers/${cid}/logs/stream`);
} catch (e) {
  if (String(e).includes('is not served by this Dozzle instance')) {
    await refreshHosts(); // reload host list and retry
  }
}

Prevention

When it happens

Trigger: Calling FindContainer (or an HTTP route like /api/hosts/{host}/containers/{id}/...) with a host key that is not in the host map: stale frontend state, wrong agent id, or host was removed/restarted.

Common situations: Bookmarked URLs pointing at an old host id; agent containers recreated with new ids; requests proxied to the wrong Dozzle instance; container-store caching a host that disconnected at startup.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07). Data as JSON: /api/errors/7313f46a64467fec. Report an issue: GitHub.

Appendix: source

Thrown at main.go:462

	return all, errs
}

func (l *cloudHostService) FindContainer(host string, id string, labels container.ContainerLabels) (*container_support.ContainerService, error) {
	// No retry: this runs once per log reader, and a run of them against an
	// unreachable agent would each wait out the dial timeout.
	for _, s := range l.services(false) {
		if l.hostID(s) != host {
			continue
		}
		ctx, cancel := l.hostTimeout()
		cont, err := s.FindContainer(ctx, id, labels)
		cancel()
		if err != nil {
			return nil, err
		}
		return container_support.NewContainerService(s, cont), nil
	}
	return nil, fmt.Errorf("host %s is not served by this Dozzle instance", host)
}

// watchNewServices calls attach again whenever a host that was unreachable at
// startup joins, so a late agent gets subscribed without waiting for a restart.
//
// The ticker is the backstop. SubscribeAvailableHosts only fires on the
// unreachable-to-reachable edge, so anything attach skipped for another reason
// — a host whose id could not be resolved at the time — would otherwise stay
// skipped for the life of the connection. A re-attach that finds nothing new is
// a map lookup per service, so this is cheap enough to run unconditionally.
//
// attach is only ever called from this one goroutine, after the caller's
// initial synchronous call has returned, so it needs no locking of its own.
func (l *cloudHostService) watchNewServices(ctx context.Context, attach func()) {
	hosts := make(chan container.Host, 8)
	l.hs.SubscribeAvailableHosts(ctx, hosts)
	ticker := time.NewTicker(reattachInterval)
	go func() {

View on GitHub (pinned to d9463cbe21)