11
votes

I've been hunting for this error that occurs intermittently on an AJAX call to an Azure ASP.NET Website, and today I've finally caught it in our logs. I was suspecting a lock was blocking the operation, but it looks like it failed trying to connect to the Azure SQL database.

Here is the exception message:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. 
This failure occurred while attempting to connect to the routing destination.
The duration spent while attempting to connect to the original server was -
[Pre-Login] initialization=28; handshake=43; [Login] initialization=0; authentication=0; [Post-Login] complete=2;  

This is the connection string I am using:

Server=tcp:<server>,1433;Database=<database>;User ID=<user>;Password=<password>;Trusted_Connection=False;Encrypt=True;Connection Timeout=30

Both the website and the Azure SQL database are in the same region. The database's scale is Standard - S0, and the Azure Website is a Standard - Small instance.

Have any of you ran into this issue?

1
Does this happen intermittently or consistently? Do you have transient fault handling and retry logic built into your code? Read azure.microsoft.com/en-us/documentation/articles/… for recommendations and best practices.Shantanu
@Shantanu Thanks for the suggestion. I think using Transient Fault handling is the right solution, but maybe not for the problem I'm trying to solve. The application is series of questions that a user asks to an individual over the phone, and then records their answer. It causes problems for the user if this takes longer than 5 seconds. I upgraded the database to Standard S2 which appears to have solved the timeout issue.TheJesterCrown
What kind of a load do you see for your app? How many concurrent users?Shantanu
I have the exact same problem since NHibernate and NHibernate.SqlAzure for transient errors retries, I can't seem to pinpoint the source. Our load is currently very low (used DTU < 2%) so it's not a load issue...dstj
I am facing the same issue over Azure when I tried to fill the data adapter call. The Exception message is "EX.MESSAGE Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. This failure occurred while attempting to connect to the routing destination. The duration spent while attempting to connect to the original server was - [Pre-Login] initialization=7; handshake=50; [Login] initialization=0; authentication=0; [Post-Login] complete=6; " While InnerException is {"The wait operation timed out"}. I am constantly getting this error.AKS

1 Answers

1
votes

It sounds like the problem is in the connection from the client to the Internet. If you are making the Ajax call in client-side JavaScript, it doesn't matter (at least as far as performance goes) whether the web app and database are in the same region. A very slow connection will call a timeout.

Since this is intermittent, I recommend catching this error in JavaScript and allowing prompting the client to retry the save.