<@U0A71G31CDV> Caused by: org.hibernate.exception....
# questions-and-troubleshooting
l
@Rocky Caused by: org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection [An I/O error occurred while sending to the backend.] [n/a]   at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:80)   at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:34)   at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:115)   at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:101)   at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquire(LogicalConnectionManagedImpl.java:190)   at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:87)   at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:126)   at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:312)   at org.hibernate.internal.AbstractSharedSessionContract.doWork(AbstractSharedSessionContract.java:1162)   at org.hibernate.internal.AbstractSharedSessionContract.doReturningWork(AbstractSharedSessionContract.java:1158)   at io.debezium.connector.jdbc.JdbcChangeEventSink.lambda$hasTable$4(JdbcChangeEventSink.java:324)   at io.debezium.connector.jdbc.JdbcChangeEventSink.executeWithRetries(JdbcChangeEventSink.java:460)   ... 20 more Caused by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend. Unable to acquire JDBC Connection [An I/O error occurred while sending to the backend
r
The error
org.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:
Copy code
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. Referencesdata_source/catalog/jdbc_catalog.mddata_source/External_table.mddata_source/feature-support-data-lake-analytics.mdloading/Kafka-connector-starrocks.md