question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.AspNetCore.Connections.ConnectionResetException: The client has disconnected

See original GitHub issue

I am using Asp.net core 3.1. Hosted in IIS, the following exceptions occasionally occur:

[日志级别]:ERROR [日志时间]:2020-07-20 19:55:23.8917 [日志Host]:172.16.105.122 [日志信息]:The client has disconnected Microsoft.AspNetCore.Connections.ConnectionResetException: The client has disconnected —> System.Runtime.InteropServices.COMException (0x80070040): 指定的网络名不再可用。 (0x80070040) — End of inner exception stack trace — at Microsoft.AspNetCore.Server.IIS.Core.IO.AsyncIOOperation.GetResult(Int16 token) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.ReadBody() at System.IO.Pipelines.PipeCompletion.ThrowLatchedException() at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result) at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token) at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.ReadAsync(Memory1 memory, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.IIS.Core.HttpRequestStream.ReadAsyncInternal(Memory1 buffer, CancellationToken cancellationToken) at System.Text.Json.JsonSerializer.ReadAsync[TValue](Stream utf8Json, Type returnType, JsonSerializerOptions options, CancellationToken cancellationToken) at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonInputFormatter.ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding) at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonInputFormatter.ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding) at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder.BindModelAsync(ModelBindingContext bindingContext) at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.BindModelAsync(ActionContext actionContext, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor parameter, ModelMetadata metadata, Object value) at Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext() — End of stack trace from previous location where exception was thrown — at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Tratchercommented, Feb 19, 2021

@lanfear MVC/WebApi has made incremental improvements to capture request body exceptions during the model binding step and return 400s, but only for some formatters. There should be logs to that effect.

@pranavkm @captainsafia can you summarize the MVC error handling improvements in 5.0?

0reactions
chenjian8541commented, Jul 6, 2021

一直有这个问题,请问该如何解决

Read more comments on GitHub >

github_iconTop Results From Across the Web

The client has disconnected ---> System.Runtime. ...
I am using SoapUI for load and performance testing. Error: Microsoft.AspNetCore.Connections.ConnectionResetException : The client has ...
Read more >
Microsoft.AspNetCore.Connections. ...
I am still getting the exception in the middleware. Microsoft.AspNetCore.Connections.ConnectionResetException: The client has disconnected
Read more >
The client has disconnected; The specified network name ...
Microsoft.AspNetCore.Connections.ConnectionResetException: The client has disconnected ---> System.Runtime.InteropServices.
Read more >
The specified network name is no longer available
... The client has disconnected Details: Microsoft.AspNetCore.Connections.ConnectionResetException: The client has disconnected ---> System.Runtime.
Read more >
Server-Sent Events and ASP.NET Core - Disconnecting a ...
The reason for that is automatic reconnect. If the server simply closes the connection, the client will wait a defined period of time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found