amir20/dozzle · error

nodes not found

Error message

nodes not found

What it means

`NewK8sClusterService` lists cluster nodes at construction time to build the host list. If the cluster reports zero nodes, service construction fails with 'nodes not found', since Dozzle k8s mode requires at least one node to monitor.

Solutions

  1. Verify with `kubectl get nodes` using the same kubeconfig that nodes are visible
  2. Fix RBAC: grant the service account ClusterRole permission to list nodes
  3. Point the kubeconfig at the correct cluster context
  4. Ensure the cluster has registered nodes (check control-plane health)

Example fix

// before
# serviceaccount without node list permission
// after
kubectl create clusterrolebinding dozzle-nodes --clusterrole=view --serviceaccount=default:dozzle
# or add a ClusterRole allowing get/list nodes
Defensive patterns

Strategy: retry

Validate before calling

kubectl get nodes --kubeconfig "$KUBECONFIG" | grep -c NAME  # must be > 0 before starting dozzle k8s mode

Try / catch

svc, err := k8s.NewK8sClusterService(client)
if err != nil {
  time.Sleep(5 * time.Second)
  svc, err = k8s.NewK8sClusterService(client) // retry: nodes may register late
}

Prevention

When it happens

Trigger: Creating a K8s cluster service against a cluster whose Node list API returns an empty set: RBAC-restricted views, wrong kubeconfig/context pointing at an empty/control-plane-less cluster, or unusual virtual clusters.

Common situations: kubeconfig pointing to the wrong context or namespace-scoped credentials that hide nodes; vcluster/kind setups without registered nodes; RBAC denying node listing silently returning empty results in some setups.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at internal/support/k8s/k8s_cluster_service.go:34

)

type K8sClusterService struct {
	client              *K8sClientService
	timeout             time.Duration
	hosts               []container.Host
	notificationManager *notification.Manager
	persister           *notification.Persister
}

func NewK8sClusterService(client *k8s.K8sClient, timeout time.Duration) (*K8sClusterService, error) {
	hosts := make([]container.Host, 0)
	nodes, err := client.Clientset.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{})
	if err != nil {
		return nil, err
	}

	if len(nodes.Items) == 0 {
		return nil, fmt.Errorf("nodes not found")
	}

	for _, node := range nodes.Items {
		hosts = append(hosts, container.Host{
			ID:            node.Name,
			Name:          node.Name,
			MemTotal:      node.Status.Capacity.Memory().Value(),
			NCPU:          int(node.Status.Capacity.Cpu().Value()),
			DockerVersion: node.Status.NodeInfo.ContainerRuntimeVersion,
			Type:          "k8s",
			Available:     true,
		})
	}

	return &K8sClusterService{
		client:  NewK8sClientService(client, container.ContainerLabels{}),
		timeout: timeout,
		hosts:   hosts,

View on GitHub (pinned to d9463cbe21)