{"record":{"id":"7f7ea8607c70aeb5","repo":"apache/seatunnel","slug":"snapshotting-of-table-table-id-failed-7f7ea8","errorCode":null,"errorMessage":"Snapshotting of table ${table.id()} failed","messagePattern":"Snapshotting of table (.+?) failed","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/source/reader/fetch/scan/OracleSnapshotSplitReadTask.java","lineNumber":263,"sourceCode":"                            snapshotSplit.splitId(),\n                            Strings.duration(stop - exportStart));\n                    snapshotProgressListener.rowsScanned(\n                            snapshotContext.partition, table.id(), rows);\n                    logTimer = getTableScanLogTimer();\n                }\n                dispatcher.dispatchSnapshotEvent(\n                        snapshotContext.partition,\n                        table.id(),\n                        getChangeRecordEmitter(snapshotContext, table.id(), row),\n                        snapshotReceiver);\n            }\n            LOG.info(\n                    \"Finished exporting {} records for split '{}', total duration '{}'\",\n                    rows,\n                    snapshotSplit.splitId(),\n                    Strings.duration(clock.currentTimeInMillis() - exportStart));\n        } catch (SQLException e) {\n            throw new ConnectException(\"Snapshotting of table \" + table.id() + \" failed\", e);\n        }\n    }\n\n    protected ChangeRecordEmitter<OraclePartition> getChangeRecordEmitter(\n            SnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext,\n            TableId tableId,\n            Object[] row) {\n        snapshotContext.offset.event(tableId, clock.currentTime());\n        return new SnapshotChangeRecordEmitter<>(\n                snapshotContext.partition, snapshotContext.offset, row, clock);\n    }\n\n    private Threads.Timer getTableScanLogTimer() {\n        return Threads.timer(clock, LOG_INTERVAL);\n    }\n\n    private static class OracleSnapshotContext\n            extends RelationalSnapshotChangeEventSource.RelationalSnapshotContext<","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/source/reader/fetch/scan/OracleSnapshotSplitReadTask.java#L245-L281","documentation":"OracleSnapshotSplitReadTask.createDataEventsForTable executes the snapshot SELECT for a table via JDBC and rethrows any SQLException as a ConnectException ('Snapshotting of table <id> failed'). It means the chunk query against the Oracle table failed during snapshot export. The original SQL error is preserved as the cause.","triggerScenarios":"SQLException while reading snapshot rows: connection lost mid-query, insufficient SELECT privileges, table dropped/truncated concurrently, query timeout, or ORA- errors (e.g., ORA-00942 table or view does not exist, ORA-01555 snapshot too old).","commonSituations":"CDC user missing SELECT on the table; table renamed/dropped during snapshot; long-running snapshot exceeding undo retention (ORA-01555); network interruption on very large tables.","solutions":["Grant SELECT on the snapshot tables to the CDC user","Check the wrapped SQLException/ORA code for the root cause","Avoid DDL or drops on tables while snapshot is running","Increase undo_retention or reduce fetch size / split size if hitting ORA-01555","Ensure stable network connectivity to the Oracle instance"],"exampleFix":"// before (DBA)\n-- no grant\n// after\nGRANT SELECT ON schema.my_table TO seatunnel_user;","handlingStrategy":"try-catch","validationCode":"GRANT SELECT ON schema.my_table TO seatunnel_user;\n// Java pre-check\ntry (ResultSet rs = stmt.executeQuery(\"SELECT COUNT(*) FROM \" + tableId + \" WHERE ROWNUM = 1\")) { rs.next(); }","typeGuard":null,"tryCatchPattern":"try {\n    snapshotSplitReadTask.execute(ctx, partition, offsetContext);\n} catch (ConnectException e) {\n    Throwable root = e.getCause(); // SQLException with ORA code\n    LOG.error(\"Snapshot failed for table; root cause: {}\", root.getMessage(), root);\n    throw e;\n}","preventionTips":["Grant SELECT on all captured tables to the CDC user before starting","Do not drop/rename/alter tables during snapshot","Increase undo_retention or lower fetch size if ORA-01555 occurs","Monitor long-running snapshots for connection drops"],"tags":["oracle-cdc","snapshot","sql","ora-error"],"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-23T08:17:48.524Z"}