{"record":{"id":"768e9191cecf7a48","repo":"vitessio/vitess","slug":"create-reshardworkflow-failed-v","errorCode":null,"errorMessage":"Create ReshardWorkflow failed: %v","messagePattern":"Create ReshardWorkflow failed: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/workflow.go","lineNumber":250,"sourceCode":"// Create initiates a workflow\nfunc (vrw *VReplicationWorkflow) Create(ctx context.Context) error {\n\tvar err error\n\tif vrw.Exists() {\n\t\treturn errors.New(\"workflow already exists\")\n\t}\n\tif vrw.CachedState() != WorkflowStateNotCreated {\n\t\treturn fmt.Errorf(\"workflow has already been created, state is %s\", vrw.CachedState())\n\t}\n\tswitch vrw.workflowType {\n\tcase MoveTablesWorkflow, MigrateWorkflow:\n\t\terr = vrw.initMoveTables()\n\tcase ReshardWorkflow:\n\t\texcludeTables := strings.Split(vrw.params.ExcludeTables, \",\")\n\t\tkeyspace := vrw.params.SourceKeyspace\n\n\t\tvschmErr := vrw.wr.ValidateVSchema(ctx, keyspace, vrw.params.SourceShards, excludeTables, true /*includeViews*/)\n\t\tif vschmErr != nil {\n\t\t\treturn fmt.Errorf(\"Create ReshardWorkflow failed: %v\", vschmErr)\n\t\t}\n\n\t\terr = vrw.initReshard()\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown workflow type %d\", vrw.workflowType)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// WorkflowError has per stream errors if present in a workflow\ntype WorkflowError struct {\n\tTablet      string\n\tID          int32\n\tDescription string\n}","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/workflow.go#L232-L268","documentation":"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.","triggerScenarios":"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.","commonSituations":"Excluded-tables typo causing unexpected schema divergence; a shard whose schema was never fully applied; topology connectivity problems during validation.","solutions":["Read the wrapped vschmErr to find the specific schema/table mismatch and fix it (apply missing schema to lagging shards)","Re-run validation after correcting schema; ensure all source shards are reachable","Adjust ExcludeTables/SourceShards parameters if they were misconfigured"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if err := wr.ValidateVSchema(ctx, keyspace, sourceShards, excludeTables, true); err != nil {\n    return fmt.Errorf(\"fix vschema before creating reshard: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := wf.Create(ctx); err != nil {\n    if strings.Contains(err.Error(), \"ValidateVSchema\") || strings.Contains(err.Error(), \"vschema\") {\n        // inspect and repair schema on lagging shards, then retry\n    }\n    return err\n}","preventionTips":["Run ValidateVSchema as a preflight step before reshard creation","Keep source shard schemas in sync before starting resharding","Double-check ExcludeTables entries for typos"],"tags":["vreplication","reshard","vschema","validation"],"backgroundTag":"vschema-validation-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}