{"record":{"id":"b79ed664823d86e1","repo":"vitessio/vitess","slug":"invalid-int64-value-for-v-v","errorCode":null,"errorMessage":"invalid int64 value for %v: %v","messagePattern":"invalid int64 value for (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"go/vt/vttablet/tabletserver/debugenv.go","lineNumber":119,"sourceCode":"\t\treturn nil\n\t}\n\n\tsetIntValCtx := func(f func(context.Context, int) error) error {\n\t\tival, err := strconv.Atoi(value)\n\t\tif err == nil {\n\t\t\terr = f(r.Context(), ival)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed setting value for %v: %v\", varname, err)\n\t\t}\n\t\tmsg = fmt.Sprintf(\"Setting %v to: %v\", varname, value)\n\t\treturn nil\n\t}\n\n\tsetInt64Val := func(f func(int64)) error {\n\t\tival, err := strconv.ParseInt(value, 10, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid int64 value for %v: %v\", varname, err)\n\t\t}\n\t\tf(ival)\n\t\tmsg = fmt.Sprintf(\"Setting %v to: %v\", varname, value)\n\t\treturn nil\n\t}\n\n\tsetDurationVal := func(f func(time.Duration)) error {\n\t\tdurationVal, err := time.ParseDuration(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid duration value for %v: %v\", varname, err)\n\t\t}\n\t\tf(durationVal)\n\t\tmsg = fmt.Sprintf(\"Setting %v to: %v\", varname, value)\n\t\treturn nil\n\t}\n\n\tsetFloat64Val := func(f func(float64)) error {\n\t\tfval, err := strconv.ParseFloat(value, 64)","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletserver/debugenv.go#L101-L137","documentation":"This error comes from the tabletserver debug environment variable handler (debugenv.go). When an operator requests a runtime variable update through the debug env endpoint, the new value must parse as an int64 via strconv.ParseInt. If parsing fails, the handler wraps the parse error with the variable name and returns it to the caller.","triggerScenarios":"POST/GET to the tabletserver /debug/env (settable variable) endpoint with a variable handled by setInt64Val whose value string is not a valid base-10 int64 (e.g. 'abc', '1.5', '99999999999999999999', empty string, or a value with units like '100m').","commonSituations":"Automation scripts or curl commands writing debug vars with quoted or suffixed values ('128M' instead of 134217728); float or bool values passed where an integer is required; locale/whitespace contamination in the value.","solutions":["Check the value being sent parses with strconv.ParseInt(value, 10, 64); fix the payload","Convert durations or sizes to plain integer form (e.g. 134217728 instead of '128M') before sending","Retry with a valid integer literal; the wrapped strconv error in the message names the exact parse failure"],"exampleFix":"// before\ncurl 'host:port/debug/env?var=TransactionTimeout&value=30s'\n// after\ncurl 'host:port/debug/env?var=TransactionTimeout&value=30000000000'","handlingStrategy":"validation","validationCode":"n, err := strconv.ParseInt(value, 10, 64)\nif err != nil { return fmt.Errorf(\"invalid int64 for %s: %w\", varname, err) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always send plain base-10 integer strings to /debug/env int64 vars","No units, commas, floats, or whitespace in the value","Sanitize automation inputs before calling the debug endpoint"],"tags":["parsing","int64","debug-env","tabletserver"],"backgroundTag":"invalid-integer-parsing","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}