Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
TC1697460415
Contributor II
Contributor II

Connection Timeout

I am trying to load CSV files to the DB on remote server, It starts loading few files and later it gives connect Timeout Exception

ss7_cdr_loading at 15:08 05/02/2024. [statistics] connecting to socket on port 3357 [statistics] connected Exception in component tDBOutput_1 (ss7_cdr_loading) org.postgresql.util.PSQLException: The connection attempt failed. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:297) 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/java.sql.DriverManager.getConnection(DriverManager.java:683) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:230) at tigo_tanzania.ss7_cdr_loading_0_1.ss7_cdr_loading.tFileList_1Process(ss7_cdr_loading.java:1167) at tigo_tanzania.ss7_cdr_loading_0_1.ss7_cdr_loading.runJobInTOS(ss7_cdr_loading.java:2166) at tigo_tanzania.ss7_cdr_loading_0_1.ss7_cdr_loading.main(ss7_cdr_loading.java:2004) Caused by: java.net.SocketTimeoutException: Connect timed out at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:543) at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:594) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) at java.base/java.net.Socket.connect(Socket.java:633) at org.postgresql.core.PGStream.<init>(PGStream.java:81) at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:93) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197) ... 9 more [statistics] disconnected Job ss7_cdr_loading ended at 15:10 05/02/2024. [Exit code = 1]                                         

Tried setting the connection in metadata, it worked fine, Test connection was successful.                                         In advanced setting added connectTimeout parameter. (Wanted to know whether it is in milliseconds or seconds) It loaded some 7 files and threw this error later                                                                                                          

Starting job ss7_cdr_loading at 14:48 06/02/2024.
[statistics] connecting to socket on port 3648
[statistics] connected
Exception in component tDBOutput_1 (ss7_cdr_loading)
org.postgresql.util.PSQLException: Connection to 'ServerIP':5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:285)
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/java.sql.DriverManager.getConnection(DriverManager.java:683)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:230)
at tigo_tanzania.ss7_cdr_loading_0_1.ss7_cdr_loading.tFileList_1Process(ss7_cdr_loading.java:1252)
at tigo_tanzania.ss7_cdr_loading_0_1.ss7_cdr_loading.runJobInTOS(ss7_cdr_loading.java:2330)
at tigo_tanzania.ss7_cdr_loading_0_1.ss7_cdr_loading.main(ss7_cdr_loading.java:2089)
Caused by: java.net.ConnectException: Connection timed out: no further information
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:594)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at org.postgresql.core.PGStream.<init>(PGStream.java:81)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:93)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)
... 9 more
[statistics] disconnected
 
Job ss7_cdr_loading ended at 14:49 06/02/2024. [Exit code  = 1]
 
TC1697460415_0-1707211814417.pngTC1697460415_1-1707211834499.png

 

Labels (4)
2 Replies
jeoste
Creator
Creator

Hello,

Seems like the problem is not about the connectTimeout in additional params, but the refused connection from the server.

Can you try to put a tDBConnect to verify the connection is working well.

Once done, try to execute your job with tDBOutput with only one row to exclude the connection problem.

Regards

MattE
Creator II
Creator II

Are you using context variables for the credentials, try printing them out (maybe not the password) in the logs to verify it's using the correct credentials.

Has your remote server been whitelisted to access the database?