{"record":{"id":"380f0c6dd59e17d9","repo":"alibaba/canal","slug":"not-found-in-db-pls-check","errorCode":null,"errorMessage":"not found [{}] in db , pls check!","messagePattern":"not found \\[(.+?)\\] in db , pls check!","errorType":"exception","errorClass":"CanalParseException","httpStatus":null,"severity":"error","filePath":"parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java","lineNumber":497,"sourceCode":"            // 处理rds模式的mysql.ha_health_check心跳数据\n            // 主要RDS的心跳表基本无权限,需要mock一个tableMeta\n            FieldMeta idMeta = new FieldMeta(\"id\", \"bigint(20)\", true, false, \"0\");\n            FieldMeta typeMeta = new FieldMeta(\"type\", \"char(1)\", false, true, \"0\");\n            tableMeta = new TableMeta(table.getDbName(), table.getTableName(), Arrays.asList(idMeta, typeMeta));\n        } else if (isHeartBeat) {\n            // 处理alisql模式的test.heartbeat心跳数据\n            // 心跳表基本无权限,需要mock一个tableMeta\n            FieldMeta idMeta = new FieldMeta(\"id\", \"smallint(6)\", false, true, null);\n            FieldMeta typeMeta = new FieldMeta(\"ts\", \"int(11)\", true, false, null);\n            tableMeta = new TableMeta(table.getDbName(), table.getTableName(), Arrays.asList(idMeta, typeMeta));\n        }\n\n        EntryPosition position = createPosition(event.getHeader());\n        if (tableMetaCache != null && tableMeta == null) {// 入错存在table meta\n            tableMeta = getTableMeta(table.getDbName(), table.getTableName(), true, position);\n            if (tableMeta == null) {\n                if (!filterTableError) {\n                    throw new CanalParseException(\"not found [\" + fullname + \"] in db , pls check!\");\n                }\n            }\n        }\n\n        return tableMeta;\n    }\n\n    public Entry parseRowsEvent(RowsLogEvent event) {\n        return parseRowsEvent(event, null);\n    }\n\n    public void parseTableMapEvent(TableMapLogEvent event) {\n        try {\n            String charsetDbName = new String(event.getDbName().getBytes(ISO_8859_1), charset);\n            event.setDbname(charsetDbName);\n\n            String charsetTbName = new String(event.getTableName().getBytes(ISO_8859_1), charset);\n            event.setTblname(charsetTbName);","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java#L479-L515","documentation":"Thrown from parseRowsEventForTableMeta() when tableMetaCache.getTableMeta() returns null for a table that exists in the binlog stream. The TableMapLogEvent identified a schema.table, but Canal could not load its metadata from the connected database. Unless filterTableError is true, this is fatal for the current event.","triggerScenarios":"getTableMeta(schema, table, true, position) is called and returns null. This happens when 'show create table' and 'desc' both fail for the table — the table was dropped, renamed, or the canal user lacks SELECT privileges on it. Also occurs when the table is a temporary table or exists only in a different schema context.","commonSituations":"The table was dropped between the binlog event being written and Canal processing it. The table was renamed via DDL that Canal's parser missed. The canal user has replication privileges but not SELECT on the specific database. The table is in a schema that was dropped. The table is a MySQL internal/temporary table.","solutions":["Set canal.instance.filter.table.error = true in instance.properties to skip events for missing tables instead of aborting.","Grant SELECT on the relevant databases: GRANT SELECT ON mydb.* TO 'canal'@'%';","If the table was intentionally dropped, ensure Canal processes the DROP DDL event so its metadata cache is invalidated.","Enable TSDB (canal.instance.tsdb.enable=true) so historical table metadata is preserved for dropped tables."],"exampleFix":"# before\ncanal.instance.filter.table.error=false\n\n# after\ncanal.instance.filter.table.error=true\ncanal.instance.tsdb.enable=true","handlingStrategy":"validation","validationCode":"// Before processing, verify the table exists and is accessible\ntry {\n    mysqlConnection.query(\"SELECT 1 FROM \" + schema + \".\" + table + \" LIMIT 1\");\n} catch (Exception e) {\n    logger.warn(\"Table {}.{} not accessible, enabling filterTableError recommended\", schema, table);\n}","typeGuard":null,"tryCatchPattern":"try {\n    TableMeta meta = parseRowsEventForTableMeta(event);\n} catch (CanalParseException e) {\n    if (e.getMessage().contains(\"not found\") && e.getMessage().contains(\"in db\")) {\n        if (filterTableError) {\n            logger.warn(\"Table not found, skipping row event: {}\", fullname);\n            return null;\n        }\n    }\n    throw e;\n}","preventionTips":["Set canal.instance.filter.table.error=true for production resilience against transient table-not-found.","Grant SELECT on all replicated schemas to the canal user.","Enable TSDB for historical table metadata when tables may be dropped/renamed."],"tags":["mysql","table-meta","missing-table","privileges"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}