Sql-server – Connection reset to SQL Server when using SSH Tunnel

connectivitydbeaversql serversshUbuntu

I am trying to connect to an MS SQL Server database through DBeaver via an SSH tunnel but am getting the following error message when I "Test Connection…":

I/O Error: Connection reset
java.net.SocketException : Connection reset

enter image description here

If I set the Keep-Alive interval to anything other than 0, the error becomes the following:

Can't initialize tunnel
  Cannot establish tunnel
    com.jcraft.jsch.JSchException: timeout in waiting for rekeying process.

enter image description here

Looking at the debug log, ~/.dbeaver4/.metadata/dbeaver-debug.log, I see that the connection was initially successful but later reset. I don't believe it is a problem in my connection settings configuration (my colleages with Mac's connected successfully using the same settings)

Here's an excerpt from the dbeaver-debug.log:

2017-06-26 15:01:35.354 - Instantiate SSH tunnel
2017-06-26 15:01:35.355 - Connect to tunnel host
2017-06-26 15:01:35.356 - SSH INFO: Connecting to jdms.dssg.io port 22
2017-06-26 15:01:35.480 - SSH INFO: Connection established
2017-06-26 15:01:35.953 - SSH INFO: Authentication succeeded (publickey).
2017-06-26 15:01:36.083 - Connection failed (mssql-hashhashhash-hashhashhash)
2017-06-26 15:01:36.085 - SSH INFO: Disconnecting from jdms.dssg.io port 22
2017-06-26 15:01:36.086 - SSH INFO: Caught an exception, leaving main loop due to Socket closed
2017-06-26 15:01:36.135 - org.jkiss.dbeaver.model.exec.DBCConnectException: I/O Error: Connection reset
org.jkiss.dbeaver.model.exec.DBCConnectException: I/O Error: Connection reset
Caused by: java.sql.SQLException: I/O Error: Connection reset
Caused by: java.net.SocketException: Connection reset

Could this be a Linux specific issue?

How else can I debug my problem?

I am using DBeaver 4.0.8 to connect to a MS SQL Server database using the jTDS driver, in Ubuntu 16.04.

Best Answer

Try the JDBC driver or ODBC driver(Install/Config Info per platform) supplied by Microsoft for Linux clients. I've found that I'm often more successful when using the drivers provided by the vendor than those that are included with the product (e.g. in this case DBeaver). I would think all the other settings remain the same, just swap out the driver url to point the MS supplied driver instead.