{"record":{"id":"ea9e46f2a08875de","repo":"vitessio/vitess","slug":"errrange","errorCode":"ErrRange","errorMessage":"%w: backfill queue size must be non-negative; got %d","messagePattern":"%w: backfill queue size must be non-negative; got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtadmin/cluster/config.go","lineNumber":354,"sourceCode":"\nfunc parseCacheConfigFlag(cfg *cache.Config, name, val string) (err error) {\n\tswitch name {\n\tcase \"default-expiration\":\n\t\tcfg.DefaultExpiration, err = time.ParseDuration(val)\n\tcase \"cleanup-interval\":\n\t\tcfg.CleanupInterval, err = time.ParseDuration(val)\n\tcase \"backfill-request-ttl\":\n\t\tcfg.BackfillRequestTTL, err = time.ParseDuration(val)\n\tcase \"backfill-request-duplicate-interval\":\n\t\tcfg.BackfillRequestDuplicateInterval, err = time.ParseDuration(val)\n\tcase \"backfill-queue-size\":\n\t\tcfg.BackfillQueueSize, err = strconv.Atoi(val)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif cfg.BackfillQueueSize < 0 {\n\t\t\treturn fmt.Errorf(\"%w: backfill queue size must be non-negative; got %d\", strconv.ErrRange, cfg.BackfillQueueSize)\n\t\t}\n\tcase \"backfill-enqueue-wait-time\":\n\t\tcfg.BackfillEnqueueWaitTime, err = time.ParseDuration(val)\n\tdefault:\n\t\treturn errors.ErrNoFlag\n\t}\n\n\treturn err\n}\n\n// RPCPoolConfig holds configuration options for creating RPCPools.\ntype RPCPoolConfig struct {\n\tSize        int           `json:\"size\"`\n\tWaitTimeout time.Duration `json:\"wait_timeout\"`\n}\n\n// NewRWPool returns an RPCPool from the given config that should be used for\n// performing read-write operations. If the config is nil, or has a non-positive","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtadmin/cluster/config.go#L336-L372","documentation":"parseCacheConfigFlag validates the backfill-queue-size cluster config flag. After strconv.Atoi succeeds, a negative value is rejected and reported by wrapping strconv.ErrRange, so callers can errors.Is(err, strconv.ErrRange). This keeps cache backfill queue configuration within valid bounds.","triggerScenarios":"Setting the vtadmin cluster config flag backfill-queue-size to a negative integer (e.g. backfill-queue-size=-1) via the cluster config file or the --cluster-cache flags parsed by parseOne.","commonSituations":"Copy-paste config mistakes with a leading minus sign; templated configs where a variable interpolates to a negative or '-' placeholder; misunderstanding that 0 (disable backfill) is the minimum valid value.","solutions":["Set backfill-queue-size to a non-negative integer (0 disables backfill)","Check the cluster config file/flag source for an accidental '-' or unexpanded variable","If dynamic, clamp the value before applying config: max(0, n)"],"exampleFix":"// before (config flag)\n--cluster-to-server --backfill-queue-size=-1\n// after\n--backfill-queue-size=100  // or 0 to disable","handlingStrategy":"validation","validationCode":"if n, err := strconv.Atoi(val); err != nil || n < 0 {\n    return fmt.Errorf(\"backfill-queue-size must be a non-negative integer, got %q\", val)\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    if errors.Is(err, strconv.ErrRange) {\n        // fix config before starting vtadmin\n    }\n}","preventionTips":["Validate numeric config flags are non-negative at deploy time","Use 0 explicitly to disable backfill rather than negative sentinels","Check templated configs for unexpanded or negative variables"],"tags":["vtadmin","configuration","validation","strconv"],"backgroundTag":"invalid-config-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}