{"record":{"id":"9cb28fee3edce753","repo":"apache/seatunnel","slug":"failed-to-read-schema-for-table-s","errorCode":null,"errorMessage":"Failed to read schema for table %s ","messagePattern":"Failed to read schema for table (.+?) ","errorType":"exception","errorClass":"org.apache.seatunnel.api.table.type.SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/utils/Db2Schema.java","lineNumber":82,"sourceCode":"                    tables,\n                    null,\n                    tableId.schema(),\n                    connectorConfig.getTableFilters().dataCollectionFilter(),\n                    null,\n                    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":64,"sourceCodeEnd":94,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/utils/Db2Schema.java#L64-L94","documentation":"Db2Schema.readTableSchema wraps failures while building the Debezium table schema for the configured DB2 tables (connector config issues, table filtering, schema loading errors) into this exception carrying the table id, propagated to getTableSchema.","triggerScenarios":"getTableSchema -> readTableSchema executes the schema query and catches SQLException — bad connection, missing catalog privileges, or invalid table identifier.","commonSituations":"CDC user lacking permissions on system catalog views; connection dropped; table renamed/dropped between split planning and schema read; quoting/case mismatch in table identifier.","solutions":["Check the wrapped SQLException cause for the exact DB2 error","Grant the CDC user access to the required system catalog views (SYSCAT.*)","Confirm the table exists and the identifier matches (schema/table name and case)","Verify DB2 connectivity and retry the job"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"-- verify catalog access before job\nSELECT * FROM SYSCAT.TABLES WHERE TABSCHEMA='X' AND TABNAME='Y';","typeGuard":null,"tryCatchPattern":"try { runPipeline(); } catch (SeaTunnelException e) { if (e.getMessage().startsWith(\"Failed to read schema\")) { checkPrivilegesAndConnection(); } }","preventionTips":["Grant catalog view access to the CDC user","Verify table identifiers and case before configuring sources","Keep connections alive and validated"],"tags":["db2","schema","jdbc","cdc"],"backgroundTag":"schema-validation-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}