{"record":{"id":"88cecdb0b9e1fe5b","repo":"vitessio/vitess","slug":"unknown-table-v-in-schema","errorCode":null,"errorMessage":"unknown table %v in schema","messagePattern":"unknown table (.+?) in schema","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/binlog/binlog_streamer.go","lineNumber":491,"sourceCode":"\t\t\t// TODO(alainjobart) if table is already in map,\n\t\t\t// just use it.\n\n\t\t\ttce := &tableCacheEntry{\n\t\t\t\ttm:              tm,\n\t\t\t\tkeyspaceIDIndex: -1,\n\t\t\t}\n\t\t\ttableMaps[tableID] = tce\n\n\t\t\t// Check we're in the right database, and if so, fill\n\t\t\t// in more data.\n\t\t\tif tm.Database != \"\" && tm.Database != bls.cp.DBName() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Find and fill in the table schema.\n\t\t\ttce.ti = bls.se.GetTable(sqlparser.NewIdentifierCS(tm.Name))\n\t\t\tif tce.ti == nil {\n\t\t\t\treturn pos, fmt.Errorf(\"unknown table %v in schema\", tm.Name)\n\t\t\t}\n\n\t\t\t// Fill in the resolver if needed.\n\t\t\tif bls.resolverFactory != nil {\n\t\t\t\ttce.keyspaceIDIndex, tce.resolver, err = bls.resolverFactory(tce.ti)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn pos, fmt.Errorf(\"cannot find column to use to find keyspace_id for table %v\", tm.Name)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fill in PK indexes if necessary.\n\t\t\tif bls.extractPK {\n\t\t\t\ttce.pkNames = make([]*querypb.Field, len(tce.ti.PKColumns))\n\t\t\t\ttce.pkIndexes = make([]int, len(tce.ti.Fields))\n\t\t\t\tfor i := range tce.pkIndexes {\n\t\t\t\t\t// Put -1 as default in here.\n\t\t\t\t\ttce.pkIndexes[i] = -1\n\t\t\t\t}","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/binlog/binlog_streamer.go#L473-L509","documentation":"A TABLE_MAP_EVENT references a table that is not present in the cached schema (bls.se). The streamer must know the table's columns/PKs to render rows, so when the table-map lookup returns nil TableInfo it aborts the stream.","triggerScenarios":"Row-based binlog contains rows for a table missing from the streamer's schema cache: the table was dropped mid-stream, the streamer was started with an incomplete/blind schema (Schema Engine returned no entry), or the database name in the event differs from what the schema engine loaded.","commonSituations":"Schema changed (DROP TABLE / RENAME) while vreplication was running; streamer pointed at a keyspace/db whose schema wasn't fully loaded; using a custom schema with missing tables; stale schema cache after ALTERs.","solutions":["Reload/refresh the schema engine's cache so the table is present (re-run the stream or trigger schema reload)","Verify the table exists in the source database and that the streamer's db name/keyspace filter matches","If the table was intentionally dropped, restart the stream from a position after the DROP so the event is skipped","Check that the streamer was not started with a restricted/blind schema that omits needed tables"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ti := schemaEngine.GetTable(sqlparser.NewIdentifierCS(tableName))\nif ti == nil {\n    return fmt.Errorf(\"table %s missing from schema cache before streaming\", tableName)\n}","typeGuard":null,"tryCatchPattern":"err := streamer.Stream(ctx, signals)\nif err != nil && strings.Contains(err.Error(), \"unknown table\") {\n    // trigger schema reload, then restart stream\n}","preventionTips":["Reload schema cache before/after DDL","Confirm the streamer db/keyspace filter matches the source tables","Avoid dropping/renaming tables during active vreplication","Restart streams from positions after intentional DROPs"],"tags":["binlog","schema","row-replication"],"backgroundTag":"unknown-table-schema","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}