Closed Junjun-zhao closed 2 years ago
cc @DamianEdwards
This might be caused by https://github.com/dotnet/aspnetcore/issues/42101 and the new H2 WebSockets support.
Confirmed, I see the browser disconnecting and retrying every ~6s, and I see the below logs:
dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[7]
Connection id "0HMIFMSBPIM66" sending FIN because: "Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate."
dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[19]
Connection id "0HMIFMSBPIM66" reset.
dbug: Microsoft.AspNetCore.Http.Connections.Internal.Transports.WebSocketsTransport[14]
Socket connection closed prematurely.
System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
---> System.IO.IOException: The request stream was aborted.
---> Microsoft.AspNetCore.Connections.ConnectionAbortedException: The HTTP/2 connection faulted.
--- End of inner exception stack trace ---
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2MessageBody.ReadAsync(CancellationToken cancellationToken) in D:\github\aspnetcore\src\Servers\Kestrel\Core\src\Internal\Http2\Http2MessageBody.cs:line 98
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.ReadAsyncInternal(Memory`1 destination, CancellationToken cancellationToken) in D:\github\aspnetcore\src\Servers\Kestrel\Core\src\Internal\Http\HttpRequestStream.cs:line 118
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.IO.Stream.ReadAtLeastAsyncCore(Memory`1 buffer, Int32 minimumBytes, Boolean throwOnEndOfStream, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory`1 payloadBuffer, CancellationToken cancellationToken)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory`1 payloadBuffer, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at Microsoft.AspNetCore.Http.Connections.Internal.Transports.WebSocketsServerTransport.StartReceiving(WebSocket socket) in D:\github\aspnetcore\src\SignalR
Workaround:
webBuilder.ConfigureKestrel(o =>
{
o.Limits.MinRequestBodyDataRate = null;
});
Thanks @Tratcher. The issue is not added with Label "Bug". Will this issue be fixed in .NET 7 or will provide the workaround to users? It affects all the blazor server apps using https.
If this ends up being used by default for signalr and blazor server then we'll need to fix this in preview6.
Yes this is a bug that needs to be fixed. https://github.com/dotnet/aspnetcore/issues/42101 will address this.
Verified and Fixed on dotnet-sdk-7.0.100-preview.7.22324.4
Is there an existing issue for this?
Describe the bug
*When binding the https for "Kestrel" via appsettings.json, --urls or set the ASPNETCORE_URLS environment variable, Blazor server app site can be launched with https://:5001, but it will be disconnected about every 5s.**
Application Name : eShopOnBlazor, OqtaneFramework, EasyDataBasicDemoBlazorAppServerNet5, Blazorise,BlazorPolyfill(Blazor Server apps running on .net7 preview 6) OS: Windows 10 RS5 CPU: X64 .NET Build Number: dotnet-sdk-7.0.100-preview.6.22313.7 Also can check details from Devdiv Bug: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1555938
Expected Behavior
App will launch successful.
Steps To Reproduce
The machine has dotnet-sdk-7.0.100-preview.6.22313.7 installed
1) Create blazor server app: dotnet new blazorserver 2) Add this line to appsettings.json for workaround : (https://github.com/dotnet/aspnetcore/issues/42161)
3) Publish the app 4) Run the app 5) Go to https://localhost:5001
Exceptions (if any)
App will launch but it will disconnect every 5 seconds
Exception:
.NET Version
dotnet-sdk-7.0.100-preview.6.22313.7
Anything else?
@dotnet-actwx-bot @dotnet/compat