Lý Thành
05/29/2026, 2:40 AMRocky
05/29/2026, 2:41 AMorg.postgresql.util.PSQLException: An I/O error occurred while sending to the backend indicates that a PostgreSQL JDBC driver is being used to communicate with a database, and the connection was interrupted or failed during the protocol handshake.
If you are trying to connect to StarRocks, this error occurs for the following reason:
1. Protocol Mismatch (Most Likely)
StarRocks is compatible with the MySQL wire protocol, not the PostgreSQL protocol.
* The Issue: You are using the PostgreSQL JDBC driver (org.postgresql.Driver) or a jdbc:postgresql:// connection string.
* The Solution: You must use a MySQL-compatible JDBC driver (such as mysql-connector-java or mariadb-java-client) and a MySQL JDBC URL:
* Driver Class: com.mysql.cj.jdbc.Driver
* JDBC URL: jdbc:mysql://<fe_host>:<query_port>/<database> (The default query port is 9030).
2. Use the Recommended Connector
Your stack trace shows you are using the generic io.debezium.connector.jdbc.JdbcChangeEventSink. While this can work via the MySQL driver, it is highly recommended to use the native StarRocks Kafka Connector for sinking data from Kafka/Debezium into StarRocks.
The native connector is optimized for StarRocks' Stream Load API, providing much better performance and features like:
* Direct loading into Primary Key tables with support for Upserts/Deletes.
* Automatic schema evolution.
* Transaction support for exactly-once semantics.
Example configuration for the StarRocks Kafka Connector:
properties
connector.class=com.starrocks.connector.kafka.StarRocksSinkConnector
starrocks.http.url=<fe_host>:8030
starrocks.database.name=<your_db>
starrocks.username=<user>
starrocks.password=<password>
3. General Network/SSL Issues
If you are actually sinking data to a PostgreSQL database (not StarRocks) and just using StarRocks as a source:
* SSL/TLS Mismatch: Check if the target database requires SSL. If the driver tries to use SSL but the server doesn't support it (or vice versa), this I/O error often occurs.
* Firewalls/Timeouts: Ensure there are no firewalls or proxies (like HAProxy or F5) dropping the connection.
* Max Connections: Check if the target database has reached its maximum connection limit and is rejecting new ones.
Summary:
If StarRocks is your destination, switch from the PostgreSQL driver to the MySQL driver and use port 9030. For the best experience, switch to the StarRocks Kafka Connector.
References
• data_source/catalog/jdbc_catalog.md
• data_source/External_table.md
• data_source/feature-support-data-lake-analytics.md
• loading/Kafka-connector-starrocks.md