{"record":{"id":"7364d5a83aeef7b4","repo":"kubernetes/kubernetes","slug":"couldn-t-get-list-of-nodes-when-syncing-daemon-set","errorCode":null,"errorMessage":"couldn't get list of nodes when syncing daemon set %#v: %v","messagePattern":"couldn't get list of nodes when syncing daemon set %#v: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/controller/daemon/daemon_controller.go","lineNumber":1323,"sourceCode":"\t\t\t).Inc()\n\t\t}\n\t\treturn err\n\t}\n\n\tds, err := dsc.dsLister.DaemonSets(namespace).Get(name)\n\tif apierrors.IsNotFound(err) {\n\t\tlogger.V(3).Info(\"Daemon set has been deleted\", \"daemonset\", key)\n\t\tdsc.expectations.DeleteExpectations(logger, key)\n\t\tdsc.consistencyStore.Clear(dsNamespacedName, \"\")\n\t\treturn nil\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to retrieve ds %v from store: %v\", key, err)\n\t}\n\n\tnodeList, err := dsc.nodeLister.List(labels.Everything())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't get list of nodes when syncing daemon set %#v: %v\", ds, err)\n\t}\n\n\teverything := metav1.LabelSelector{}\n\tif reflect.DeepEqual(ds.Spec.Selector, &everything) {\n\t\tdsc.eventRecorder.Eventf(ds, v1.EventTypeWarning, SelectingAllReason, \"This daemon set is selecting all pods. A non-empty selector is required.\")\n\t\treturn nil\n\t}\n\n\t// Don't process a daemon set until all its creations and deletions have been processed.\n\t// For example if daemon set foo asked for 3 new daemon pods in the previous call to manage,\n\t// then we do not want to call manage on foo until the daemon pods have been created.\n\tdsKey, err := controller.KeyFunc(ds)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't get key for object %#v: %v\", ds, err)\n\t}\n\n\t// If the DaemonSet is being deleted (either by foreground deletion or\n\t// orphan deletion), we cannot be sure if the DaemonSet history objects","sourceCodeStart":1305,"sourceCodeEnd":1341,"githubUrl":"https://github.com/kubernetes/kubernetes/blob/b882c60b4023bdf09264c2d5d30a2cadebc240fb/pkg/controller/daemon/daemon_controller.go#L1305-L1341","documentation":"Returned by syncDaemonSet when dsc.nodeLister.List(labels.Everything()) fails. The node list is required for every DS reconcile (to compute desired placement and to iterate nodes). When it fails the sync aborts for that DS. Node-Not-Found is not special-cased here -- any list error bubbles up.","triggerScenarios":"The node informer's cache returns an error on full list; cache not synced at controller start; indexer corruption. Triggered on every DS sync, so this tends to flood logs for every DS when it occurs.","commonSituations":"kube-controller-manager starting up before node informer sync completes; very large clusters where the node cache is slow to hydrate; memory pressure on the controller manager causing cache faults.","solutions":["Verify the node informer is synced (check kube-controller-manager readiness/liveness).","Scale/check kube-controller-manager memory if the cluster has many nodes.","If flooding all DSs, restart the controller-manager to rebuild caches.","Transient at startup -- suppress alert noise during the first minutes after a controller restart."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Confirm the node informer has synced:\n// if !dsc.nodeListerSynced() { /* wait; node list will be unreliable */ }","typeGuard":null,"tryCatchPattern":"// nodeList, err := dsc.nodeLister.List(labels.Everything())\n// if err != nil { return fmt.Errorf(\"...: %v\", err) } // requeue retries","preventionTips":["Ensure controller-manager readiness gate covers node informer sync.","Size controller-manager memory for the node count.","Expect transient flooding at startup; alert after the warm-up window."],"tags":["daemonset","node-lister","cache","informer"],"analyzedSha":"b882c60b4023bdf09264c2d5d30a2cadebc240fb","analyzedAt":"2026-08-07T04:07:48.144Z","schemaVersion":2},"datasetVersion":"2026-08-07T07:17:06.508Z"}