{"record":{"id":"95da91ecca016736","repo":"apache/seatunnel","slug":"error-to-check-tables-e-getmessage-95da91","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-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/SqlServerDialect.java","lineNumber":150,"sourceCode":"    }\n\n    @Override\n    public SqlServerSourceFetchTaskContext createFetchTaskContext(\n            SourceSplitBase sourceSplitBase, JdbcSourceConfig taskSourceConfig) {\n\n        return new SqlServerSourceFetchTaskContext((SqlServerSourceConfig) taskSourceConfig, this);\n    }\n\n    @Override\n    public FetchTask<SourceSplitBase> createFetchTask(SourceSplitBase sourceSplitBase) {\n        if (sourceSplitBase.isSnapshotSplit()) {\n            return new SqlServerSnapshotFetchTask(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            return new SqlServerTransactionLogFetchTask(sourceSplitBase.asIncrementalSplit());\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\n    @Override\n    public List<ConstraintKey> getConstraintKeys(JdbcConnection jdbcConnection, TableId tableId) {\n        return tableMap.get(tableId).getTableSchema().getConstraintKeys();\n    }\n}\n","sourceCodeStart":132,"sourceCodeEnd":166,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/SqlServerDialect.java#L132-L166","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// same preflight as table capture check, run before job submission\n// plus connectivity probe\ntry (Connection c = DriverManager.getConnection(url, user, pass)) {\n    assert c.isValid(10);\n}","typeGuard":null,"tryCatchPattern":"try {\n    task = dialect.createFetchTask(split);\n} catch (SeaTunnelException e) {\n    if (e.getCause() instanceof SQLException) {\n        // transient connection issue — retry task creation with backoff\n    }\n    throw e;\n}","preventionTips":["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"],"tags":["sqlserver","cdc","jdbc","fetch-task"],"backgroundTag":"sql-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}