{"record":{"id":"f40472c27e7e727d","repo":"apache/seatunnel","slug":"couldn-t-get-timestamp-utils-from-underlying-conne","errorCode":null,"errorMessage":"Couldn't get timestamp utils from underlying connection","messagePattern":"Couldn't get timestamp utils from underlying connection","errorType":"exception","errorClass":"DebeziumException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java","lineNumber":611,"sourceCode":"                        }\n                    });\n        }\n        return serverInfo;\n    }\n\n    public Charset getDatabaseCharset() {\n        try {\n            return Charset.forName(((BaseConnection) connection()).getEncoding().name());\n        } catch (SQLException e) {\n            throw new DebeziumException(\"Couldn't obtain encoding for database \" + database(), e);\n        }\n    }\n\n    public TimestampUtils getTimestampUtils() {\n        try {\n            return ((PgConnection) this.connection()).getTimestampUtils();\n        } catch (SQLException e) {\n            throw new DebeziumException(\n                    \"Couldn't get timestamp utils from underlying connection\", e);\n        }\n    }\n\n    private static void validateServerVersion(Statement statement) throws SQLException {}\n\n    @Override\n    public String quotedColumnIdString(String columnName) {\n        if (columnName.contains(\"\\\"\")) {\n            columnName = columnName.replaceAll(\"\\\"\", \"\\\"\\\"\");\n        }\n\n        return super.quotedColumnIdString(columnName);\n    }\n\n    @Override\n    protected int resolveNativeType(String typeName) {\n        return getTypeRegistry().get(typeName).getRootType().getOid();","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java#L593-L629","documentation":"getTimestampUtils casts the underlying connection to PgConnection to fetch its TimestampUtils, wrapping any SQLException in a DebeziumException with this message. TimestampUtils is required for correct temporal value conversion, so failure here aborts connection initialization.","triggerScenarios":"((PgConnection) this.connection()).getTimestampUtils() throws SQLException, typically because the connection has been closed or is otherwise in a broken state when the PostgresConnection is being set up.","commonSituations":"Server restarted or network dropped during connector startup; connection invalidated by an idle timeout between opening and initializing; misconfigured keepalives in long-lived CDC connections.","solutions":["Restart the connector to re-establish a fresh JDBC connection.","Check PostgreSQL server logs and network stability (firewalls, LB idle timeouts) between the connector and database.","Enable TCP keepalives on the JDBC URL (tcpKeepAlive=true) and tune related connection parameters.","Verify driver compatibility — getTimestampUtils requires the actual PostgreSQL (or compatible) driver connection, not a wrapped pool proxy."],"exampleFix":"// before\njdbc:postgresql://host:5432/db\n// after\njdbc:postgresql://host:5432/db?tcpKeepAlive=true","handlingStrategy":"retry","validationCode":"SELECT 1; -- run over the same JDBC connection to confirm it is alive before initializing","typeGuard":null,"tryCatchPattern":"try {\n    connection.getTimestampUtils();\n} catch (DebeziumException e) {\n    // connection closed/broken: reconnect with backoff and retry initialization\n}","preventionTips":["Enable tcpKeepAlive=true on the JDBC URL.","Tune firewall/LB idle timeouts to exceed connector initialization time.","Watch server logs for restarts coinciding with connector startup."],"tags":["cdc","postgres","jdbc","connection"],"backgroundTag":"database-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"}