vitessio/vitess · error
missing value for 'rate'
Error message
missing value for 'rate'
What it means
servenv parses the --pprof-profile-flag value as comma-separated key=value pairs. When a segment is 'rate' with no '=' (SplitN yields one field), parseProfileFlag cannot determine the CPU profile rate and returns this error, aborting pprof initialization.
Source
Thrown at go/vt/servenv/pprof.go:107
p.rate = 1
case "trace":
p.mode = profileTrace
case "threads":
p.mode = profileThreads
case "goroutine":
p.mode = profileGoroutine
default:
return nil, fmt.Errorf("unknown profile mode: %q", pf[0])
}
for _, kv := range pf[1:] {
var err error
fields := strings.SplitN(kv, "=", 2)
switch fields[0] {
case "rate":
if len(fields) == 1 {
return nil, errors.New("missing value for 'rate'")
}
p.rate, err = strconv.Atoi(fields[1])
if err != nil {
return nil, fmt.Errorf("invalid profile rate %q: %v", fields[1], err)
}
case "path":
if len(fields) == 1 {
return nil, errors.New("missing value for 'path'")
}
p.path = fields[1]
case "quiet":
if len(fields) == 1 {
p.quiet = true
continue
}
View on GitHub (pinned to 01a25a7d17)
Solutions
- Set --pprof-profile-flag=rate=<int> (e.g. rate=1000)
- Remove the bare 'rate' token if you don't need a custom rate
- Check the flag value with ps/proc args to confirm what the process actually received
Example fix
// before --pprof-profile-flag=rate // after --pprof-profile-flag=rate=1000
Defensive patterns
Strategy: validation
Validate before calling
for _, kv := range strings.Split(profileFlag, ",") {
if strings.HasPrefix(kv, "rate") && !strings.Contains(kv, "=") {
return errors.New("pprof flag 'rate' needs a value: rate=<int>")
}
} Prevention
- Always write rate=<value>, never bare rate
- Quote the flag value in shell scripts so '=' and ',' survive
- Review resolved process args after deploys that touch profiling flags
When it happens
Trigger: Starting a server with --pprof-profile-flag=rate (or 'rate,quiet=...') — i.e. 'rate' present without '=value'.
Common situations: Typo'd flags like --pprof-profile-flag=rate instead of rate=100; shell scripts that strip the value during templating.
Understand the failure class
Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.
Related errors
- missing value for 'path'
- error parsing %s: %w
- unsupported profile mode
- --batch-size requires 'direct' ddl_strategy
- --batch-size conflicts with --uuid-list. Batching does not s
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/4aa050ee460e7dcb.
Report an issue: GitHub.