{"record":{"id":"5bbfad8a3a9eeed7","repo":"vitessio/vitess","slug":"table-s-is-not-present-in-the-database","errorCode":null,"errorMessage":"table %s is not present in the database","messagePattern":"table (.+?) is not present in the database","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/tabletserver/vstreamer/uvstreamer.go","lineNumber":164,"sourceCode":"//\n//\tthe first time, with just the filter and an empty pos\n//\tduring a restart, with both the filter and list of TableLastPK from the vgtid\nfunc (uvs *uvstreamer) buildTablePlan() error {\n\tuvs.plans = make(map[string]*tablePlan)\n\ttableLastPKs := make(map[string]*binlogdatapb.TableLastPK)\n\tfor _, tablePK := range uvs.inTablePKs {\n\t\tif tablePK != nil && tablePK.Lastpk != nil && len(tablePK.Lastpk.Fields) == 0 {\n\t\t\treturn fmt.Errorf(\"lastpk for table %s has no fields defined\", tablePK.TableName)\n\t\t}\n\t\ttableLastPKs[tablePK.TableName] = tablePK\n\t}\n\ttables := uvs.se.GetSchema()\n\tfor range tables {\n\t\tfor _, rule := range uvs.filter.Rules {\n\t\t\tif !strings.HasPrefix(rule.Match, \"/\") {\n\t\t\t\t_, ok := tables[rule.Match]\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"table %s is not present in the database\", rule.Match)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set of tables to copy during the copy phase. Only if we need to copy\n\t// specific tables, else keep it nil if we need to copy every table.\n\tvar tablesToCopySet sets.Set[string]\n\tif len(uvs.options.GetTablesToCopy()) > 0 {\n\t\ttablesToCopySet = sets.New(uvs.options.GetTablesToCopy()...)\n\t}\n\n\tfor tableName := range tables {\n\t\trule, err := matchTable(tableName, uvs.filter, tables)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif rule == nil {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletserver/vstreamer/uvstreamer.go#L146-L182","documentation":"For non-regex filter rules, buildTablePlan verifies the rule's matched table exists in the tablet's live schema. If a rule names a table that GetSchema() doesn't return, planning fails with this error rather than silently streaming nothing.","triggerScenarios":"VStream filter rule with a literal table name (no '/' prefix) that is not present in the source keyspace/tablet schema at plan time.","commonSituations":"Typo in filter rule table name; table dropped after workflow was created; filter copied from another keyspace; case-sensitivity mismatch;MoveTables started before the table was created.","solutions":["Compare the filter rule's Match value against SHOW TABLES on the source tablet; fix the rule spelling/case.","Create the missing table in the source database, or remove it from the filter rules and update the workflow.","If the table was intentionally dropped, update the VReplication workflow's filter (e.g. via MoveTables/Reshard tooling) and restart the stream."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"tables, _ := getSchemaTableNames(ctx, tablet) // SHOW TABLES\nfor _, rule := range filter.Rules {\n    if !strings.HasPrefix(rule.Match, \"/\") && !slices.Contains(tables, rule.Match) {\n        return fmt.Errorf(\"filter rule references missing table %s\", rule.Match)\n    }\n}","typeGuard":null,"tryCatchPattern":"err := uvstream(ctx, filter, nil)\nif err != nil && strings.Contains(err.Error(), \"is not present in the database\") {\n    // fix filter rules or create the table, then retry\n}","preventionTips":["Cross-check filter rules against SHOW TABLES before starting workflows","Create target tables before starting MoveTables","Watch for case-sensitivity mismatches between rule and schema","Remove rules for intentionally dropped tables"],"tags":["uvstreamer","filter-rules","schema"],"backgroundTag":"filter-table-not-found","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}