vitessio/vitess · error

workflow %s.%s is incorrectly configured

Error message

workflow %s.%s is incorrectly configured

What it means

After resolving source and target database names from the first primary tablet of each TabletSet, this error fires when either side resolves to an empty name. It signals the workflow's topology data is incomplete — the workflow exists but its source or target side has no usable primary tablet.

Source

Thrown at go/vt/wrangler/workflow.go:705

			(*tableSizes)[table] += tableSize
		}
		return nil
	}
	sourceDbName := ""
	for _, tsSource := range vrw.ts.sources {
		sourceDbName = tsSource.GetPrimary().DbName()
		break
	}
	if sourceDbName == "" {
		return nil, fmt.Errorf("no sources found for workflow %s.%s", vrw.ws.TargetKeyspace, vrw.ws.Workflow)
	}
	targetDbName := ""
	for _, tsTarget := range vrw.ts.targets {
		targetDbName = tsTarget.GetPrimary().DbName()
		break
	}
	if sourceDbName == "" || targetDbName == "" {
		return nil, fmt.Errorf("workflow %s.%s is incorrectly configured", vrw.ws.TargetKeyspace, vrw.ws.Workflow)
	}
	sort.Strings(tableList) // sort list for repeatability for mocking in tests
	tablesStr := strings.Join(tableList, ",")
	query := fmt.Sprintf(getRowCountQuery, encodeString(targetDbName), tablesStr)
	for _, target := range vrw.ts.targets {
		tablet := target.GetPrimary().Tablet
		if err := getTableMetrics(tablet, query, &targetRowCounts, &targetTableSizes); err != nil {
			return nil, err
		}
	}

	query = fmt.Sprintf(getRowCountQuery, encodeString(sourceDbName), tablesStr)
	for source := range sourcePrimaries {
		ti, err := vrw.wr.ts.GetTablet(ctx, source)
		tablet := ti.Tablet
		if err != nil {
			return nil, err
		}

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Run `vtctldclient GetTablets` and confirm both source and target keyspaces have primaries
  2. Start/repair missing tablets in the offending keyspace
  3. Re-run the command once topology is healthy; if stale, verify vtctld points at the correct topo server
Defensive patterns

Strategy: validation

Validate before calling

if len(ts.Sources) == 0 || len(ts.Targets) == 0 {
    return fmt.Errorf("workflow %s.%s lacks primaries; check topology", keyspace, workflow)
}

Type guard

func workflowFullyConfigured(ts *tabletset.Set) bool {
    return len(ts.Sources) > 0 && len(ts.Targets) > 0
}

Try / catch

if err != nil {
    if strings.Contains(err.Error(), "incorrectly configured") {
        // inspect GetTablets output for the keyspace before retrying
    }
    return err
}

Prevention

When it happens

Trigger: Calling the row-count/status plumbing when sourceDbName == "" (no source primaries) or targetDbName == "" (no target primaries) for vrw.ts, typically right after resolving a workflow whose tablets are missing or not yet elected.

Common situations: Reshard/MoveTables mid-flight before target primaries are up; keyspace created but tablets not started; topo data stale after a cluster rebuild; wrong keyspace passed to the command.

Related errors


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