9

I have a .Net application up and running.

We have had a fluctuating connection yesterday. While testing in such scenarios we had received multiple server time out exception emails like below.

Server Time Out

Type : System.Web.HttpException, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 
Message : Request timed out.
Source :
Help link :
WebEventCode : 3001
ErrorCode : -2147467259
Data : System.Collections.ListDictionaryInternal
TargetSite :
HResult : -2147467259
Stack Trace : The stack trace is unavailable.
Additional Info:

IMPORTANT: Above exception occurred while doing a ajax post by a button placed with in update panel.

My question here is why would a slow internet on client side raise such server time out exception?

Isn't server timeout exception is related to such cases where server cannot execute the request in underlying time mention in HttpRuntime setting? May be due to some lengthy operation or some long database execution which takes longer than the time mentioned in setting under HttpRuntime.

If server is not able to connect to the client due to clients fluctuating internet, then Client Disconnected exception would be raised which we did yesterday. But I am not able to conclude the reason for this server timeout exception.

I already know that increasing the execution timeout will fix the issue, but I have to provide technical explanation for the reason as to why such exception of Server Timeout raised.

My best guess here is that the ajax request would be doing some continuous communication with server for executing of single request server and would raise timeout exception if it does not receives some required further communication messages due to client's bad internet. I have search over internet for the same to support my guess but in vain.

Also to provide environmental details, there is a load balancer serving the request.

Any help would be highly appreciated.

Dinesh Prajapati
  • 499
  • 3
  • 17
  • Have you tried collecting a stack trace? https://learn.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis – Elliot Rodriguez May 26 '17 at 11:58
  • I don't have access to server, I just have this exception email. In exception email the stack trace is unavailable. – Dinesh Prajapati May 26 '17 at 12:12
  • The web service log may assist you, when you compare this particular connection to normal. The connection may be flaking out mid request. Remember that you cannot control what happens with the connection once it hits the internet, and that a user's crappy connection is not something you can fix. – Mad Myche May 26 '17 at 12:23
  • What you apparently do need to fix is that the end user sees the exception, which would be done via proper error handling. This is a security issue and provides known attack vectors. – Mad Myche May 26 '17 at 12:25
  • Exceptional handling is in place, user sees custom error page and its exception details is emailed to us, what I have pasted in the question is from that email itself. You are right we cannot fix user's crappy connection but I need to understand & report a logical explanation as to why this exception occurred. Thank you for extending your help. – Dinesh Prajapati May 26 '17 at 12:30
  • I understand now. Are these errors getting into server logs or not; they may have more info then what the email contains. – Mad Myche May 26 '17 at 12:35
  • @Mad Myche Sorry, but I don't have access to server or its log. I am getting your point about the additional information there. But I have to work it out with out server logs. – Dinesh Prajapati May 26 '17 at 12:37
  • Sending response to client also depends on client connection perfomance. If sending response takes too long - it also results in timeout exception (to prevent exhausting server resources by a lot of such slow connections). – Evk Jun 06 '17 at 19:43
  • @Evk do you find any official supportive document that I can produce. I understand your point, even I also strongly believe that the timeout is occurring when server is sending back response. But what confuses me is the exception message that says "Request time out" which makes me think the issue is some where in the request part when client is trying to reach server. – Dinesh Prajapati Jun 07 '17 at 08:22

2 Answers2

4

It is because (as you write) the connection of client to server is slow, so if the server (or client) sending data to this server, connection can´t handle it, so you get timeout error, because the data can´t been transfered in defined time.

You also write, that this is caused by sending Ajax request, so maybe try to increase execusion timeout in web configuration file (web.config):

<httpRuntime executionTimeout = "number(in seconds)"/>

enter image description here

More about executionTimeout here and here about Ajax requests.

Samuel Tulach
  • 1,319
  • 13
  • 38
  • Which part you believe is the problem? The request part(1 in your image) or the response part(2a in your image)? – Dinesh Prajapati Jun 07 '17 at 08:25
  • @DineshPrajapati I thing it is problem with result (2a), because you are returning some info and server can’t access client in limited time. – Samuel Tulach Jun 07 '17 at 08:47
  • Do you find any supportive official document which I can refer where it would say that server raises this exception when it times out while reaching out to client. Because in such case won't "Client disconnected" exception would fire? I am unsure of it. – Dinesh Prajapati Jun 07 '17 at 08:59
  • @DineshPrajapati You get client disconnected error if client disconnect, but in your case it is because the data can’t been transferred in limited time. I am sorry but in this time I am writing from mobile, so finding some documents is little but complicated, but maybe when I will be home. – Samuel Tulach Jun 07 '17 at 09:48
  • Please provide me any document if you are able to do so. – Dinesh Prajapati Jun 08 '17 at 14:56
  • @DineshPrajapati In answer I put link to [ASP documentation](https://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.executiontimeout(v=vs.110).aspx). There is written: Gets or sets the allowed execution time for **the request**. That´s mean, that this is also sets time for sending data back to client. Also there is [wikipedia page](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Technical_overview) for http requests (such as Ajax), where is written, than request is not only request, but also response. – Samuel Tulach Jun 08 '17 at 15:12
0

Firstly, I think the cause of this error is because of execution time required by your application request connecting with the remote server is exceeding the currently set ASP.NET request execution timeout value. As per the MSDN Exception Document, default value is set to 110 seconds, in that it is remarked like:

The ExecutionTimeout property indicates the maximum number of seconds a request is allowed to execute before being automatically shut down by ASP.NET.

So based on error detail with event code 3001 occurs because no response was received during the time-out period for a request. You can use IIS troubleshooting failed request mechanism to figure it out exact issue like any poor performance/deadlocks when making calls from your ASP.NET application.

Secondly, it is not related to user's internet connectivity issue otherwise you get exception with status like connection-closed or keep alive failure. See this article for detail. The browser is going to wait for a 60 minutes(which is very long period of time that server isn't going to answer any request)for server to response.

And at any case when the browser abandons any request, it is going to close the socket and you'll get an error page from the browser. You don't get anything related to sever-end.

111
  • 1,779
  • 1
  • 12
  • 15
  • Mine is ajax request, in case of ajax request I don't think browser will pull the error page. Also I didn't find anything in the article explaining the time for ajax request. – Dinesh Prajapati Jun 13 '17 at 13:24