{"record":{"id":"4aa050ee460e7dcb","repo":"vitessio/vitess","slug":"missing-value-for-rate","errorCode":null,"errorMessage":"missing value for 'rate'","messagePattern":"missing value for 'rate'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/servenv/pprof.go","lineNumber":107,"sourceCode":"\t\tp.rate = 1\n\tcase \"trace\":\n\t\tp.mode = profileTrace\n\tcase \"threads\":\n\t\tp.mode = profileThreads\n\tcase \"goroutine\":\n\t\tp.mode = profileGoroutine\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown profile mode: %q\", pf[0])\n\t}\n\n\tfor _, kv := range pf[1:] {\n\t\tvar err error\n\t\tfields := strings.SplitN(kv, \"=\", 2)\n\n\t\tswitch fields[0] {\n\t\tcase \"rate\":\n\t\t\tif len(fields) == 1 {\n\t\t\t\treturn nil, errors.New(\"missing value for 'rate'\")\n\t\t\t}\n\t\t\tp.rate, err = strconv.Atoi(fields[1])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid profile rate %q: %v\", fields[1], err)\n\t\t\t}\n\n\t\tcase \"path\":\n\t\t\tif len(fields) == 1 {\n\t\t\t\treturn nil, errors.New(\"missing value for 'path'\")\n\t\t\t}\n\t\t\tp.path = fields[1]\n\n\t\tcase \"quiet\":\n\t\t\tif len(fields) == 1 {\n\t\t\t\tp.quiet = true\n\t\t\t\tcontinue\n\t\t\t}\n","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/servenv/pprof.go#L89-L125","documentation":"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.","triggerScenarios":"Starting a server with --pprof-profile-flag=rate (or 'rate,quiet=...') — i.e. 'rate' present without '=value'.","commonSituations":"Typo'd flags like --pprof-profile-flag=rate instead of rate=100; shell scripts that strip the value during templating.","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"],"exampleFix":"// before\n--pprof-profile-flag=rate\n// after\n--pprof-profile-flag=rate=1000","handlingStrategy":"validation","validationCode":"for _, kv := range strings.Split(profileFlag, \",\") {\n    if strings.HasPrefix(kv, \"rate\") && !strings.Contains(kv, \"=\") {\n        return errors.New(\"pprof flag 'rate' needs a value: rate=<int>\")\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["go","servenv","pprof","flags","parsing"],"backgroundTag":"invalid-flag-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}