apache/seatunnel · error · SeaTunnelException
Error to check tables: ${e.getMessage()}
Error message
Error to check tables: ${e.getMessage()} What it means
Thrown by SqlServerDialect.createFetchTask() when validating that an incremental (transaction-log) split's tables are CDC-enabled throws a SQLException. It wraps the driver error into a SeaTunnelException 'Error to check tables'.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/SqlServerDialect.java:150
}
@Override
public SqlServerSourceFetchTaskContext createFetchTaskContext(
SourceSplitBase sourceSplitBase, JdbcSourceConfig taskSourceConfig) {
return new SqlServerSourceFetchTaskContext((SqlServerSourceConfig) taskSourceConfig, this);
}
@Override
public FetchTask<SourceSplitBase> createFetchTask(SourceSplitBase sourceSplitBase) {
if (sourceSplitBase.isSnapshotSplit()) {
return new SqlServerSnapshotFetchTask(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 SqlServerTransactionLogFetchTask(sourceSplitBase.asIncrementalSplit());
}
}
@Override
public Optional<PrimaryKey> getPrimaryKey(JdbcConnection jdbcConnection, TableId tableId) {
return Optional.ofNullable(tableMap.get(tableId).getTableSchema().getPrimaryKey());
}
@Override
public List<ConstraintKey> getConstraintKeys(JdbcConnection jdbcConnection, TableId tableId) {
return tableMap.get(tableId).getTableSchema().getConstraintKeys();
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Check the wrapped SQLException cause for the real driver error
- Verify the connection is healthy and retry task creation (transient failures are common here)
- Re-validate login permissions on the CDC catalog views
- Confirm all incremental-split tables remain CDC-enabled (see capture check errors)
- Reduce flakiness with connection timeouts/retries in the JDBC config
Defensive patterns
Strategy: try-catch
Validate before calling
// same preflight as table capture check, run before job submission
// plus connectivity probe
try (Connection c = DriverManager.getConnection(url, user, pass)) {
assert c.isValid(10);
} Try / catch
try {
task = dialect.createFetchTask(split);
} catch (SeaTunnelException e) {
if (e.getCause() instanceof SQLException) {
// transient connection issue — retry task creation with backoff
}
throw e;
} Prevention
- Keep the JDBC connection healthy during job restarts (timeouts, retries)
- Re-check CDC enablement after any database restore or failover
- Grant stable permissions to the connector login so they survive across phases
- Monitor connection pool exhaustion during incremental phase startup
When it happens
Trigger: Creating the fetch task for an incremental split opens a JDBC connection and calls checkAllTablesEnabledCapture; a SQLException (connection drop, permission error, query failure) aborts validation before the task can be built.
Common situations: Connection pool exhausted or network instability during job restart; login losing permissions between snapshot and incremental phase; database failover while creating the log-read task.
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
- Couldn't obtain database name
- Error to discover tables: ${e.getMessage()}
- Read the binlog offset error
- Snapshotting of table ${table.id()} failed
- No result returned after running query [%s]
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/95da91ecca016736.
Report an issue: GitHub.