{"record":{"id":"dbb1cb4a77294554","repo":"kubernetes/kops","slug":"parsing-additional-containerd-config-entry-q-w","errorCode":null,"errorMessage":"parsing additional containerd config entry %q: %w","messagePattern":"parsing additional containerd config entry %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/containerd.go","lineNumber":580,"sourceCode":"// Each key is parsed as a CSV record using '.' as the separator, so quoted dots inside\n// plugin names like `plugins.\"io.containerd.grpc.v1.cri\".sandbox_image` survive the split.\n// Paths are written verbatim; the user is responsible for matching the schema version of\n// the configured containerd binary (v3 vs v4).\n// Keys are applied in sorted order so output is reproducible across runs.\nfunc applyConfigAdditions(config *tomlwriter.Tree, additions map[string]intstr.IntOrString) error {\n\tkeys := make([]string, 0, len(additions))\n\tfor k := range additions {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\n\tfor _, k := range keys {\n\t\tv := additions[k]\n\t\tr := csv.NewReader(strings.NewReader(k))\n\t\tr.Comma = '.'\n\t\tpath, err := r.Read()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"parsing additional containerd config entry %q: %w\", k, err)\n\t\t}\n\n\t\tif v.Type == intstr.Int {\n\t\t\tconfig.SetPath(path, int64(v.IntValue()))\n\t\t\tcontinue\n\t\t}\n\t\tswitch s := v.String(); s {\n\t\tcase \"true\":\n\t\t\tconfig.SetPath(path, true)\n\t\tcase \"false\":\n\t\t\tconfig.SetPath(path, false)\n\t\tdefault:\n\t\t\tconfig.SetPath(path, s)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/containerd.go#L562-L598","documentation":"applyConfigAdditions (nodeup/pkg/model/containerd.go:580) parses each user-provided ConfigAdditions key as a CSV record with '.' as the delimiter, so dotted plugin names can be quoted. This error is raised when csv.Reader.Read() fails on a key — typically malformed quoting (unclosed or stray double-quote characters) in the key string. The %q shows the exact offending entry.","triggerScenarios":"A ConfigAdditions map key contains a bare or unbalanced '\"' character, e.g. plugins.\"io.containerd.grpc.v1.cri.sandbox_image (missing closing quote) — the CSV reader returns ErrBareQuote / ErrQuote and the key cannot be split into a TOML path.","commonSituations":"Users edit spec.containerd.configAdditions in the cluster manifest by hand and mistype the quote placement around dotted containerd plugin names; older examples copied from containerd v1 docs use the old grpc plugin path with wrong quoting.","solutions":["Look at the %q key in the error and find the quote mistake","Wrap every dotted plugin name in its own double quotes: plugins.\"io.containerd.cri.v1.runtime\".enable_selinux","Ensure quotes are balanced — no stray leading/trailing quote on the whole key","Test the key locally: strings.Split equivalent via encoding/csv with Comma='.' should yield the expected path segments"],"exampleFix":"// before\n\"plugins.\"io.containerd.cri.v1.runtime\".enable_selinux: true\"  // stray outer quotes\n// after\nplugins.\"io.containerd.cri.v1.runtime\".enable_selinux: true","handlingStrategy":"validation","validationCode":"func validConfigAdditionsKey(k string) error {\n    r := csv.NewReader(strings.NewReader(k))\n    r.Comma = '.'\n    _, err := r.Read()\n    return err\n}\n// run over every spec.containerd.configAdditions key before kops update","typeGuard":null,"tryCatchPattern":"path, err := r.Read()\nif err != nil {\n    return fmt.Errorf(\"parsing additional containerd config entry %q: %w\", k, err)\n}\n// inspect %q and errors.Is(err, csv.ErrBareQuote|csv.ErrQuote) to pinpoint the quoting flaw","preventionTips":["Never leave a double-quote unbalanced in a configAdditions key","Copy key formats from the kops docs for the exact containerd version in use","Pre-commit lint the cluster manifest for configAdditions key syntax","Use kops toolbox / dry-run rendering to catch bad keys before node provisioning"],"tags":["containerd","config","parsing","csv"],"backgroundTag":"malformed-config-key","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}