{"record":{"id":"50688a8cd6bd2fd7","repo":"apache/seatunnel","slug":"can-t-obtain-schema-for-table-s-50688a","errorCode":null,"errorMessage":"Can't obtain schema for table %s ","messagePattern":"Can't obtain schema for table (.+?) ","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/utils/SqlServerSchema.java","lineNumber":88,"sourceCode":"                    false);\n            for (TableId id : tables.tableIds()) {\n                if (tableMap.containsKey(id)) {\n                    Table table =\n                            CatalogTableUtils.mergeCatalogTableConfig(\n                                    tables.forTable(id), tableMap.get(id));\n                    TableChanges.TableChange tableChange =\n                            new TableChanges.TableChange(\n                                    TableChanges.TableChangeType.CREATE, table);\n                    schemasByTableId.put(id, tableChange);\n                }\n            }\n        } catch (SQLException e) {\n            throw new SeaTunnelException(\n                    String.format(\"Failed to read schema for table %s \", tableId), e);\n        }\n\n        if (!schemasByTableId.containsKey(tableId)) {\n            throw new SeaTunnelException(\n                    String.format(\"Can't obtain schema for table %s \", tableId));\n        }\n\n        return schemasByTableId.get(tableId);\n    }\n}\n","sourceCodeStart":70,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/utils/SqlServerSchema.java#L70-L95","documentation":"After querying, readTableSchema found no TableChange cached for the requested TableId — the schema lookup completed without error but the table's schema is absent. SqlServerSchema throws SeaTunnelException because it cannot build a SourceReader without column definitions.","triggerScenarios":"getTableSchema → readTableSchema: schemasByTableId does not contain the tableId after the metadata query — the table was not returned by the database metadata (does not exist, wrong database/schema, or name case mismatch).","commonSituations":"Typo or wrong case in database.schema.table config; table exists in a different database than the one connected to; table dropped between config and runtime; using synonyms or views that the metadata query does not resolve.","solutions":["Verify the fully-qualified table name (database.schema.table) matches exactly, including case, in the connector config","Connect with credentials that can see the table's metadata in the target database","Query SQL Server directly (SELECT ... FROM INFORMATION_SCHEMA.TABLES / sys.tables) to confirm the table is visible","Ensure database.server/database name in config points to the DB containing the table"],"exampleFix":"// before\ntable-names = [\"dbo.Orders\"]   // wrong DB or schema\n// after\ntable-names = [\"MyDB.sales.Orders\"]   // fully qualified, exact case","handlingStrategy":"validation","validationCode":"// Verify exact table visibility before running\nSELECT s.name + '.' + t.name AS fqn\nFROM sys.tables t JOIN sys.schemas s ON t.schema_id = s.schema_id\nWHERE s.name + '.' + t.name = 'dbo.Orders';\n-- must return exactly one row matching the config value","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use fully-qualified, exact-case database.schema.table in table-names","Confirm the login can see the table's metadata ( INFORMATION_SCHEMA / sys.tables)","Do not drop tables while the job is starting","Point the connection at the database that actually contains the table"],"tags":["cdc","sqlserver","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"}