apache/seatunnel · error · ConnectException

Unable to parse create_replication_slot response

Error message

Unable to parse create_replication_slot response

What it means

Thrown by parseSlotCreation when reading the CREATE_REPLICATION_SLOT response throws a SQLException. The result row exists but its columns (consistent_point, snapshot_name, output_plugin) cannot be read, meaning the server returned an unexpected or malformed replication command response. Wrapped in a ConnectException with the original SQLException as cause.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java:506

    protected BaseConnection pgConnection() throws SQLException {
        return (BaseConnection) connection(false);
    }

    private SlotCreationResult parseSlotCreation(ResultSet rs) {
        try {
            if (rs.next()) {
                String slotName = rs.getString("slot_name");
                String startPoint = rs.getString("consistent_point");
                String snapName = rs.getString("snapshot_name");
                String pluginName = rs.getString("output_plugin");

                return new SlotCreationResult(slotName, startPoint, snapName, pluginName);
            } else {
                throw new ConnectException("No replication slot found");
            }
        } catch (SQLException ex) {
            throw new ConnectException("Unable to parse create_replication_slot response", ex);
        }
    }

    private ReplicationStream createReplicationStream(
            final Lsn startLsn, WalPositionLocator walPosition)
            throws SQLException, InterruptedException {
        PGReplicationStream s;

        try {
            try {
                s =
                        startPgReplicationStream(
                                startLsn,
                                plugin.forceRds()
                                        ? messageDecoder::optionsWithoutMetadata
                                        : messageDecoder::optionsWithMetadata);
                messageDecoder.setContainsMetadata(plugin.forceRds() ? false : true);
            } catch (PSQLException e) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the wrapped SQLException cause for the exact driver error and align the PostgreSQL JDBC driver version with the one the connector was built against.
  2. Verify server version compatibility: check the openGauss/Postgres version against the connector's supported matrix and upgrade the connector if the result schema changed.
  3. Re-run the command manually via psql in replication mode (`psql "replication=database" -c "CREATE_REPLICATION_SLOT test LOGICAL pgoutput"`) to inspect the actual returned columns.
  4. Check server logs for errors emitted during CREATE_REPLICATION_SLOT (e.g. plugin not found) that manifest as driver-level SQLExceptions.
  5. Retry after confirming network stability; if the slot was partially created, drop it (pg_drop_replication_slot) before reconnecting.

Example fix

// before: driver mismatch produces SQLException reading result columns
<dependency>postgresql 42.2.x</dependency>  // bundled mismatch
// after: match driver version used by the connector
<dependency>
  <groupId>org.postgresql</groupId>
  <artifactId>postgresql</artifactId>
  <version>42.5.x</version>
</dependency>
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the server's CREATE_REPLICATION_SLOT response schema matches expectations
// via psql in replication mode:
//   psql "replication=database" -c "CREATE_REPLICATION_SLOT probe LOGICAL pgoutput EXPORT_SNAPSHOT"
//   then: DROP via pg_drop_replication_slot('probe')

Try / catch

try {
    connection.initReplicationSlot();
} catch (ConnectException e) {
    if (e.getMessage() != null && e.getMessage().contains("Unable to parse create_replication_slot response")) {
        // check wrapped SQLException cause; align driver/server versions, drop partially created slot, retry
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: The JDBC driver throws while extracting getString("consistent_point") / "snapshot_name" / "output_plugin" from the create_replication_slot result: column labels differ on the server/driver version, the response is a partial or errored result, or the connection broke mid-response.

Common situations: openGauss or newer/older PostgreSQL versions whose CREATE_REPLICATION_SLOT result schema differs from what this Debezium fork expects; JDBC driver version incompatibility changing result metadata; server-side errors mid-command surfacing as SQLExceptions on result access; network interruption during slot creation.

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


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/99e8b07b7eed76c1. Report an issue: GitHub.