vitessio/vitess · error

Create ReshardWorkflow failed: %v

Error message

Create ReshardWorkflow failed: %v

What it means

Before initializing a Reshard workflow, Create validates the vschema for the source keyspace (with the given shards and excluded tables, including views) via wr.ValidateVSchema. A failed validation means the keyspace's schema/topology is not consistent enough to reshard, and the failure is wrapped with context.

Source

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

// Create initiates a workflow
func (vrw *VReplicationWorkflow) Create(ctx context.Context) error {
	var err error
	if vrw.Exists() {
		return errors.New("workflow already exists")
	}
	if vrw.CachedState() != WorkflowStateNotCreated {
		return fmt.Errorf("workflow has already been created, state is %s", vrw.CachedState())
	}
	switch vrw.workflowType {
	case MoveTablesWorkflow, MigrateWorkflow:
		err = vrw.initMoveTables()
	case ReshardWorkflow:
		excludeTables := strings.Split(vrw.params.ExcludeTables, ",")
		keyspace := vrw.params.SourceKeyspace

		vschmErr := vrw.wr.ValidateVSchema(ctx, keyspace, vrw.params.SourceShards, excludeTables, true /*includeViews*/)
		if vschmErr != nil {
			return fmt.Errorf("Create ReshardWorkflow failed: %v", vschmErr)
		}

		err = vrw.initReshard()
	default:
		return fmt.Errorf("unknown workflow type %d", vrw.workflowType)
	}
	if err != nil {
		return err
	}
	return nil
}

// WorkflowError has per stream errors if present in a workflow
type WorkflowError struct {
	Tablet      string
	ID          int32
	Description string
}

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Read the wrapped vschmErr to find the specific schema/table mismatch and fix it (apply missing schema to lagging shards)
  2. Re-run validation after correcting schema; ensure all source shards are reachable
  3. Adjust ExcludeTables/SourceShards parameters if they were misconfigured
Defensive patterns

Strategy: validation

Validate before calling

if err := wr.ValidateVSchema(ctx, keyspace, sourceShards, excludeTables, true); err != nil {
    return fmt.Errorf("fix vschema before creating reshard: %v", err)
}

Try / catch

if err := wf.Create(ctx); err != nil {
    if strings.Contains(err.Error(), "ValidateVSchema") || strings.Contains(err.Error(), "vschema") {
        // inspect and repair schema on lagging shards, then retry
    }
    return err
}

Prevention

When it happens

Trigger: Create() on a ReshardWorkflow where ValidateVSchema returns an error — e.g. schema mismatch across source shards, missing tables/views, or unreachable tablets while loading the schema.

Common situations: Excluded-tables typo causing unexpected schema divergence; a shard whose schema was never fully applied; topology connectivity problems during validation.

Related errors


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