Raygun4net exception

fdtrx

Posted on
Sep 07 2017

Using IIS7 and raygun4net, I occasionally receive the following error report when uploading files to a controller:

Message: The client is disconnected because the underlying request has been completed. There is no longer an HttpContext available.

System.Web.HttpBufferlessInputStream.Read(Byte[] buffer, Int32 offset, Int32 count):151 System.Web.Http.WebHost.SeekableBufferedRequestStream.Seek(Int64 offset, SeekOrigin origin):158 System.Net.Http.DelegatingStream.Seek(Int64 offset, SeekOrigin origin):0

Mindscape.Raygun4Net.WebApi.RaygunWebApiDelegatingHandler+d0.MoveNext():431 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task):39 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task):40 System.Web.Http.HttpServer+d0.MoveNext():391

Not sure why its happening.


Jason Fauchelle

Raygun

Posted on
Sep 07 2017

Hi fdtrx,

The Raygun related code in that stack trace is where the RaygunWebApiDelegatingHandler is reading a sample of the request stream in preparation of using it in a crash report in the case an exception occurs during the request.

Searching the internet for that exception message suggests that this issue occurs due to network connection interruptions, possibly timeouts or the client cancelling the request perhaps unintentionally.

In the case of this issue, I suspect your file upload is failing. Are you able to confirm this? The common fix for this issue is for the code to attempt retrying the upload a couple of times if it can detect the failure.

I recommend you have a search around too and see if you can find a solution related to your particular case. We'd love to hear about how you end up solving this. Let us know if you find any issues or improvements that could be made regarding the Raygun4Net provider related to this issue.

-Jason Fauchelle


fdtrx

Posted on
Sep 08 2017

I'm aware that the upload is failing, almost certainly due to timeouts, what I am wondering about, is why am I getting raygun reports about a stacktrace in raygun code?


Jason Fauchelle

Raygun

Posted on
Sep 08 2017

Hi fdtrx,

This would be because an exception is occurring in the Raygun code when attempting to read the request stream. We'll look at preventing this in the next release of Raygun4Net.

-Jason Fauchelle


Reply