{"record":{"id":"6dc05e2f89bd9dd5","repo":"vitessio/vitess","slug":"error-parsing-s-w","errorCode":null,"errorMessage":"error parsing %s: %w","messagePattern":"error parsing (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtadmin/cluster/flags.go","lineNumber":171,"sourceCode":"\t\t\t}\n\n\t\t\tcfg.VtSQLFlags[strings.TrimPrefix(name, \"vtsql-\")] = val\n\t\tcase strings.HasPrefix(name, \"vtctld-\"):\n\t\t\tif cfg.VtctldFlags == nil {\n\t\t\t\tcfg.VtctldFlags = map[string]string{}\n\t\t\t}\n\n\t\t\tcfg.VtctldFlags[strings.TrimPrefix(name, \"vtctld-\")] = val\n\t\tcase strings.HasPrefix(name, \"backup-read-pool-\"):\n\t\t\tif cfg.BackupReadPoolConfig == nil {\n\t\t\t\tcfg.BackupReadPoolConfig = &RPCPoolConfig{\n\t\t\t\t\tSize:        -1,\n\t\t\t\t\tWaitTimeout: -1,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif err := cfg.BackupReadPoolConfig.parseFlag(strings.TrimPrefix(name, \"backup-read-pool-\"), val); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error parsing %s: %w\", name, err)\n\t\t\t}\n\t\tcase strings.HasPrefix(name, \"schema-read-pool-\"):\n\t\t\tif cfg.SchemaReadPoolConfig == nil {\n\t\t\t\tcfg.SchemaReadPoolConfig = &RPCPoolConfig{\n\t\t\t\t\tSize:        -1,\n\t\t\t\t\tWaitTimeout: -1,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif err := cfg.SchemaReadPoolConfig.parseFlag(strings.TrimPrefix(name, \"schema-read-pool-\"), val); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error parsing %s: %w\", name, err)\n\t\t\t}\n\t\tcase strings.HasPrefix(name, \"topo-read-pool-\"):\n\t\t\tif cfg.TopoReadPoolConfig == nil {\n\t\t\t\tcfg.TopoReadPoolConfig = &RPCPoolConfig{\n\t\t\t\t\tSize:        -1,\n\t\t\t\t\tWaitTimeout: -1,\n\t\t\t\t}","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtadmin/cluster/flags.go#L153-L189","documentation":"VTAdmin's cluster flag parser maps flags like backup-read-pool-* onto RPCPoolConfig.parseFlag. When that sub-parser fails to parse a value (e.g. a non-numeric \"size\" or a negative pool size), parseOne wraps the underlying error with the full flag name for context.","triggerScenarios":"Passing a value like \"--backup-read-pool-size=ten\" or \"--backup-read-pool-timeout=5s\" (timeout expects a numeric value) to the vtadmin cluster flag parser, which calls RPCPoolConfig.parseFlag with \"size\"/\"timeout\".","commonSituations":"Typos or unit suffixes in pool size values; setting size to a negative number (rejected with strconv.ErrRange); quoting issues that leave stray characters in the value.","solutions":["Pass plain integers for size/timeout, e.g. --backup-read-pool-size=20 --backup-read-pool-timeout=3000","Check the wrapped strconv error in the message to see which value failed","Ensure pool sizes are non-negative and within int range"],"exampleFix":"// before\nvtadmin-cluster --backup-read-pool-size=10k\n// after\nvtadmin-cluster --backup-read-pool-size=10000","handlingStrategy":"validation","validationCode":"func validPoolValue(v string) error {\n\tn, err := strconv.Atoi(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif n < 0 {\n\t\treturn fmt.Errorf(\"pool size must be non-negative; got %d\", n)\n\t}\n\treturn nil\n}\n// check before invoking the flag parser: validPoolValue(\"20\")","typeGuard":null,"tryCatchPattern":"if err := parseFlag(cfg, value); err != nil {\n\tvar numErr *strconv.NumError\n\tif errors.As(err, &numErr) {\n\t\tlog.Errorf(\"bad integer in flag %s: %v\", value, numErr)\n\t}\n\treturn err\n}","preventionTips":["Pass plain integers without unit suffixes for pool size/timeout","Never set pool sizes to negative numbers","Verify shell/env substitution does not inject empty or partial values","Test the full comma-separated flag string locally before rollout"],"tags":["go","vtadmin","flags","config","parsing"],"backgroundTag":"flag-parsing-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}