apache/seatunnel · warning
Failed to start replication stream at {}, waiting for {} ms
Error message
Failed to start replication stream at {}, waiting for {} ms and retrying, attempt number {} over {} What it means
startStreaming attempted to open a WAL replication stream (START_REPLICATION) and got a transient/retryable failure (e.g. 'replication slot is active'). It logs a warning, sleeps delay ms via Metronome, and retries up to maxRetries times before throwing a DebeziumException.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java:417
LOGGER.debug("starting streaming from LSN '{}'", lsn);
}
final int maxRetries = connectorConfig.maxRetries();
final Duration delay = connectorConfig.retryDelay();
int tryCount = 0;
while (true) {
try {
return createReplicationStream(lsn, walPosition);
} catch (Exception e) {
String message = "Failed to start replication stream at " + lsn;
if (++tryCount > maxRetries) {
if (e.getMessage().matches(".*replication slot .* is active.*")) {
message +=
"; when setting up multiple connectors for the same database host, please make sure to use a distinct replication slot name for each.";
}
throw new DebeziumException(message, e);
} else {
LOGGER.warn(
message + ", waiting for {} ms and retrying, attempt number {} over {}",
delay,
tryCount,
maxRetries);
final Metronome metronome = Metronome.sleeper(delay, Clock.SYSTEM);
metronome.pause();
}
}
}
}
@Override
public void initConnection() throws SQLException, InterruptedException {
// See https://www.postgresql.org/docs/current/logical-replication-quick-setup.html
// For pgoutput specifically, the publication must be created before the slot.
initPublication();
if (!hasInitedSlot) {
initReplicationSlot();View on GitHub (pinned to cf67b549a7)
Solutions
- Ensure a distinct slot.name per connector instance when multiple connectors target the same database host.
- Wait/retry — this is transient; if the previous owner is gone, the retry loop usually succeeds.
- Kill the stale backend streaming from the slot: SELECT pg_terminate_backend(active_pid) FROM pg_replication_slots WHERE slot_name='<slot>';
- Increase maxRetries/delay if the competing session legitimately takes long to release the slot.
Example fix
// before: two tasks on same host
{"slot.name": "my_slot"} // in both configs
// after
// task 1: {"slot.name": "my_slot_1"}
// task 2: {"slot.name": "my_slot_2"} Defensive patterns
Strategy: retry
Validate before calling
SELECT active, active_pid FROM pg_replication_slots WHERE slot_name='<slot>'; -- ensure inactive before startStreaming
Try / catch
try { startStreaming(); } catch (DebeziumException e) { if (e.getMessage().contains("is active")) { backoffRetry(); } else { throw e; } } Prevention
- Unique slot.name per connector/host.
- Cleanly stop old connectors before starting new ones.
- Set sane retry delay/maxRetries for restart storms.
When it happens
Trigger: startStreaming -> createReplicationStream fails with a retryable PSQLException on each attempt; if the message matches 'replication slot .* is active', the exception also hints to use distinct slot names per connector.
Common situations: Two connectors streaming from the same replication slot; a previous connection to the slot not fully closed yet (failover/restart race); network blips between the JDBC replication connection and the server.
Related errors
- Failed to start replication stream at <lsn>
- Unable to %s filtered publication %s for %s
- The DB connection is not a valid replication connection
- Connection retry sleep interrupted by exception:
- Cannot obtain valid replication slot '{}' for plugin '{}' an
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/ff07d46d944a0136.
Report an issue: GitHub.