IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Connection by peer exception

Open FelipeSpinelli opened this issue 6 years ago • 3 comments

Question

Hi, everyone! I have a .net core 2.2 application, using version 2.4.0 of IdentityServer4. Sometimes a critical error occurs, restarting the container. The message is Connection reset by peer. Has anyone experienced this problem?

Exception StackTrace:

1

crit: IdentityServer4.Hosting.IdentityServerMiddleware[0]
30/09/2020 17:18:56      Unhandled exception: Connection reset by peer
30/09/2020 17:18:56Microsoft.AspNetCore.Connections.ConnectionResetException: Connection reset by peer ---> System.Net.Sockets.SocketException: Connection reset by peer
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.<GetResult>g__ThrowSocketException|7_0(SocketError e)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.GetResult()
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.ProcessReceives()
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.DoReceive()
30/09/2020 17:18:56   --- End of inner exception stack trace ---
30/09/2020 17:18:56   at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1MessageBody.PumpAsync()
30/09/2020 17:18:56   at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.StartTimingReadAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken)
30/09/2020 17:18:56   at System.IO.StreamReader.ReadBufferAsync()
30/09/2020 17:18:56   at System.IO.StreamReader.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.WebUtilities.FormReader.BufferAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.WebUtilities.FormReader.ReadNextPairAsyncImpl(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.WebUtilities.FormReader.ReadFormAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Http.Features.FormFeature.InnerReadFormAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at IdentityServer4.Validation.PostBodySecretParser.ParseAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Validation.SecretParser.ParseAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Validation.ClientSecretValidator.ValidateAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Endpoints.TokenEndpoint.ProcessTokenRequestAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Endpoints.TokenEndpoint.ProcessAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events)
30/09/2020 17:18:56

2

fail: Microsoft.AspNetCore.Server.Kestrel[13]
30/09/2020 17:18:56      Connection id "0HM35FO713SU1", Request id "0HM35FO713SU1:00000001": An unhandled exception was thrown by the application.
30/09/2020 17:18:56Microsoft.AspNetCore.Connections.ConnectionResetException: Connection reset by peer ---> System.Net.Sockets.SocketException: Connection reset by peer
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.<GetResult>g__ThrowSocketException|7_0(SocketError e)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.GetResult()
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.ProcessReceives()
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.DoReceive()
30/09/2020 17:18:56   --- End of inner exception stack trace ---
30/09/2020 17:18:56   at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1MessageBody.PumpAsync()
30/09/2020 17:18:56   at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
30/09/2020 17:18:56   at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.StartTimingReadAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken)
30/09/2020 17:18:56   at System.IO.StreamReader.ReadBufferAsync()
30/09/2020 17:18:56   at System.IO.StreamReader.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.WebUtilities.FormReader.BufferAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.WebUtilities.FormReader.ReadNextPairAsyncImpl(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.WebUtilities.FormReader.ReadFormAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Http.Features.FormFeature.InnerReadFormAsync(CancellationToken cancellationToken)
30/09/2020 17:18:56   at IdentityServer4.Validation.PostBodySecretParser.ParseAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Validation.SecretParser.ParseAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Validation.ClientSecretValidator.ValidateAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Endpoints.TokenEndpoint.ProcessTokenRequestAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Endpoints.TokenEndpoint.ProcessAsync(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events)
30/09/2020 17:18:56   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events)
30/09/2020 17:18:56   at IdentityServer4.Hosting.MutualTlsTokenEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
30/09/2020 17:18:56   at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context)
30/09/2020 17:18:56   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext)
30/09/2020 17:18:56   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
30/09/2020 17:18:56   at NewRelic.Providers.Wrapper.AspNetCore.WrapPipelineMiddleware.Invoke(HttpContext context)
30/09/2020 17:18:56   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

FelipeSpinelli avatar Sep 30 '20 21:09 FelipeSpinelli

No. This seems to be at the transport layer. I would open an issue with Microsoft.

leastprivilege avatar Oct 01 '20 07:10 leastprivilege

Thaks for answer. I'll try to solve by updating versions of .net core and IdentityServer4. If the problem persist i'll open an issue to Microsoft.

FelipeSpinelli avatar Oct 01 '20 13:10 FelipeSpinelli

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 26 '20 16:11 github-actions[bot]