0

I have been facing this exception, where in, following exception is logged in server:

Error -4077 ECONNRESET connection reset by peer

Microsoft.AspNet.Server.Kestrel.Networking.UvException:
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.Server.Kestrel.Http.SocketOutput.Microsoft.AspNet.Server.Kestrel.Http.ISocketOutput.Write (Microsoft.AspNet.Server.Kestrel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Server.Kestrel.Http.Frame.WriteChunked (Microsoft.AspNet.Server.Kestrel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Server.Kestrel.Http.Frame.Write (Microsoft.AspNet.Server.Kestrel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Server.Kestrel.Http.FrameResponseStream.Write (Microsoft.AspNet.Server.Kestrel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Mvc.HttpResponseStreamWriter.FlushInternal (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Mvc.HttpResponseStreamWriter.Dispose (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.IO.TextWriter.Dispose (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.Mvc.Formatters.JsonOutputFormatter.WriteResponseBodyAsync (Microsoft.AspNet.Mvc.Formatters.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Mvc.Formatters.OutputFormatter.WriteAsync (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Mvc.Infrastructure.ObjectResultExecutor.ExecuteAsync (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Mvc.ObjectResult.ExecuteResultAsync (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker+<InvokeResultAsync>d__56.MoveNext (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker+<InvokeResultFilterAsync>d__55.MoveNext (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker+<InvokeAllResultFiltersAsync>d__54.MoveNext (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker+<InvokeResourceFilterAsync>d__49.MoveNext (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker+<InvokeAsync>d__44.MoveNext (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler+<RouteAsync>d__6.MoveNext (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.Mvc.Routing.InnerAttributeRoute+<RouteAsync>d__10.MoveNext (Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.Routing.RouteCollection+<RouteAsync>d__9.MoveNext (Microsoft.AspNet.Routing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.Builder.RouterMiddleware+<Invoke>d__4.MoveNext (Microsoft.AspNet.Routing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at ErrorHandlerMiddleware+<Invoke>d__3.MoveNext (WebApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: ErrorHandlerMiddleware.cs: 30)

I have 2 environments setup where:

  1. first one does not have any load balancer, has only 1 server directly accepting requests
  2. second one has one load balancer dividing traffic between server A and B

this error occurs very randomly on second environment but never on the first environment.

Also, it occurs for both server A and B on second environment.

I suppose that because this error is by client and the load balancer could be the client in second environment, this might a be problem with load balancer.

I am are using Microsoft.AspNet.Server.Kestrel: "1.0.0-rc1-final" and aspnet5: 1.0.0-rc1, dnx application hosted in IIS 8 on both environments

if there is an explanation when this happens and what is solution for this, it would be very helpful.

RohitWagh
  • 1,999
  • 3
  • 22
  • 43
  • Any particular reason you're using a pre-release version of Kestrel instead of a supported version? – DavidG Aug 18 '17 at 11:56
  • the upgrade would require other applications (other teams) to upgrade as their application lives within this app. but if that is the reason for this error and upgrade is the only option, i can work towards upgarding libs. – RohitWagh Aug 18 '17 at 12:14
  • I would strongly recommend it. You are using a non-production ready version here. – DavidG Aug 18 '17 at 12:15
  • @DavidG i agree with you, but the first concern is this issue and upgrade is part of our road map. – RohitWagh Aug 18 '17 at 14:18
  • But how do you know it's not the pre-release version of Kestrel that is causing the problems here? Nobody is going to be able to help you until you are running on a version that is supported. I mean, version 2 was recently released and you;re not even running version 1 yet! – DavidG Aug 18 '17 at 14:19
  • i too feel that it could be the pre-release version causing the problem but i need to have a "proof-like-thing" about this to get the upgrade process to speed up :( – RohitWagh Aug 18 '17 at 14:24
  • Surely upgrading the Kestrel version is trivial though? Just drop in the new DLL? – DavidG Aug 18 '17 at 14:29
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/152262/discussion-between-rohitwagh-and-davidg). – RohitWagh Aug 18 '17 at 14:30
  • @DavidG just wanted to share this with you. Finally, we are migrating from dnx to .net core 2.0 :) – RohitWagh Feb 14 '18 at 12:26

0 Answers0