{"record":{"id":"193308cb77ccdc5d","repo":"amir20/dozzle","slug":"nodes-not-found","errorCode":null,"errorMessage":"nodes not found","messagePattern":"nodes not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/k8s/client.go","lineNumber":103,"sourceCode":"\tclientset, err := kubernetes.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdynamicClient, err := dynamic.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdiscoveryClient, err := discovery.NewDiscoveryClientForConfig(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnodes, err := clientset.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(nodes.Items) == 0 {\n\t\treturn nil, fmt.Errorf(\"nodes not found\")\n\t}\n\tnode := nodes.Items[0]\n\n\treturn &K8sClient{\n\t\tClientset:     clientset,\n\t\tDynamicClient: dynamicClient,\n\t\trestMapper:    restmapper.NewDeferredDiscoveryRESTMapper(memory.NewMemCacheClient(discoveryClient)),\n\t\tnamespace:     namespace,\n\t\tconfig:        config,\n\t\thost: container.Host{\n\t\t\tID:   node.Status.NodeInfo.MachineID,\n\t\t\tName: node.Name,\n\t\t},\n\t\townerCache: make(map[string]ownerLookupResult),\n\t}, nil\n}\n\ntype k8sOwner struct {","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/k8s/client.go#L85-L121","documentation":"NewK8sClient lists cluster nodes at startup and fails hard when the CoreV1 Nodes API returns an empty list. This means the client connected and authenticated but the cluster reported zero nodes, so Dozzle cannot determine cluster identity and refuses to initialize the k8s client.","triggerScenarios":"Thrown at internal/k8s/client.go:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the kubeconfig/context points at a real, joined cluster (kubectl get nodes).","Check RBAC: a restricted ServiceAccount may list an empty node set; grant nodes list permission.","If running in a namespace-restricted environment, ensure the cluster has registered nodes."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}