{"record":{"id":"813a89889c4df9ce","repo":"apache/seatunnel","slug":"can-t-obtain-schema-for-table-s-813a89","errorCode":null,"errorMessage":"Can't obtain schema for table %s","messagePattern":"Can't obtain schema for table (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/utils/MySqlSchema.java","lineNumber":102,"sourceCode":"        try {\n            tableChangeMap = getTableSchemaByShowCreateTable(jdbc, tableId);\n            if (tableChangeMap.isEmpty()) {\n                log.debug(\"Load schema is empty for table {}\", tableId);\n            }\n        } catch (Exception e) {\n            log.debug(\"Ignore exception when execute `SHOW CREATE TABLE {}` failed\", tableId, e);\n        }\n        if (tableChangeMap.isEmpty()) {\n            try {\n                log.info(\"Fallback to use `DESC {}` load schema\", tableId);\n                tableChangeMap = getTableSchemaByDescTable(jdbc, tableId);\n            } catch (SQLException ex) {\n                throw new SeaTunnelException(\n                        String.format(\"Failed to read schema for table %s\", tableId), ex);\n            }\n        }\n        if (!tableChangeMap.containsKey(tableId)) {\n            throw new RuntimeException(String.format(\"Can't obtain schema for table %s\", tableId));\n        }\n\n        return tableChangeMap.get(tableId);\n    }\n\n    @VisibleForTesting\n    public TableChange readTableSchemaByDesc(JdbcConnection jdbc, TableId tableId) {\n        try {\n            return getTableSchemaByDescTable(jdbc, tableId).get(tableId);\n        } catch (SQLException ex) {\n            throw new SeaTunnelException(\n                    String.format(\"Failed to read schema for table %s\", tableId), ex);\n        }\n    }\n\n    private Map<TableId, TableChange> getTableSchemaByShowCreateTable(\n            JdbcConnection jdbc, TableId tableId) throws SQLException {\n        AtomicReference<String> ddl = new AtomicReference<>();","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/utils/MySqlSchema.java#L84-L120","documentation":"After both the information-schema load and the `DESC` fallback, readTableSchema checks that tableChangeMap contains the requested TableId. If not, it throws RuntimeException 'Can't obtain schema for table <id>' — meaning schema was loaded but the target table is absent from the result.","triggerScenarios":"getTableSchema where getTableSchemaByDescTable succeeded but the returned map does not contain the exact TableId (name/case mismatch) or both loaders returned no schema for it.","commonSituations":"Case-mismatched database/table identifiers on case-sensitive filesystems; table deleted after job planning; catalog qualifier differences (quoted identifiers) between information schema and DESC output.","solutions":["Confirm the exact table name/case as MySQL sees it (`SELECT table_schema, table_name FROM information_schema.tables WHERE lower(table_name)=...`)","Re-check the table exists at job start; recreate or restore it if dropped","Use fully-qualified, correctly-quoted table names in the SeaTunnel catalog/table config","Align lower_case_table_names expectations between config and server"],"exampleFix":"// before\n{\"table-names\": [\"MYDB.MYTABLE\"]}\n// after\n{\"table-names\": [\"mydb.mytable\"]} // exact case as in MySQL","handlingStrategy":"validation","validationCode":"SELECT table_schema, table_name FROM information_schema.tables\nWHERE table_schema='mydb' AND BINARY table_name='mytable';\n// must return exactly one row matching your config","typeGuard":null,"tryCatchPattern":"try {\n    startCdcJob(config);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Can't obtain schema for table\")) {\n        log.error(\"Schema loaded but table missing from result; verify exact identifier case\");\n    }\n}","preventionTips":["Use exact case-qualified identifiers in table-names","Avoid DDL (drop/rename) while the job runs","Reconcile quoted vs unquoted identifiers between config and server catalog"],"tags":["mysql","cdc","schema","table-not-found"],"backgroundTag":"entity-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}