{"record":{"id":"03ccc247a5e870fa","repo":"apache/seatunnel","slug":"error-to-check-tables-e-getmessage","errorCode":null,"errorMessage":"Error to check tables: ${e.getMessage()}","messagePattern":"Error to check tables: (.+?)","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/PostgresDialect.java","lineNumber":199,"sourceCode":"                && sourceSplitBase.asIncrementalSplit().getCheckpointTables() != null\n                && !sourceSplitBase.asIncrementalSplit().getCheckpointTables().isEmpty()) {\n            relationSchemaBaseline = sourceSplitBase.asIncrementalSplit().getCheckpointTables();\n        }\n\n        return new PostgresSourceFetchTaskContext(\n                taskSourceConfig, this, jdbcConnection, tableChangeList, relationSchemaBaseline);\n    }\n\n    @Override\n    public FetchTask<SourceSplitBase> createFetchTask(SourceSplitBase sourceSplitBase) {\n        if (sourceSplitBase.isSnapshotSplit()) {\n            return new PostgresSnapshotFetchTask(sourceSplitBase.asSnapshotSplit());\n        } else {\n            try (JdbcConnection jdbcConnection = openJdbcConnection(sourceConfig)) {\n                List<TableId> tables = sourceSplitBase.asIncrementalSplit().getTableIds();\n                this.checkAllTablesEnabledCapture(jdbcConnection, tables);\n            } catch (SQLException e) {\n                throw new SeaTunnelException(\"Error to check tables: \" + e.getMessage(), e);\n            }\n            postgresWalFetchTask = new PostgresWalFetchTask(sourceSplitBase.asIncrementalSplit());\n            return postgresWalFetchTask;\n        }\n    }\n\n    @Override\n    public void commitChangeLogOffset(Offset offset) throws Exception {\n        if (postgresWalFetchTask != null) {\n            postgresWalFetchTask.commitCurrentOffset((LsnOffset) offset);\n        }\n    }\n\n    @Override\n    public Optional<PrimaryKey> getPrimaryKey(JdbcConnection jdbcConnection, TableId tableId) {\n        return Optional.ofNullable(tableMap.get(tableId).getTableSchema().getPrimaryKey());\n    }\n","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/PostgresDialect.java#L181-L217","documentation":"PostgresDialect.createFetchTask builds incremental (WAL) fetch tasks after validating that the split's tables still have proper replica identity. A SQLException during that check is wrapped as SeaTunnelException('Error to check tables: ...').","triggerScenarios":"Thrown from createFetchTask when opening a JDBC connection and running checkAllTablesEnabledCapture for an incremental split throws SQLException.","commonSituations":"Connection lost between snapshot and incremental phase; permissions changed mid-job; replica identity altered/reverted; database failover.","solutions":["Inspect the wrapped e.getMessage() for the underlying SQL error.","Re-verify the database connection and user permissions.","Confirm replica identity is still FULL on the incremental split's tables (see error 577 fix).","Restart the job once the database is healthy."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"psql \"postgres://user@host:5432/mydb\" -c \"SELECT relname, relreplident FROM pg_class WHERE relname IN ('orders');\"","typeGuard":null,"tryCatchPattern":"try {\n  startCdcSource(cfg);\n} catch (SeaTunnelException e) {\n  if (e.getMessage().startsWith(\"Error to check tables\")) {\n    // inspect e.getCause(), restore connectivity/permissions, retry job\n  }\n}","preventionTips":["Keep replica identity FULL through the whole job lifetime.","Avoid permission or connection changes mid-job.","Monitor database failovers and restart the job cleanly."],"tags":["postgres","cdc","database","fetch-task"],"backgroundTag":"database-query-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"}