{"record":{"id":"a7101e2fa19d1bea","repo":"vitessio/vitess","slug":"no-source-shards-specified-for-workflow-s-a7101e","errorCode":null,"errorMessage":"no source shards specified for workflow %s ","messagePattern":"no source shards specified for workflow (.+?) ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/materializer.go","lineNumber":1085,"sourceCode":"\t\t}\n\t}\n\tisPartial := false\n\tsourceShards, err := wr.sourceTs.GetServingShards(ctx, ms.SourceKeyspace)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(ms.SourceShards) > 0 {\n\t\tisPartial = true\n\t\tvar sourceShards2 []*topo.ShardInfo\n\t\tfor _, shard := range sourceShards {\n\t\t\tif slices.Contains(ms.SourceShards, shard.ShardName()) {\n\t\t\t\tsourceShards2 = append(sourceShards2, shard)\n\t\t\t}\n\t\t}\n\t\tsourceShards = sourceShards2\n\t}\n\tif len(sourceShards) == 0 {\n\t\treturn nil, fmt.Errorf(\"no source shards specified for workflow %s \", ms.Workflow)\n\t}\n\n\ttargetShards, err := wr.ts.GetServingShards(ctx, ms.TargetKeyspace)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(ms.SourceShards) > 0 {\n\t\tvar targetShards2 []*topo.ShardInfo\n\t\tfor _, shard := range targetShards {\n\t\t\tif slices.Contains(ms.SourceShards, shard.ShardName()) {\n\t\t\t\ttargetShards2 = append(targetShards2, shard)\n\t\t\t}\n\t\t}\n\t\ttargetShards = targetShards2\n\t}\n\tif len(targetShards) == 0 {\n\t\treturn nil, fmt.Errorf(\"no target shards specified for workflow %s \", ms.Workflow)\n\t}","sourceCodeStart":1067,"sourceCodeEnd":1103,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/materializer.go#L1067-L1103","documentation":"Returned by the materializer when creating a workflow with no source shards specified; the workflow's source keyspace must resolve to at least one shard.","triggerScenarios":"prepareMaterializerStreams with ms.SourceShards yielding zero shards — e.g. SourceShards specified names that match no actual shards, or a keyspace with no serving shards returned by the source topo.","commonSituations":"Typo in --source-shards values (e.g. '-' vs '-80'); running against an empty/uninitialized source keyspace; all source shards filtered out by the shard-selection logic.","solutions":["Verify the source keyspace has serving shards (vtctldclient GetTablets / ListShards).","Correct the shard names passed via SourceShards, or omit the option to use all shards.","Check that the source keyspace name is correct so the topo returns its shards."],"exampleFix":"// before\n--source-shards \"-8o\"   // typo\n// after\n--source-shards \"-80\"","handlingStrategy":"validation","validationCode":"shards, _ := wr.ts.GetShardNames(ctx, sourceKeyspace)\nfor _, want := range requestedSourceShards {\n  if !slices.Contains(shards, want) {\n    return fmt.Errorf(\"source shard %s not found in %s\", want, sourceKeyspace)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy shard names from ListShards output rather than typing them.","If unsure, omit shard filters to use all shards.","Confirm the source keyspace exists before launching the workflow."],"tags":["sharding","materializer","configuration"],"backgroundTag":"no-source-shards","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}