0

I have configured Bluemix Secure gateway client to connect to DB2 on AS 400 using a Windows machine. I am able to run the Db2 connection successfully from the application on Windows machine where Secure gateway client is running. But when I run the same application on Bluemix with modifying the code to depict Secure Gateway client destination details, I get 'Connection Refused' error.

I had gone through how to connect a bluemix app to on-premise db/as400? , which mentions about Secure gateway client for OS 400. Wanted to understand how to fix the issue for 'Connection Refused' ? Do we have to use different DB2Driver/ DB2 Connect string from Bluemix? or Any other settings to be done on AS400 server?

Community
  • 1
  • 1
  • I am using JT driver and have mapped to port 446 for DB2. Also have configured ACL for DB2 server with port 446. – Harish Shenoy Feb 16 '17 at 10:11
  • Is the `Connection Refused` error happening in the BlueMix app or on the SG Client? Assuming the connection is reaching the SG Client, would you be able to share a subset of the logs that are associated with the connection attempt? – Galen Keene Feb 16 '17 at 15:22
  • Connection refused happens in Bluemix APP. Below is the stacktrace err] java.sql.SQLException: The application requester cannot establish the connection. (Connection refused (Connection refused)) [err] java.sql.SQLException: The application requester cannot establish the connection. (Connection refused (Connection refused)) [err] at com.ibm.as400.access.JDError.throwSQLException(JDError.java:566) [err] at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:3346) [err] at com.ibm.as400.access.AS400JDBCDriver.prepareConnection – Harish Shenoy Feb 16 '17 at 17:59
  • In that case, that error is generally only encountered if the listener hasn't been established on the SG server. Is the SG Client connected to the gateway? If it is, could you provide the logs generated on startup? – Galen Keene Feb 16 '17 at 19:34
  • Yes... SG Server is connected to SG Client. I have also used the SG server/SG CLient combination to connect to couple of other MYSQL DB using different destination and it works fine. Issue is with Only DB2 on AS400 – Harish Shenoy Feb 17 '17 at 10:52

1 Answers1

0

Given that the Connection refused error is occurring between your BlueMix application and the SG Servers and no logs are being generated on the SG Client, it sounds like the issue is with a listener not being opened on the SG Servers rather than an issue between the SG Client and DB2. All listeners should come up when the SG Client initially connects to the SG Servers.

Are you able to cURL or telnet the cloud host:port provided with this particular destination? Or is this connection refusal specific to your BlueMix app? In either case, this answer will provide more direction on where to investigate further.

Galen Keene
  • 303
  • 1
  • 10
  • I dont think issue is between Bluemix APp and SG Server. In the same Bluemix Application with the same SG Server and SG client combination, I am using MYSQL and it connects properly. Both MYSQL and DB2 on same network which use the same SGCLient. MYSQL connection works fine but DB2 on AS 400 gives Connection refused error. I am not sure whether some unique settings is required for DB2 on AS-400 – Harish Shenoy Feb 18 '17 at 06:31
  • If no logs are being generated on the SG Client when your BlueMix app attempts to connect, then the connection is never making it past the SG Servers. – Galen Keene Feb 20 '17 at 14:37
  • Thanks. I am able to use same SGCLient with SGServer to connect to MYSQL. This means that communication is proper within the combination, Not sure why it is not working or generating log for DB2 connection. Do you have any idea how we can debug the same to get more logs? Currently I have set to TRACE option – Harish Shenoy Feb 22 '17 at 04:36
  • Unfortunately, there is currently no way to publicly access the connection logs on the SG Servers for troubleshooting -- it all has to be done based on the configuration of the destination and the error reporting from the application logs. Is it possible that the protocol you've configured for the initial connection doesn't match what your application is actually trying to connect with? – Galen Keene Mar 02 '17 at 19:45