vitessio/vitess · error

value out of range

Error message

value out of range

What it means

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.

Source

Thrown at go/flagutil/optional.go:174

func (f *OptionalFlagValue[T]) IsSet() bool {
	return f.set
}

// NewOptionalFloat64 returns an *OptionalFloat64 with the specified default value.
func NewOptionalFloat64(val float64) *OptionalFloat64 {
	return &OptionalFloat64{val: val}
}

// NewOptionalString returns an *OptionalString with the specified default value.
func NewOptionalString(val string) *OptionalString {
	return &OptionalString{val: val}
}

// lifted directly from package flag to make the behavior of numeric parsing
// consistent with the standard library for our custom optional types.
var (
	errParse = errors.New("parse error")
	errRange = errors.New("value out of range")
)

// lifted directly from package flag to make the behavior of numeric parsing
// consistent with the standard library for our custom optional types.
func numError(err error) error {
	ne, ok := err.(*strconv.NumError)
	if !ok {
		return err
	}

	switch ne.Err {
	case strconv.ErrSyntax:
		return errParse
	case strconv.ErrRange:
		return errRange
	default:
		return err
	}

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Verify the workflow name and keyspace (vtctldclient Workflow --keyspace <ks> show)
  2. Set ActiveOnly=false to include non-active workflows in the search
  3. Check workflows.Warnings in the error for hints (e.g. listing failures) and re-create the workflow if it truly no longer exists

Example fix

// before
wf, err := cluster.FindWorkflow(ctx, "commerce", "sale2cust", opts) // ErrNoWorkflow with ActiveOnly=true
// after
opts.ActiveOnly = false // include inactive workflows
wf, err := cluster.FindWorkflow(ctx, "commerce", "sale2cust", opts)
Defensive patterns

Strategy: type-guard

Validate before calling

wfs, err := cluster.GetWorkflows(ctx, ks, opts)
if err != nil { return err }
if len(wfs.Workflows) == 0 {
	return fmt.Errorf("workflow %q not found in keyspace %s (active_only=%v)", name, ks, opts.ActiveOnly)
}

Type guard

func workflowExists(wfs *vtadminpb.GetWorkflowsResponse, name string) bool {
	for _, w := range wfs.Workflows {
		if w.Name == name { return true }
	}
	return false
}

Try / catch

wf, err := cluster.FindWorkflow(ctx, ks, name, opts)
if err != nil && errors.Is(err, errors.ErrNoWorkflow) {
	// handle missing workflow: maybe recreate or check ActiveOnly
}

Prevention

When it happens

Trigger: 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.

Common situations: Querying a vreplication/migration workflow after it completed and was purged; ActiveOnly=true filtering out inactive workflows; typo in workflow name; wrong keyspace.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/470ef9a9d3954627. Report an issue: GitHub.