apache/seatunnel · warning
No table has enabled CDC or security constraints prevent get
Error message
No table has enabled CDC or security constraints prevent getting the list of change tables
What it means
Db2TransactionLogFetchTask.getCdcTablesToQuery queries the DB2 CDC staging tables via dataConnection.listOfChangeTables(). When the returned set is empty, it logs this warning meaning either no table in the database has CDC enabled, or the connecting user lacks the privileges needed to see the CDC change tables (sys.cdc.change_tables is permission-filtered). The fetch task then proceeds with no tables to poll, producing an empty stream instead of failing.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/source/reader/fetch/transactionlog/Db2TransactionLogFetchTask.java:420
if (matcher.matches()) {
String captureName = matcher.group(1);
LOG.info("Table is no longer captured with capture instance {}", captureName);
return Arrays.stream(currentChangeTables)
.filter(
changeTable ->
!changeTable.getCaptureInstance().equals(captureName))
.collect(Collectors.toList())
.toArray(new Db2ChangeTable[0]);
}
throw exception;
}
private Db2ChangeTable[] getCdcTablesToQuery(
Db2Partition partition, Db2OffsetContext offsetContext)
throws SQLException, InterruptedException {
Set<Db2ChangeTable> cdcEnabledTables = dataConnection.listOfChangeTables();
if (cdcEnabledTables.isEmpty()) {
LOG.warn(
"No table has enabled CDC or security constraints prevent getting the list of change tables");
}
Map<TableId, List<Db2ChangeTable>> includedAndCdcEnabledTables =
cdcEnabledTables.stream()
.filter(
changeTable ->
connectorConfig
.getTableFilters()
.dataCollectionFilter()
.isIncluded(changeTable.getSourceTableId()))
.collect(Collectors.groupingBy(Db2ChangeTable::getSourceTableId));
if (includedAndCdcEnabledTables.isEmpty()) {
LOG.warn(DatabaseSchema.NO_CAPTURED_DATA_COLLECTIONS_WARNING);
}
List<Db2ChangeTable> tables = new ArrayList<>();View on GitHub (pinned to cf67b549a7)
Solutions
- Enable CDC on the database and on each source table (e.g. EXEC sys.sp_cdc_enable_db then sys.sp_cdc_enable_table for every table the connector should capture) before starting the job
- Verify the CDC capture/cleanup jobs are running (capture instance must be active or change tables never appear)
- Re-run the connector with an account that has sufficient privileges (db_owner or explicit SELECT on cdc schema and VIEW DATABASE STATE) to see change tables
- Check the connector's table include list: if tables are captured but filtered out, review database.include.list / table.include.list config
Example fix
// before (connector logs warning and streams nothing) Db2ChangeTable[] tables = getCdcTablesToQuery(partition, offsetContext); // empty // after (DB-side prerequisite, run as admin on the source database) EXEC sys.sp_cdc_enable_db; EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'MyTable', @role_name = NULL;
Defensive patterns
Strategy: validation
Validate before calling
// Before starting the CDC job, verify change tables are visible to the connector user
int count = runQueryAsConnectorUser(
"SELECT COUNT(*) FROM sys.cdc.change_tables");
if (count == 0) {
throw new IllegalStateException(
"No CDC change tables visible: enable CDC on tables and/or grant the connector user access to cdc metadata");
} Prevention
- Enable CDC at the database level and per-table before deploying the connector
- Provision the connector's DB account with privileges to read CDC metadata (change tables are security-filtered)
- Monitor the source database: alert when the CDC capture job is stopped or when change table count drops to zero
- Include a startup smoke test that lists change tables and fails fast when empty
When it happens
Trigger: Db2TransactionLogFetchTask.getCdcTablesToQuery() (called from tablesSlot/tables) runs at snapshot/stream start and listOfChangeTables() returns an empty set because: (1) no table in the database has 'ALTER TABLE ... ENABLE CDC' (Debezium/SQL Server style CDC capture instance) applied; (2) the SQL Server Agent / CDC capture job is not running so change tables were never materialized; (3) the login lacks VIEW DATABASE STATE / db_owner / sysadmin rights so CDC metadata tables are filtered out.
Common situations: Fresh DB2/Db2-z or SQL-Server-compatible CDC environment where administrators forgot to enable CDC on the source tables; connecting with a low-privileged monitoring account instead of the CDC-enabled account; CDC disabled at the database level (is_cdc_enabled = 0) so even enabled-looking tables have no change tables; security hardening revoked access to system CDC catalog views.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- No captured data collections found in database
- Read split %s error due to %s.
- Error to discover tables:
- Table is not enabled for capture
- Error to check tables:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/4aab8bdaa29b367b.
Report an issue: GitHub.