helm/helm · error
invalid dry-run value (%q). Must be "none", "server", or "cl
Error message
invalid dry-run value (%q). Must be "none", "server", or "client"
What it means
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.
Source
Thrown at pkg/cmd/helpers.go:67
switch v {
case f.NoOptDefVal:
slog.Warn(`--dry-run is deprecated and should be replaced with '--dry-run=client'`)
return action.DryRunClient, nil
case string(action.DryRunClient):
return action.DryRunClient, nil
case string(action.DryRunServer):
return action.DryRunServer, nil
case string(action.DryRunNone):
if isTemplate {
// Special case hack for `helm template`, which is always a dry run
return action.DryRunNone, fmt.Errorf(`invalid dry-run value (%q). Must be "server" or "client"`, v)
}
return action.DryRunNone, nil
}
b, err := strconv.ParseBool(v)
if err != nil {
return action.DryRunNone, fmt.Errorf(`invalid dry-run value (%q). Must be "none", "server", or "client"`, v)
}
if isTemplate && !b {
// Special case for `helm template`, which is always a dry run
return action.DryRunNone, fmt.Errorf(`invalid dry-run value (%q). Must be "server" or "client"`, v)
}
result := action.DryRunNone
if b {
result = action.DryRunClient
}
slog.Warn(fmt.Sprintf(`boolean '--dry-run=%v' flag is deprecated and must be replaced with '--dry-run=%s'`, v, result))
return result, nil
}
View on GitHub (pinned to 2a29f1770b)
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
Example fix
# before
helm install myrel ./chart --dry-run=yes
# error: invalid dry-run value ("yes"). Must be "none", "server", or "client"
# after
helm install myrel ./chart --dry-run=client Defensive patterns
Strategy: validation
Validate before calling
func validateDryRunValue(v string) error {
switch v {
case "none", "server", "client", "true", "false":
return nil
}
if _, err := strconv.ParseBool(v); err == nil {
return nil // 1/0/t/f style legacy values
}
return fmt.Errorf("invalid --dry-run=%q; want none, server, or client", v)
} Prevention
- 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
When it happens
Trigger: `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.
Common situations: 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).
Related errors
- invalid dry-run value (%q). Must be "server" or "client"
- must either provide a name or specify --generate-name
- hiding Kubernetes secrets requires a dry-run mode
- invalid format type
- cannot specify --post-renderer flag more than once
AI-assisted analysis of helm/helm@2a29f1770b (2026-08-15).
Data as JSON: /api/errors/6da5e4247cf650ae.
Report an issue: GitHub.