apache/seatunnel · error · org.apache.seatunnel.api.table.type.SeaTunnelException

Error to check tables:

Error message

Error to check tables: 

What it means

createFetchTask() wraps SQLExceptions thrown while opening a JDBC connection and running checkAllTablesEnabledCapture() for an incremental (transaction-log) split into SeaTunnelException("Error to check tables: " + e.getMessage(), e). It means the pre-flight capture-enabling check could not be executed because the JDBC call failed, so the Db2 transaction-log task cannot be created.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/source/Db2Dialect.java:155

    }

    @Override
    public Db2SourceFetchTaskContext createFetchTaskContext(
            SourceSplitBase sourceSplitBase, JdbcSourceConfig taskSourceConfig) {

        return new Db2SourceFetchTaskContext((Db2SourceConfig) taskSourceConfig, this);
    }

    @Override
    public FetchTask<SourceSplitBase> createFetchTask(SourceSplitBase sourceSplitBase) {
        if (sourceSplitBase.isSnapshotSplit()) {
            return new Db2SnapshotFetchTask(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);
            }
            return new Db2TransactionLogFetchTask(sourceSplitBase.asIncrementalSplit());
        }
    }

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

    @Override
    public List<ConstraintKey> getConstraintKeys(JdbcConnection jdbcConnection, TableId tableId) {
        return tableMap.get(toDb2TableId(tableId)).getTableSchema().getConstraintKeys();
    }

    private static Map<TableId, CatalogTable> createDb2TableMap(List<CatalogTable> catalogTables) {
        Map<TableId, CatalogTable> tables = new HashMap<>();

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect e.getCause() for the underlying SQLException message/SQLSTATE to pinpoint the JDBC failure.
  2. Verify the database is reachable and the JDBC URL/credentials in sourceConfig are correct.
  3. Confirm the CDC user retains privileges needed for the capture-metadata query.
  4. If the connection is transiently lost (network blip), restart the job/retry after connectivity is restored — checkpoint recovery should resume the incremental split.
  5. Check Db2 server logs for connection or capture-service errors at the failure time.
Defensive patterns

Strategy: retry

Validate before calling

// Preflight the check with a dedicated connection before creating the task
try (JdbcConnection test = openJdbcConnection(sourceConfig)) {
    test.connect();
} catch (SQLException e) {
    throw new IllegalStateException("Cannot open DB2 connection for capture check: " + e.getMessage(), e);
}

Try / catch

try {
    task = dialect.createFetchTask(splitBase);
} catch (SeaTunnelException e) {
    if (e.getCause() instanceof SQLException && isTransient((SQLException) e.getCause())) {
        // retry with backoff; checkpoint recovery resumes the split
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: createFetchTask() for an incremental split opens openJdbcConnection(sourceConfig) and calls checkAllTablesEnabledCapture(); any SQLException from opening the connection (auth failure, network down, TLS mismatch) or from listOfChangeTables() is wrapped with this message.

Common situations: Database went down between snapshot and incremental phase; credentials rotated or expired; firewall/load balancer dropped the idle connection; Db2 capture service unavailable making the metadata query fail; driver URL misconfigured.

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/26086fb28bed7aef. Report an issue: GitHub.