{"record":{"id":"d5e9a746e21feb47","repo":"vitessio/vitess","slug":"parse-error","errorCode":null,"errorMessage":"parse error","messagePattern":"parse error","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/flagutil/optional.go","lineNumber":173,"sourceCode":"\nfunc (f *OptionalFlagValue[T]) IsSet() bool {\n\treturn f.set\n}\n\n// NewOptionalFloat64 returns an *OptionalFloat64 with the specified default value.\nfunc NewOptionalFloat64(val float64) *OptionalFloat64 {\n\treturn &OptionalFloat64{val: val}\n}\n\n// NewOptionalString returns an *OptionalString with the specified default value.\nfunc NewOptionalString(val string) *OptionalString {\n\treturn &OptionalString{val: val}\n}\n\n// lifted directly from package flag to make the behavior of numeric parsing\n// consistent with the standard library for our custom optional types.\nvar (\n\terrParse = errors.New(\"parse error\")\n\terrRange = errors.New(\"value out of range\")\n)\n\n// lifted directly from package flag to make the behavior of numeric parsing\n// consistent with the standard library for our custom optional types.\nfunc numError(err error) error {\n\tne, ok := err.(*strconv.NumError)\n\tif !ok {\n\t\treturn err\n\t}\n\n\tswitch ne.Err {\n\tcase strconv.ErrSyntax:\n\t\treturn errParse\n\tcase strconv.ErrRange:\n\t\treturn errRange\n\tdefault:\n\t\treturn err","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/flagutil/optional.go#L155-L191","documentation":"Generic parse error surfaced by OptionalFlagValue when the underlying parse function rejects the string passed on the command line. The wrapped detail identifies the expected type; supply a value matching the flag's constructor type.","triggerScenarios":"Calling Cluster.GetVtctlds when the discovery backend fails: topo server unreachable, discovery misconfigured (wrong cells/paths), or topo errors during listing.","commonSituations":"etcd/zookeeper outage; vtadmin pointed at wrong topo address; discovery implementation configured for cells that don't exist; auth failures against topo.","solutions":["Check the wrapped cause: verify topo server connectivity from vtadmin","Fix vtadmin's discovery/topo configuration (cells, topo address, auth)","Retry after topo server recovery; check vtctld registrations exist in the topo"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check topo reachability first\nconn, err := net.DialTimeout(\"tcp\", topoAddr, 2*time.Second)\nif err != nil { return fmt.Errorf(\"topo unreachable: %w\", err) }\nconn.Close()","typeGuard":null,"tryCatchPattern":"vtctlds, err := cluster.GetVtctlds(ctx)\nif err != nil {\n\tif errors.Is(err, context.DeadlineExceeded) { /* topo down: retry/fallback to cached list */ }\n\tlog.Printf(\"discovery failed: %v\", err)\n}","preventionTips":["Validate topo server address/cells in vtadmin config at startup","Monitor topo server health","Cache the last-known vtctld list as a fallback"],"tags":["vtadmin","discovery","topology","vtctld"],"backgroundTag":"discovery-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}