Talend写入PostgreSQL最终作业失败:SSL连接重置错误求助
问题排查:Talend最终作业PostgreSQL SSL连接重置错误
问题描述
- 搭建了两个Talend作业:staging作业负责将数据写入PostgreSQL临时表,完成后由最终作业将临时表数据写入同一数据库的最终表
- staging作业运行正常,但最终作业执行失败,报错信息为
SSL error: java.net.SocketException: Connection reset - 已与Talend及数据库团队确认服务器层面无异常,无法定位失败原因,需协助排查
环境版本
- Talend 版本:7.3
- PostgreSQL 版本:14.2
错误日志
[INFO ]: aws_dev_engagebh.job_stg_view_to_ods_orders_view_0_3.Job_STG_VIEW_TO_ODS_ORDERS_VIEW - TalendJob: 'Job_STG_VIEW_TO_ODS_ORDERS_VIEW' - Start. [statistics] connecting to socket on port 10633 [statistics] connected [FATAL]: aws_dev_engagebh.job_stg_view_to_ods_orders_view_0_3.Job_STG_VIEW_TO_ODS_ORDERS_VIEW - tDBOutput_2 SSL error: java.net.SocketException: Connection reset org.postgresql.util.PSQLException: SSL error: java.net.SocketException: Connection reset at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:43) at org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:446) at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:140) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:217) at org.postgresql.Driver.makeConnection(Driver.java:458) at org.postgresql.Driver.connect(Driver.java:260) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at aws_dev_engagebh.job_stg_view_to_ods_orders_view_0_3.Job_STG_VIEW_TO_ODS_ORDERS_VIEW.tDBInput_1Process(Job_STG_VIEW_TO_ODS_ORDERS_VIEW.java:5543) at aws_dev_engagebh.job_stg_view_to_ods_orders_view_0_3.Job_STG_VIEW_TO_ODS_ORDERS_VIEW.runJobInTOS(Job_STG_VIEW_TO_ODS_ORDERS_VIEW.java:7971) at aws_dev_engagebh.job_stg_view_to_ods_orders_view_0_3.Job_STG_VIEW_TO_ODS_ORDERS_VIEW.main(Job_STG_VIEW_TO_ODS_ORDERS_VIEW.java:7316) Caused by: javax.net.ssl.SSLException: java.net.SocketException: Connection reset at sun.security.ssl.Alert.createSSLException(Alert.java:127) at sun.security.ssl.TransportContext.fatal(TransportContext.java:370) at sun.security.ssl.TransportContext.fatal(TransportContext.java:313) at sun.security.ssl.TransportContext.fatal(TransportContext.java:308) at sun.security.ssl.SSLTransport.decode(SSLTransport.java:141) at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1290) at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1199) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:401) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373) at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:41)
排查建议
- 对比两个作业的数据库连接配置:重点检查SSL相关参数(如
sslmode、证书路径、是否强制SSL等),staging作业正常说明基础连接逻辑可行,最终作业可能存在SSL配置差异 - 升级PostgreSQL JDBC驱动:Talend 7.3默认的驱动版本可能与PostgreSQL 14.2不兼容,尝试替换为适配14.x版本的驱动(如42.2.25及以上)
- 调整连接超时参数:若最终作业处理数据量较大,可能因连接超时被重置,修改Talend作业中的
loginTimeout、socketTimeout等参数 - 查看数据库SSL日志:检查PostgreSQL的
pg_log目录下的日志,查找最终作业连接时SSL握手的详细错误信息 - 模拟连接测试:使用最终作业的连接参数,通过psql或其他客户端手动连接数据库,验证是否能复现错误
- 排查网络限制:确认防火墙、负载均衡是否存在会话超时或连接数限制,最终作业的连接时机或请求特征可能触发此类限制
内容的提问来源于stack exchange,提问作者Trupthi Mishra
相关产品推荐
相关产品推荐

