{"record":{"id":"99e8b07b7eed76c1","repo":"apache/seatunnel","slug":"unable-to-parse-create-replication-slot-response","errorCode":null,"errorMessage":"Unable to parse create_replication_slot response","messagePattern":"Unable to parse create_replication_slot response","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java","lineNumber":506,"sourceCode":"\n    protected BaseConnection pgConnection() throws SQLException {\n        return (BaseConnection) connection(false);\n    }\n\n    private SlotCreationResult parseSlotCreation(ResultSet rs) {\n        try {\n            if (rs.next()) {\n                String slotName = rs.getString(\"slot_name\");\n                String startPoint = rs.getString(\"consistent_point\");\n                String snapName = rs.getString(\"snapshot_name\");\n                String pluginName = rs.getString(\"output_plugin\");\n\n                return new SlotCreationResult(slotName, startPoint, snapName, pluginName);\n            } else {\n                throw new ConnectException(\"No replication slot found\");\n            }\n        } catch (SQLException ex) {\n            throw new ConnectException(\"Unable to parse create_replication_slot response\", ex);\n        }\n    }\n\n    private ReplicationStream createReplicationStream(\n            final Lsn startLsn, WalPositionLocator walPosition)\n            throws SQLException, InterruptedException {\n        PGReplicationStream s;\n\n        try {\n            try {\n                s =\n                        startPgReplicationStream(\n                                startLsn,\n                                plugin.forceRds()\n                                        ? messageDecoder::optionsWithoutMetadata\n                                        : messageDecoder::optionsWithMetadata);\n                messageDecoder.setContainsMetadata(plugin.forceRds() ? false : true);\n            } catch (PSQLException e) {","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java#L488-L524","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","Verify server version compatibility: check the openGauss/Postgres version against the connector's supported matrix and upgrade the connector if the result schema changed.","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.","Check server logs for errors emitted during CREATE_REPLICATION_SLOT (e.g. plugin not found) that manifest as driver-level SQLExceptions.","Retry after confirming network stability; if the slot was partially created, drop it (pg_drop_replication_slot) before reconnecting."],"exampleFix":"// before: driver mismatch produces SQLException reading result columns\n<dependency>postgresql 42.2.x</dependency>  // bundled mismatch\n// after: match driver version used by the connector\n<dependency>\n  <groupId>org.postgresql</groupId>\n  <artifactId>postgresql</artifactId>\n  <version>42.5.x</version>\n</dependency>","handlingStrategy":"try-catch","validationCode":"// verify the server's CREATE_REPLICATION_SLOT response schema matches expectations\n// via psql in replication mode:\n//   psql \"replication=database\" -c \"CREATE_REPLICATION_SLOT probe LOGICAL pgoutput EXPORT_SNAPSHOT\"\n//   then: DROP via pg_drop_replication_slot('probe')","typeGuard":null,"tryCatchPattern":"try {\n    connection.initReplicationSlot();\n} catch (ConnectException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Unable to parse create_replication_slot response\")) {\n        // check wrapped SQLException cause; align driver/server versions, drop partially created slot, retry\n    } else {\n        throw e;\n    }\n}","preventionTips":["Pin the PostgreSQL JDBC driver version the connector was built and tested with.","Test slot creation manually in replication mode on the target server version before production rollout.","Check server logs for command-time errors that surface as SQLExceptions on the client.","After a failed slot creation, always pg_drop_replication_slot any partially created slot before retrying."],"tags":["postgresql","cdc","replication-slot","jdbc","protocol"],"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-14T05:17:10.506Z"}