{"record":{"id":"eedd1d57c595e194","repo":"vitessio/vitess","slug":"failed-to-get-source-keyspace-vschema-v-eedd1d","errorCode":null,"errorMessage":"failed to get source keyspace vschema: %v","messagePattern":"failed to get source keyspace vschema: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/materializer.go","lineNumber":1116,"sourceCode":"\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}\n\n\tsourceTs := wr.ts\n\tif ms.ExternalCluster != \"\" { // when the source is an external mysql cluster mounted using the Mount command\n\t\texternalTopo, err := wr.ts.OpenExternalVitessClusterServer(ctx, ms.ExternalCluster)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to open external topo: %v\", err)\n\t\t}\n\t\tsourceTs = externalTopo\n\t}\n\tdifferentPVs := false\n\tsourceVSchema, err := sourceTs.GetVSchema(ctx, ms.SourceKeyspace)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get source keyspace vschema: %v\", err)\n\t}\n\tdifferentPVs = primaryVindexesDiffer(ms, sourceVSchema.Keyspace, vschema.Keyspace)\n\n\treturn &materializer{\n\t\twr:                    wr,\n\t\tms:                    ms,\n\t\ttargetVSchema:         targetVSchema,\n\t\tsourceShards:          sourceShards,\n\t\ttargetShards:          targetShards,\n\t\tisPartial:             isPartial,\n\t\tprimaryVindexesDiffer: differentPVs,\n\t}, nil\n}\n\nfunc (mz *materializer) getSourceTableDDLs(ctx context.Context) (map[string]string, error) {\n\tsourceDDLs := make(map[string]string)\n\tallTables := []string{\"/.*/\"}\n","sourceCodeStart":1098,"sourceCodeEnd":1134,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/materializer.go#L1098-L1134","documentation":"After resolving the (possibly external) source topo, buildMaterializer fetches the source keyspace's VSchema to compare primary vindex definitions. Any topo or storage failure retrieving that vschema is wrapped with this message.","triggerScenarios":"sourceTs.GetVSchema(ctx, ms.SourceKeyspace) fails — source keyspace does not exist in the (external) topo, topo storage error, or connection failure to the source topo.","commonSituations":"Wrong source keyspace name (especially on an external mounted cluster); external cluster's topo unreachable mid-command; keyspace deleted between mount and workflow creation.","solutions":["Verify the source keyspace name and that a vschema exists there (GetVSchema via the right topo).","Check connectivity/health of the source (or external) topo server.","For external clusters, re-mount and re-fetch to rule out stale topo config, then retry the workflow."],"exampleFix":"// before\nvtctldclient MoveTables --source commerc --target customer ...  // typo\n// after\nvtctldclient MoveTables --source commerce --target customer ...","handlingStrategy":"validation","validationCode":"_, err := sourceTs.GetVSchema(ctx, sourceKeyspace)\nif err != nil {\n  return fmt.Errorf(\"cannot read vschema for source keyspace %s: %w\", sourceKeyspace, err)\n}","typeGuard":null,"tryCatchPattern":"sourceVSchema, err := sourceTs.GetVSchema(ctx, ms.SourceKeyspace)\nif err != nil {\n  // distinguish topo-unreachable vs keyspace-not-found and act accordingly\n}","preventionTips":["Confirm the source keyspace exists and has a vschema before starting workflows.","Check source/external topo health before launching vreplication workflows.","Use consistent, validated keyspace names in automation."],"tags":["topology","vschema","external-cluster"],"backgroundTag":"source-vschema-fetch-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}