apache/seatunnel · warning
Failed to start Oracle LogMiner session, retrying...
Error message
Failed to start Oracle LogMiner session, retrying...
What it means
startMiningSession failed to start the LogMiner session with ORA-01291 (missing logfile) / error 1291. While attempts remain (attempts <= MINING_START_RETRIES) it warns and returns false so the caller can retry after the log situation changes; after exhausting retries it logs an error and fails the session.
Solutions
- Cap endScn at the last archived redo (query v$archived_log for max NEXT_CHANGE#) before starting the session.
- Ensure archive log mode is on and all required logs are present: verify with SELECT name FROM v$archived_log WHERE first_change# <= <scn> AND next_change# > <scn>;
- Let the connector retry — it is designed to succeed once logs become available; monitor until attempts exceed MINING_START_RETRIES.
- Restore missing archive logs from backup if they were deleted and the SCN range is mandatory.
Example fix
// before startMiningSession(startScn, endScn /* endScn beyond last archived log */); // after // endScn = min(endScn, max NEXT_CHANGE# from v$archived_log) startMiningSession(startScn, cappedEndScn);
Defensive patterns
Strategy: retry
Validate before calling
-- confirm all logs in range are archived SELECT count(*) FROM v$archived_log WHERE first_change# <= :startScn AND next_change# > :endScn;
Try / catch
for (int attempt = 1; attempt <= MINING_START_RETRIES; attempt++) { if (startMiningSession(attempt)) break; Thread.sleep(3000); } Prevention
- Cap endScn to last archived redo before mining.
- Keep archive log mode enabled with adequate retention.
- For ADG/standby, account for log transport lag.
When it happens
Trigger: LogMiner START LOGMINING raised ORA-01291: usually the requested SCN range (startScn..endScn) references archive logs that are missing/not yet archived, or a log file was added/removed concurrently.
Common situations: Mining an SCN range whose redo hasn't been archived yet; archive logs deleted mid-mining; standby/ADG setups where logs lag; endScn beyond current archived redo.
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
- Transaction was still ongoing while snapshot was taken, but…
- Could not query the view
- not support this type of bufferType
- Airtable API rate limit reached, retry
- Airtable API rate limit reached, retry
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/b24b46b6aea9c07c.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/LogMinerStreamingChangeEventSource.java:690
LOGGER.trace(
"Starting mining session startScn={}, endScn={}, strategy={}, continuous={}",
startScn,
endScn,
strategy,
isContinuousMining);
try {
Instant start = Instant.now();
// NOTE: we treat startSCN as the _exclusive_ lower bound for mining,
// whereas START_LOGMNR takes an _inclusive_ lower bound, hence the increment.
connection.executeWithoutCommitting(
SqlUtils.startLogMinerStatement(
startScn.add(Scn.ONE), endScn, strategy, isContinuousMining));
streamingMetrics.addCurrentMiningSessionStart(Duration.between(start, Instant.now()));
return true;
} catch (SQLException e) {
if (e.getErrorCode() == 1291 || e.getMessage().startsWith("ORA-01291")) {
if (attempts <= MINING_START_RETRIES) {
LOGGER.warn("Failed to start Oracle LogMiner session, retrying...");
return false;
}
LOGGER.error(
"Failed to start Oracle LogMiner after '{}' attempts.",
MINING_START_RETRIES,
e);
}
LOGGER.error("Got exception when starting mining session.", e);
// Capture the database state before throwing the exception up
LogMinerDatabaseStateWriter.write(connection);
throw e;
}
}
/**
* End the current Oracle LogMiner session, if one is in progress. If the current session does
* not have an active mining session, a log message is recorded and the method is a no-op.
*View on GitHub (pinned to cf67b549a7)