vitessio/vitess · error

parse error

Error message

parse error

What it means

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.

Source

Thrown at go/flagutil/optional.go:173

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. Check the wrapped cause: verify topo server connectivity from vtadmin
  2. Fix vtadmin's discovery/topo configuration (cells, topo address, auth)
  3. Retry after topo server recovery; check vtctld registrations exist in the topo
Defensive patterns

Strategy: try-catch

Validate before calling

// check topo reachability first
conn, err := net.DialTimeout("tcp", topoAddr, 2*time.Second)
if err != nil { return fmt.Errorf("topo unreachable: %w", err) }
conn.Close()

Try / catch

vtctlds, err := cluster.GetVtctlds(ctx)
if err != nil {
	if errors.Is(err, context.DeadlineExceeded) { /* topo down: retry/fallback to cached list */ }
	log.Printf("discovery failed: %v", err)
}

Prevention

When it happens

Trigger: Calling Cluster.GetVtctlds when the discovery backend fails: topo server unreachable, discovery misconfigured (wrong cells/paths), or topo errors during listing.

Common situations: etcd/zookeeper outage; vtadmin pointed at wrong topo address; discovery implementation configured for cells that don't exist; auth failures against topo.

Understand the failure class

Related errors


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