{"record":{"id":"f04c37bed35683f1","repo":"vitessio/vitess","slug":"table-v-not-found-in-vschema-f04c37","errorCode":null,"errorMessage":"table %v not found in vschema","messagePattern":"table (.+?) not found in vschema","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/resharder.go","lineNumber":285,"sourceCode":"\t\tcase workflow.StreamTypeSharded:\n\t\t\tif streamType == workflow.StreamTypeReference {\n\t\t\t\treturn false, fmt.Errorf(\"cannot reshard streams with a mix of reference and sharded tables: %v\", bls)\n\t\t\t}\n\t\t\tstreamType = workflow.StreamTypeSharded\n\t\tcase workflow.StreamTypeReference:\n\t\t\tif streamType == workflow.StreamTypeSharded {\n\t\t\t\treturn false, fmt.Errorf(\"cannot reshard streams with a mix of reference and sharded tables: %v\", bls)\n\t\t\t}\n\t\t\tstreamType = workflow.StreamTypeReference\n\t\t}\n\t}\n\treturn streamType == workflow.StreamTypeReference, nil\n}\n\nfunc (rs *resharder) identifyRuleType(rule *binlogdatapb.Rule) (workflow.StreamType, error) {\n\tvtable, ok := rs.vschema.Tables[rule.Match]\n\tif !ok && !schema.IsInternalOperationTableName(rule.Match) {\n\t\treturn 0, fmt.Errorf(\"table %v not found in vschema\", rule.Match)\n\t}\n\tif vtable != nil && vtable.Type == vindexes.TypeReference {\n\t\treturn workflow.StreamTypeReference, nil\n\t}\n\t// In this case, 'sharded' means that it's not a reference\n\t// table. We don't care about any other subtleties.\n\treturn workflow.StreamTypeSharded, nil\n}\n\nfunc (rs *resharder) copySchema(ctx context.Context) error {\n\toneSource := rs.sourceShards[0].PrimaryAlias\n\terr := rs.forAll(rs.targetShards, func(target *topo.ShardInfo) error {\n\t\treturn rs.wr.CopySchemaShard(ctx, oneSource, []string{\"/.*\"}, nil, false, rs.keyspace, target.ShardName(), 1*time.Second, false)\n\t})\n\treturn err\n}\n\n// createStreams creates all of the VReplication streams that","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/resharder.go#L267-L303","documentation":"Thrown by resharder.identifyRuleType when a filter rule's Match table is not present in the keyspace's vschema and is not an internal operation table (e.g. _vt purposes). The resharder needs to know whether each rule targets a reference or sharded table, which it can only determine from the vschema entry.","triggerScenarios":"Creating a Reshard/MoveTables workflow whose binlogdatapb.Rule.Match names a table absent from the vschema's Tables map; typos in the match name; rule matching a table not declared in the topocache/vschema for that keyspace.","commonSituations":"Table renamed or dropped but workflow filter still references the old name; vschema never updated after adding the table; misspelling in the rule; table lives in a different keyspace than the one the workflow targets.","solutions":["Add the table to the keyspace's vschema (vtctl ApplyVSchema) so it is present in the Tables map","Fix the rule.Match spelling to exactly match a table defined in the vschema","Verify with vtctl GetVSchema <keyspace> that the table is listed","If the table is intentional and internal, name it per the internal operation table naming convention so it is skipped"],"exampleFix":"// before: vschema has no 'custmers' table\n{\"rules\": [{\"match\": \"custmers\"}]}\n// after: correct the name or add the table to vschema\n{\"rules\": [{\"match\": \"customers\"}]}","handlingStrategy":"validation","validationCode":"vs, err := ts.GetVSchema(ctx, keyspace)\nif err != nil { return err }\nfor _, rule := range filter.Rules {\n    if _, ok := vs.Tables[rule.Match]; !ok && !schema.IsInternalOperationTableName(rule.Match) {\n        return fmt.Errorf(\"table %s not in vschema for keyspace %s\", rule.Match, keyspace)\n    }\n}","typeGuard":"func tableInVschema(vsch *vschemapb.Keyspace, match string) bool {\n    _, ok := vsch.GetTables()[match]\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Always apply the table to the vschema before including it in a workflow filter","Copy table names from GetVSchema output rather than typing them","Use tooling/lint to cross-check workflow filters against the vschema"],"tags":["vitess","vschema","reshard","configuration"],"backgroundTag":"table-not-in-vschema","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}