{"record":{"id":"cb3742c05f17dd90","repo":"kubernetes/kops","slug":"error-listing-etc-containerd-v","errorCode":null,"errorMessage":"error listing /etc/containerd: %v","messagePattern":"error listing /etc/containerd: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/dump/dumper.go","lineNumber":505,"sourceCode":"\tif err := n.shellToFile(ctx, \"cat /etc/hosts\", filepath.Join(n.dir, \"etchosts\")); err != nil {\n\t\terrors = append(errors, err)\n\t}\n\tif err := n.shellToFile(ctx, \"sysctl -a\", filepath.Join(n.dir, \"sysctls\")); err != nil {\n\t\terrors = append(errors, err)\n\t}\n\n\tif err := n.shellToFile(ctx, \"cat /var/lib/kubelet/kubelet.conf\", filepath.Join(n.dir, \"kubelet.conf\")); err != nil {\n\t\terrors = append(errors, err)\n\t}\n\n\tif err := n.shellToFile(ctx, \"cat /proc/modules\", filepath.Join(n.dir, \"modules\")); err != nil {\n\t\terrors = append(errors, err)\n\t}\n\n\t// Capture containerd configuration files (config.toml, CNI templates, certs.d hosts.toml).\n\tcontainerdFiles, err := n.findFiles(ctx, \"/etc/containerd\")\n\tif err != nil {\n\t\terrors = append(errors, fmt.Errorf(\"error listing /etc/containerd: %v\", err))\n\t}\n\tfor _, f := range containerdFiles {\n\t\tif !strings.HasSuffix(f, \".toml\") && !strings.HasSuffix(f, \".template\") {\n\t\t\tcontinue\n\t\t}\n\t\trel := strings.TrimPrefix(f, \"/etc/containerd/\")\n\t\tdest := filepath.Join(n.dir, \"containerd\", rel)\n\t\tcmd := \"sudo cat '\" + strings.ReplaceAll(f, \"'\", `'\\''`) + \"'\"\n\t\tif err := n.shellToFile(ctx, cmd, dest); err != nil {\n\t\t\terrors = append(errors, err)\n\t\t}\n\t}\n\n\treturn errors\n}\n\n// findFiles lists files under the specified directory (recursively)\nfunc (n *logDumperNode) findFiles(ctx context.Context, dir string) ([]string, error) {","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/dump/dumper.go#L487-L523","documentation":"Accumulated by logDumperNode.dump (pkg/dump/dumper.go:505) when n.findFiles(ctx, \"/etc/containerd\") fails. This step lists containerd configuration files (config.toml, CNI templates, certs.d hosts.toml) on the node so their .toml/.template files can be copied into the artifacts. The failure is logged as a warning and the rest of the dump proceeds without containerd configs.","triggerScenarios":"ExecPiped of `sudo find /etc/containerd -type f -print0` errors: the directory does not exist (docker-based or non-containerd node), find exits non-zero because of the missing path, the SSH session drops, or the nodeDumpTimeout context expires before the command completes.","commonSituations":"Clusters still using the docker runtime (pre-containerd kOps versions) or custom runtime layouts where /etc/containerd is absent; upgrading a cluster where some nodes run containerd and others do not; transient SSH failures mid-dump.","solutions":["Confirm the node actually uses containerd: `ssh <node> ls /etc/containerd`; on docker-runtime nodes this warning is expected and can be ignored.","SSH in and run `sudo find /etc/containerd -type f -print0` to capture the real error (exit code, permissions).","If the timeout is the cause, increase --node-dump-timeout.","Re-run the dump if the failure was transient (session drop); the per-node dump is idempotent.","Ensure sudo works non-interactively on the node (NOPASSWD) — a sudo password prompt over the piped session surfaces as a command failure."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// only list containerd config when containerd is in use\nif err := client.ExecPiped(ctx, \"test -d /etc/containerd\", io.Discard, io.Discard); err != nil {\n    klog.V(2).Infof(\"no /etc/containerd on node; skipping containerd config dump\")\n}","typeGuard":null,"tryCatchPattern":"containerdFiles, err := n.findFiles(ctx, \"/etc/containerd\")\nif err != nil {\n    klog.Warningf(\"containerd config capture skipped: %v\", err)\n    containerdFiles = nil\n}","preventionTips":["Skip the /etc/containerd listing on docker-runtime nodes.","Confirm containerd runtime in cluster spec before expecting these artifacts.","Keep sudo NOPASSWD configured for non-interactive find execution."],"tags":["ssh","containerd","node-dump","go"],"backgroundTag":"remote-command-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}