{"record":{"id":"69f51d8b3157170f","repo":"GoogleContainerTools/skaffold","slug":"unable-to-retrieve-node-s-images-w","errorCode":null,"errorMessage":"unable to retrieve node's images: %w","messagePattern":"unable to retrieve node's images: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/kubernetes/loader/load.go","lineNumber":145,"sourceCode":"\toutput.Default.Fprintln(out, \"Loading images into k3d cluster nodes...\")\n\treturn i.loadImages(ctx, out, artifacts, func(tag string) *exec.Cmd {\n\t\treturn exec.CommandContext(ctx, \"k3d\", \"image\", \"import\", \"--cluster\", k3dCluster, tag)\n\t})\n}\n\nfunc (i *ImageLoader) loadImages(ctx context.Context, out io.Writer, artifacts []graph.Artifact, createCmd func(tag string) *exec.Cmd) error {\n\tstart := time.Now()\n\n\tvar knownImages []string\n\n\tfor _, artifact := range artifacts {\n\t\toutput.Default.Fprintf(out, \" - %s -> \", artifact.Tag)\n\n\t\t// Only load images that are unknown to the node\n\t\tif knownImages == nil {\n\t\t\tvar err error\n\t\t\tif knownImages, err = findKnownImages(ctx, i.cli); err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to retrieve node's images: %w\", err)\n\t\t\t}\n\t\t}\n\t\tnormalizedImageRef, err := reference.ParseNormalizedNamed(artifact.Tag)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif stringslice.Contains(knownImages, normalizedImageRef.String()) {\n\t\t\toutput.Green.Fprintln(out, \"Found\")\n\t\t\tcontinue\n\t\t}\n\n\t\tcmd := createCmd(artifact.Tag)\n\t\tif cmdOut, err := util.RunCmdOut(ctx, cmd); err != nil {\n\t\t\toutput.Red.Fprintln(out, \"Failed\")\n\t\t\treturn fmt.Errorf(\"unable to load image %q into cluster: %w, %s\", artifact.Tag, err, cmdOut)\n\t\t}\n\n\t\toutput.Green.Fprintln(out, \"Loaded\")","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/kubernetes/loader/load.go#L127-L163","documentation":"loadImages lists the images already present on the target cluster's nodes via findKnownImages (a kubectl get nodes jsonpath query) so it can skip images the nodes already have. This error wraps a failure of that kubectl query — the cluster is unreachable, kubectl is misconfigured, or the API call fails.","triggerScenarios":"Any skaffold load into a kind/k3d cluster where findKnownImages' `kubectl get nodes -ojsonpath=...` fails: cluster unreachable, kubeconfig context invalid, nodes NotReady, or RBAC denying node read.","commonSituations":"Cluster not yet started (kind/k3d still bootstrapping) when dev runs; kubeContext pointing at the wrong kubeconfig file; a restricted user without permission to list nodes; network/VPN preventing access to the API server.","solutions":["Run `kubectl get nodes` with the same context to reproduce the error directly","Confirm the cluster is fully started (kind/k3d can still be initializing right after creation); retry after it is Ready","Check kubeconfig: `kubectl config current-context` and KUBECONFIG env var pointing to the right file","Verify RBAC allows reading nodes (`kubectl auth can-i get nodes`)","Inspect the wrapped error for connectivity issues (API server address, proxy/VPN)"],"exampleFix":"// before: KUBECONFIG points to a stale file\nexport KUBECONFIG=~/.kube/old-config\n// after\nexport KUBECONFIG=~/.kube/config && kubectl config use-context kind-kind && skaffold dev","handlingStrategy":"validation","validationCode":"// Check cluster reachability before loading images\ncmd := exec.Command(\"kubectl\", \"get\", \"nodes\")\nif err := cmd.Run(); err != nil {\n    return fmt.Errorf(\"cluster unreachable, fix kubeconfig before image load: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := loader.LoadImages(ctx, out, artifacts)\nif err != nil {\n    if strings.Contains(err.Error(), \"unable to retrieve node's images\") {\n        log.Warnf(\"cannot list node images, will reload everything: %v\", err)\n        // proceed by forcing the load command for each artifact\n    }\n    return err\n}","preventionTips":["Wait for cluster readiness (all nodes Ready) before skaffold dev","Verify `kubectl get nodes` works with the exact context skaffold uses","Keep kubeconfig credentials fresh (auto-refresh tokens / periodic get-credentials)"],"tags":["kubernetes","kubectl","image-loading","cluster-connectivity"],"backgroundTag":"kubectl-node-query-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}