Azure SQL Server: Error occurred during the pre-login handshake - azure-sql-database

Occasionally, when I go to connect to my Azure SQL Server through either Power BI or SSMS, I get the following error:
A connection was successfully established with the server, but then an
error occurred during the pre-login handshake. (provider: TCP
Provider, error: 0 - The semaphore timeout period has expired.)
(Microsoft SQL Server, Error: 121)
There are numerous questions about this topic, but very few address this for Azure SQL Server. My IP address is added to the firewall (and works sometimes!) I have tried increasing the connection time out. I have tried to look at the "netsh WinSock Show Catalog" information as directed by the answer to this question, but nothing looked incorrectly formatted.
Has anyone seen any other reason for this error? It popped up a few days ago, went away for a few days, and is back now, but I haven't changed anything in the meantime.

The problem ended up being that my computer had disconnected from my company's VPN.

Error 121 has always been considered a network related error as you can read in this Microsoft Support article. The Internet service you receive, network adapters are things you should consider examine.
Network connectivity problems have various causes, but they typically
occur because of incorrect network adapters, incorrect switch
settings, faulty hardware, or driver issues. Some connectivity
symptoms are intermittent and do not clearly point to any one of these
causes.
Typical error messages include the following:
Error 121: "The semaphore timeout period has expired"
(ERROR_SEM_TIMEOUT).
Please consider to click the "Options" button of SQL Server Management Studio, on the "Connection Properties" tab, try setting a greater value for the "Connection time-out" setting.

Related

Error occurred during the pre-login handshake, due to AntiVirus?

I need your expertise on one of my issues. I often get an intermittent issue from our Power BI on-premises Gateway to SQL connectivity
Error from gateway log
Error: A connection was successfully established with the server, but
then an error occurred during the pre-login handshake. (provider: SSL
Provider, error: 0 - The wait operation timed out.)
The difficult part here is it's very difficult to reproduce ☹️ Whenever I tried the connectivity from the gateway to SQL server, it succeeds but at some very rare case, it fails.
Steps we did to find the root cause
Checked in both the gateway server and SQL server TLS 1.2 only is
enabled, other versions of TLS are disabled
created a .udl file and tried the connectivity but got the error like
[DBNETLIB] ConnectionOpen( SECCreateCredentials().] SSL Security
error.
Finally, we contacted our internal support team, they told to run the network tracer. So we did.
After some long times, we had the luck to capture the error in the network tracer. (Below Image)
Support team told like:
We see that client (gateway server) is sending Client hello after 14 seconds for the TLS SSL handshake, this delay is causing the connection to fail as connection needs to get established in 15 seconds.
We see the same pattern, where the client is causing delay on multiple instances of the communication.
And such delay is generally caused by the Antivirus
My question:
Is this really the Antivirus issue? If so then why it's not happening
all the times?
P.S I know this question is already asked in SO and possible for duplicate, but my real question is this antivirus would be a possible cause for this?
The issue is finally resolved after so many attempts. The below is the solution worked for us
• Azure AD join, where the connections head to the “login.microsoft.com” and delay the connections. There are few settings from registry and GPO that needs to be performed to disable this Auto Azure WorkPlace join.
https://learn.microsoft.com/en-us/azure/active-directory/device-management-troubleshoot-hybrid-join-windows-current
It talks about restricting the server from joining AzureAD through a GPO, which resolves to:
HKLM\SOFTWARE\Policies\Microsoft\Windows\WorkplaceJoin\ key:
autoWorkplaceJoin = 0
• Connections headed to http://ctldl.windowsupdate.com , refer the below article that talks about this issue.
https://blogs.technet.microsoft.com/askds/2018/04/10/tls-handshake-errors-and-connection-timeouts-maybe-its-the-ctl-engine/
To disable it: • Create a backup of this registry key (export and save
a copy)
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SystemCertificates\AuthRoot • Then create the following DWORD registry values under the key
“EnableDisallowedCertAutoUpdate”=dword:00000000
“DisableRootAutoUpdate”=dword:00000001
I hope this helps someone in the future !

Data Source Exception: Internet communication error: SSL connect error in TABLEAU

We started to get failed messages when refreshing extracts based on Bigquery
When looking at the error in the TABLEAU Server we see the next error:
Did you encounter a similar problem?
What did you do to sort this out?
Thanks!
Daniel
Resolution from the Tableau Knowledge Base:
As a troubleshooting step, check whether you can access "https://www.googleapis.com/auth/bigquery" on the affected computer using an internet browser.
Work with your internal IT to ensure that your firewall or antivirus allows communication to "https://www.googleapis.com/auth/bigquery".
The problem was the Big Query API IP being blocked, IT took care

Connection issue with sql-Raspberry PI

I am currently using Raspberry Pi as my Server for IOT. I am trying to connect my client side to server, so that it can communicate with the server. But I am getting following error:
Warning: mysqli_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in F:\XAMPP\htdocs\plugload-workaround\plugLoad\plugload-pi\plugload\production\plugLoad4.php on line 178
Could you please help me in resolving that.
If the issue is due to security reasons, please help me in correcting the security details.

The maximum number of connections for this site has been exceeded

When trying to publish my site using a web deploy I am getting following error:
Error 1 Web deployment task failed. (The maximum number of connections for this site has been exceeded.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEEDED_MAX_SITE_CONNECTIONS.)
My website is hosted over a shared host. I already raised this issue to the hosting provider and asked them to restart "Web Management Services" in reply of which they said that they have "restarted publishing service on server". But this error is still not resolved.
What else should I do? Is there something I should check on my side or is it totally a server/hosting provider’s issue?
Error was caused by a 10054 socket error (basically host dropped connection). you publishing a lot of files and it appears that host had a connection time out.. watching publish and if you see the first socket error cancel the publish so that it doesn't hit the max site connections error. Then start publishing again and it picks right up where it left off.
You either have a ton of traffic on this site or the hoster is oversubscribing the box. An IIS restart may fix it temporarily.

Uploading files to remote server using WCF

I am new to WCF, I am trying to upload files to remote server using a windows service and WCF. When i run my code i get the below error.
An unhandled exception of type 'System.ServiceModel.EndpointNotFoundException' occurred in mscorlib.dll
Additional information: Could not connect to net.tcp://74.208.195.53:5000/. The connection attempt lasted for a time span of 00:00:21.0122019. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.208.195.53:5000.
I tried using the sample project provided in this link http://www.codeproject.com/KB/WCF/WCFDownloadUploadService.aspx
I read in other blogs that, the port has to be allowed throught the firewall on the server.i did that even tried turning off the firewall on the server but it dint help.
Can someone please guide me how i could get this issue resolved.Any help would be highly appreciated. I am using win7 and the remote server is windows server 2008.
Thanks
In some circumstances you need to enable tcp on the server. this post might help