{"record":{"id":"470ef9a9d3954627","repo":"vitessio/vitess","slug":"value-out-of-range","errorCode":null,"errorMessage":"value out of range","messagePattern":"value out of range","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/flagutil/optional.go","lineNumber":174,"sourceCode":"func (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\n\t}","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/flagutil/optional.go#L156-L192","documentation":"Cluster.FindWorkflow (or similar) expects exactly one workflow matching the given keyspace and name. If zero workflows are returned by GetWorkflows, it returns this wrapped ErrNoWorkflow, including active_only filter state and any warnings from the workflow listing.","triggerScenarios":"Calling FindWorkflow/GetWorkflow for a keyspace+name where the vtctld GetWorkflows result is empty — the workflow does not exist, finished/has no shards (pruned by ActiveOnly), or the name is misspelled.","commonSituations":"Querying a vreplication/migration workflow after it completed and was purged; ActiveOnly=true filtering out inactive workflows; typo in workflow name; wrong keyspace.","solutions":["Verify the workflow name and keyspace (vtctldclient Workflow --keyspace <ks> show)","Set ActiveOnly=false to include non-active workflows in the search","Check workflows.Warnings in the error for hints (e.g. listing failures) and re-create the workflow if it truly no longer exists"],"exampleFix":"// before\nwf, err := cluster.FindWorkflow(ctx, \"commerce\", \"sale2cust\", opts) // ErrNoWorkflow with ActiveOnly=true\n// after\nopts.ActiveOnly = false // include inactive workflows\nwf, err := cluster.FindWorkflow(ctx, \"commerce\", \"sale2cust\", opts)","handlingStrategy":"type-guard","validationCode":"wfs, err := cluster.GetWorkflows(ctx, ks, opts)\nif err != nil { return err }\nif len(wfs.Workflows) == 0 {\n\treturn fmt.Errorf(\"workflow %q not found in keyspace %s (active_only=%v)\", name, ks, opts.ActiveOnly)\n}","typeGuard":"func workflowExists(wfs *vtadminpb.GetWorkflowsResponse, name string) bool {\n\tfor _, w := range wfs.Workflows {\n\t\tif w.Name == name { return true }\n\t}\n\treturn false\n}","tryCatchPattern":"wf, err := cluster.FindWorkflow(ctx, ks, name, opts)\nif err != nil && errors.Is(err, errors.ErrNoWorkflow) {\n\t// handle missing workflow: maybe recreate or check ActiveOnly\n}","preventionTips":["Set ActiveOnly=false when looking up workflows that may have completed","Confirm exact workflow name and keyspace before lookup","Inspect warnings in the GetWorkflows response for listing problems"],"tags":["vtadmin","workflow","vreplication","not-found"],"backgroundTag":"workflow-not-found","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}