apache/seatunnel · error · SeaTunnelException

Error to check tables: ${e.getMessage()}

Error message

Error to check tables: ${e.getMessage()}

What it means

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: ...').

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/PostgresDialect.java:199

                && sourceSplitBase.asIncrementalSplit().getCheckpointTables() != null
                && !sourceSplitBase.asIncrementalSplit().getCheckpointTables().isEmpty()) {
            relationSchemaBaseline = sourceSplitBase.asIncrementalSplit().getCheckpointTables();
        }

        return new PostgresSourceFetchTaskContext(
                taskSourceConfig, this, jdbcConnection, tableChangeList, relationSchemaBaseline);
    }

    @Override
    public FetchTask<SourceSplitBase> createFetchTask(SourceSplitBase sourceSplitBase) {
        if (sourceSplitBase.isSnapshotSplit()) {
            return new PostgresSnapshotFetchTask(sourceSplitBase.asSnapshotSplit());
        } else {
            try (JdbcConnection jdbcConnection = openJdbcConnection(sourceConfig)) {
                List<TableId> tables = sourceSplitBase.asIncrementalSplit().getTableIds();
                this.checkAllTablesEnabledCapture(jdbcConnection, tables);
            } catch (SQLException e) {
                throw new SeaTunnelException("Error to check tables: " + e.getMessage(), e);
            }
            postgresWalFetchTask = new PostgresWalFetchTask(sourceSplitBase.asIncrementalSplit());
            return postgresWalFetchTask;
        }
    }

    @Override
    public void commitChangeLogOffset(Offset offset) throws Exception {
        if (postgresWalFetchTask != null) {
            postgresWalFetchTask.commitCurrentOffset((LsnOffset) offset);
        }
    }

    @Override
    public Optional<PrimaryKey> getPrimaryKey(JdbcConnection jdbcConnection, TableId tableId) {
        return Optional.ofNullable(tableMap.get(tableId).getTableSchema().getPrimaryKey());
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the wrapped e.getMessage() for the underlying SQL error.
  2. Re-verify the database connection and user permissions.
  3. Confirm replica identity is still FULL on the incremental split's tables (see error 577 fix).
  4. Restart the job once the database is healthy.
Defensive patterns

Strategy: retry

Validate before calling

psql "postgres://user@host:5432/mydb" -c "SELECT relname, relreplident FROM pg_class WHERE relname IN ('orders');"

Try / catch

try {
  startCdcSource(cfg);
} catch (SeaTunnelException e) {
  if (e.getMessage().startsWith("Error to check tables")) {
    // inspect e.getCause(), restore connectivity/permissions, retry job
  }
}

Prevention

When it happens

Trigger: Thrown from createFetchTask when opening a JDBC connection and running checkAllTablesEnabledCapture for an incremental split throws SQLException.

Common situations: Connection lost between snapshot and incremental phase; permissions changed mid-job; replica identity altered/reverted; database failover.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/03ccc247a5e870fa. Report an issue: GitHub.