{"record":{"id":"6da5e4247cf650ae","repo":"helm/helm","slug":"invalid-dry-run-value-q-must-be-none-serve","errorCode":null,"errorMessage":"invalid dry-run value (%q). Must be \"none\", \"server\", or \"client\"","messagePattern":"invalid dry-run value \\(%q\\)\\. Must be \"none\", \"server\", or \"client\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/helpers.go","lineNumber":67,"sourceCode":"\tswitch v {\n\tcase f.NoOptDefVal:\n\t\tslog.Warn(`--dry-run is deprecated and should be replaced with '--dry-run=client'`)\n\t\treturn action.DryRunClient, nil\n\tcase string(action.DryRunClient):\n\t\treturn action.DryRunClient, nil\n\tcase string(action.DryRunServer):\n\t\treturn action.DryRunServer, nil\n\tcase string(action.DryRunNone):\n\t\tif isTemplate {\n\t\t\t// Special case hack for `helm template`, which is always a dry run\n\t\t\treturn action.DryRunNone, fmt.Errorf(`invalid dry-run value (%q). Must be \"server\" or \"client\"`, v)\n\t\t}\n\t\treturn action.DryRunNone, nil\n\t}\n\n\tb, err := strconv.ParseBool(v)\n\tif err != nil {\n\t\treturn action.DryRunNone, fmt.Errorf(`invalid dry-run value (%q). Must be \"none\", \"server\", or \"client\"`, v)\n\t}\n\n\tif isTemplate && !b {\n\t\t// Special case for `helm template`, which is always a dry run\n\t\treturn action.DryRunNone, fmt.Errorf(`invalid dry-run value (%q). Must be \"server\" or \"client\"`, v)\n\t}\n\n\tresult := action.DryRunNone\n\tif b {\n\t\tresult = action.DryRunClient\n\t}\n\tslog.Warn(fmt.Sprintf(`boolean '--dry-run=%v' flag is deprecated and must be replaced with '--dry-run=%s'`, v, result))\n\n\treturn result, nil\n}\n","sourceCodeStart":49,"sourceCodeEnd":83,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/cmd/helpers.go#L49-L83","documentation":"The --dry-run parser first matches the literal strings none/server/client, then falls back to strconv.ParseBool for backwards compatibility (true/false and 1/0/t/f with a deprecation warning). This error fires when the value is neither a known literal nor a parseable boolean, so it can only be a typo or unsupported spelling.","triggerScenarios":"`helm install ... --dry-run=yes`, `--dry-run=server-side`, `--dry-run=Server` (literals are lowercase, and ParseBool rejects mixed case like 'Server'), or any invented value.","commonSituations":"Typos and case mismatches; users pasting kubectl-style values; scripts generating the flag value dynamically (e.g. empty or interpolated strings that are not valid booleans).","solutions":["Use one of the literal values: --dry-run=none, --dry-run=client, or --dry-run=server","Legacy booleans still work but warn: --dry-run=true (becomes client) or --dry-run=false (becomes none)","Check for stray whitespace or case in dynamically generated flag values"],"exampleFix":"# before\nhelm install myrel ./chart --dry-run=yes\n# error: invalid dry-run value (\"yes\"). Must be \"none\", \"server\", or \"client\"\n\n# after\nhelm install myrel ./chart --dry-run=client","handlingStrategy":"validation","validationCode":"func validateDryRunValue(v string) error {\n    switch v {\n    case \"none\", \"server\", \"client\", \"true\", \"false\":\n        return nil\n    }\n    if _, err := strconv.ParseBool(v); err == nil {\n        return nil // 1/0/t/f style legacy values\n    }\n    return fmt.Errorf(\"invalid --dry-run=%q; want none, server, or client\", v)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin new code to the literals none/server/client; treat booleans as legacy","When generating the flag from a variable, default it to \"client\" when empty"],"tags":["cli","flags","dry-run","validation"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}