ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

Server throwing the connection error abruptly and connection getting closed #919

Closed nsanthoshkumar closed 1 year ago

nsanthoshkumar commented 1 year ago

Hi, I have a node.js app and I am trying to get the data from DB2 warehouse hosted on cloud. While running the code locally, i don't have any issues. I deployed the app on the IBM Code Engine and it throws the following error after some queries that are running sequentially. I am seeing this problem after updating the ibm_db node module to "^3.1.0" and the node version is v18.14.2.
i am using openSync() for connection and prepareSync() for querying the data

I tried looking online and did not find any relevant information. Any help on the below issue is really appreciated. I cannot debug the issue as it only occurring on the server

[IBM][CLI Driver] SQL30081N  A communication error has been detected. Communication protocol being used: "SSL".  

Communication API being used: "SOCKETS".  Location where the error was detected: "".  
Communication function detecting the error: "sqlccSSLSocketRead". 
 Protocol specific error code(s): "420", "*", "*".  SQLSTATE=08001

error=[ibm_db] SQL_ERROR, sqlcode=-30081, state=40003
bimalkjha commented 1 year ago

@nsanthoshkumar I think you are from the same team as "Savithri Mahadeva Alage" with whom I interacted over slack for same issue. The issue got resolved by adding the IP Address of code engine application in the whitelist. If not, please let me know. If yes, please add your comment and close the issue. thanks.

nsanthoshkumar commented 1 year ago

@bimalkjha Thanks for your response. No, I don't belong to the team you mentioned. Can you let me know how to resolve the issue.

bimalkjha commented 1 year ago

@nsanthoshkumar As I mentioned, you need to whitelist the IP Address of Code Engine to solve this issue as Db2 is running under restricted environment. Please contact Savithri.Alage@ibm.com over slack to know details as she was facing similar issue and successfully resolved it today. Thanks.

nsanthoshkumar commented 1 year ago

@bimalkjha The issue is caused by the default timeout on the code-engine. I have increased the timeout and it fixed the issue.