{"record":{"id":"95b4ed19abb8b072","repo":"kubernetes/kops","slug":"failed-parsing-set-data-s","errorCode":null,"errorMessage":"failed parsing --set data: %s","messagePattern":"failed parsing --set data: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/toolbox_template.go","lineNumber":258,"sourceCode":"\t\t}\n\t\tfor _, j := range list {\n\t\t\tcontent, err := os.ReadFile(j)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable to configuration file: %s, error: %s\", j, err)\n\t\t\t}\n\n\t\t\tctx := make(map[string]interface{})\n\t\t\tif err := utils.YamlUnmarshal(content, &ctx); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable decode the configuration file: %s, error: %v\", j, err)\n\t\t\t}\n\t\t\tcontext = mergeMaps(context, ctx)\n\t\t}\n\t}\n\n\t// User specified a value via --set\n\tfor _, value := range values {\n\t\tif err := helmstrvals.ParseInto(value, context); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed parsing --set data: %s\", err)\n\t\t}\n\t}\n\n\t// User specified a value via --set-string\n\tfor _, value := range stringValues {\n\t\tif err := helmstrvals.ParseIntoString(value, context); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed parsing --set-string data: %s\", err)\n\t\t}\n\t}\n\n\treturn context, nil\n}\n\n// expandFiles is responsible for resolving any references to directories\nfunc expandFiles(path string) ([]string, error) {\n\t// @check if the path is a directory, if not we can return straight away\n\tstat, err := os.Stat(path)\n\tif err != nil {","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/toolbox_template.go#L240-L276","documentation":"Raised in newTemplateContext when a value passed via --set cannot be parsed by helmstrvals.ParseInto. The offending string is not valid Helm-style set syntax (e.g. unbalanced braces or bad dot/key syntax), so the template context cannot be built.","triggerScenarios":"Running `kops toolbox template --set foo` (no '='), `--set a=b=c` in an invalid form, or unbalanced braces/brackets in nested syntax like `a.b=c` or `a={1,2}`.","commonSituations":"Forgetting '=' between key and value; unquoted values containing commas or braces; spaces inside --set expressions; shell eating quotes.","solutions":["Ensure each --set argument is key=value form: `--set key=value`.","Quote values with special characters: `--set key='a,b'`.","Use nested dot notation correctly: `--set a.b=c`, and lists via `--set a[0]=x`."],"exampleFix":"// before\nkops toolbox template --set replicas\n// after\nkops toolbox template --set replicas=3","handlingStrategy":"validation","validationCode":"for _, v := range setArgs {\n  if !strings.Contains(v, \"=\") { return fmt.Errorf(\"invalid --set %q: expected key=value\", v) }\n}","typeGuard":null,"tryCatchPattern":"out, err := exec.Command(\"kops\", \"toolbox\", \"template\", \"--set\", v, ...).CombinedOutput()\nif strings.Contains(string(out), \"failed parsing --set data\") { fix key=value syntax and retry }","preventionTips":["Always use key=value form for --set","Quote values containing commas, braces or spaces","Test --set expressions in isolation before scripting"],"tags":["cli","helm","parsing"],"backgroundTag":"helm-set-parse-error","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"}