Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AOAG listener connect via SSH Tunnel. setTransparentNetworkIPResolution doesn't seem to work. #2394

Closed
fivetran-darrenlien opened this issue Apr 17, 2024 · 5 comments
Labels
Question Used when a question is asked, as opposed to an issue being raised
Projects

Comments

@fivetran-darrenlien
Copy link

Question

I have a JDBC client trying to connect to an AOAG source via a listener URI inside a SSH tunneling. The listener DNS return 2 A records - one being the active and the other inactive. My connection is intermittently because sometime listener resolves to the active IP and sometime the inactive IP. I tried setting the setTransparentNetworkIPResolution property for my SqlServerDataSource, but it still doesn't work. Anyone know how to connect via the listener inside a SSH tunnel?

https://learn.microsoft.com/en-us/sql/connect/jdbc/jdbc-driver-support-for-high-availability-disaster-recovery?view=sql-server-ver16

Relevant Issues and Pull Requests

@barryw-mssql barryw-mssql added the Question Used when a question is asked, as opposed to an issue being raised label Apr 17, 2024
@barryw-mssql
Copy link
Contributor

Hi fivetran-darrenlien,

At this point from your description it is not clear what the issue could be. The tunnel should not be an issue, if it is properly configured. It is possible it could be a driver configuration issue or it could be a networking/SSH Tunnel issue. Have you been able to confirm that you can ping the SQL Server using the SSH tunnel? If that works can you use telnet to test if you can access the specified SQL Server port (i.e. telnet

<port_number>)? If telnet connects, there are no network/SSH issues and the specified port is open and the driver should connect.

If you are still seeing issues, could you please provide driver logs that capture the failure?

Thx,
Barry

@fivetran-darrenlien
Copy link
Author

Hi @barryw-mssql

Thank for replying. We know the ssh tunnel is not the issue because we connect when not use the listener via the ssh tunnel 100% of the time. On the ssh tunnel server, we can also do a dns lookup for the listener and it shows 2 A records as expected. Yes, we can ping the server fine. The connection connected intermittently via the listener. It's random. If you make 5 connections, sometime you get 1 or 2 that is ok. I will try to get some logs. Are you expect some driver logs and how do I enable it?

@barryw-mssql
Copy link
Contributor

Please follow these instructions for the JDBC driver logging - https://learn.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-ver16

It is recommended that you always inspect the driver logs when there is an issue as there will likely be information in the logs that will help you or the JDBC driver team diagnose the issue

@Jeffery-Wasty Jeffery-Wasty added this to Under Investigation in MSSQL JDBC via automation Apr 25, 2024
@Jeffery-Wasty Jeffery-Wasty moved this from Under Investigation to Waiting for Customer in MSSQL JDBC Apr 25, 2024
@Jeffery-Wasty
Copy link
Member

Hi @fivetran-darrenlien,

We'll be moving forward with closing this issue in the next few days if there is no further reply. If you are still experiencing the above issue, please include driver logs as mentioned above.

@Jeffery-Wasty Jeffery-Wasty added Waiting for Response Waiting for a reply from the original poster, or affiliated party and removed Waiting for Response Waiting for a reply from the original poster, or affiliated party labels Apr 26, 2024
MSSQL JDBC automation moved this from Waiting for Customer to Closed Issues May 1, 2024
@David-Engel
Copy link
Contributor

I would try using multiSubnetFailover=true. That should result in a faster successful connection than TNIR when there are multiple IP addresses and not all of them are active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Used when a question is asked, as opposed to an issue being raised
Projects
MSSQL JDBC
  
Closed Issues
Development

No branches or pull requests

4 participants