Error: 'System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was u

Rob Whiteford 0 Reputation points
2024-02-05T14:36:26.9633333+00:00

Hi, I'm facing the following scenario. I have multiple laptops running the same windows software that connects to an Azure SQL database. About half of these laptops are client laptops and use a VPN called Zscaler to connect to the internet etc. After a routine update to our application all the laptops that use the Zscaler VPN return the following error

Inner exception: Unable to open database. Connection string: 'Server=REMOVED.public.1aaac0ba9425.database.windows.net,3342;User ID=REMOVED;Password=REMOVED;initial catalog=REMOVED;Connection Timeout=120;'; Error: 'System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=1; handshake=119998; ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

The laptops without the VPN are still working fine. Also the same laptops that have the issue will work if the VPN is off, but then the user loses access to a lot of client applications. I've tried changing the connection string, TrustServerCertificate=True/False, Encrypt=True/False but no luck Has anyone had this issue before? Thanks

Community Center | Not monitored
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2024-02-05T16:06:53.17+00:00

    Could you try the suggestions provided on this Zscaler forum thread.? Some users have reported successful connections after implementing the suggestions.


  2. SSingh-MSFT 16,371 Reputation points Moderator
    2024-02-08T06:09:28.71+00:00

    Hi
    Rob Whiteford
    •,

    Welcome to Microsoft Q&A forum.

    As I understand, you are getting handshake error in SQL Data Sync.

    Please check below pointers for troubleshooting:

    If there is a firewall between the client and the SQL Server instance (including any firewalls on the SQL Server itself), make sure that the necessary ports are open for SQL Server communication. The default port for SQL Server is 1433, but it can be configured to use a different port.

    Verify that the SQL Server instance is configured to accept incoming connections and that the necessary protocols.

    Double-check the VPN configuration to ensure that it does not block or interfere with SQL Server connections. Some VPN configurations may restrict certain types of traffic or protocols.

    Hope this helps. If not, we recommend you to raise support case for deeper investigation and if you don't have a support plan, do let us know here so that we can check on other options to unblock you.

    Thanks

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.