dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

[mono][windows] System.Net.Sockets.SocketException : Unknown error (0xffffffff) #53281

Open pavelsavara opened 3 years ago

pavelsavara commented 3 years ago

Description

Outerloop unit tests are failing for System.Net.WebSockets.Client.Tests unit tests on Mono runtime on Windows.

System.Net.WebSockets.WebSocketException : Unable to connect to the remote server
---- System.Net.Http.HttpRequestException : Unknown error (0xffffffff) (corefx-net-http11.azurewebsites.net:80)
-------- System.Net.Sockets.SocketException : Unknown error (0xffffffff)

   at System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) in /_/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs:line 237
   at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken) in /_/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocket.cs:line 96
   at System.Net.WebSockets.Client.Tests.WebSocketHelper.<>c__DisplayClass4_0.<<GetConnectedWebSocket>b__0>d.MoveNext() in /_/src/libraries/System.Net.WebSockets.Client/tests/WebSocketHelper.cs:line 93
--- End of stack trace from previous location ---
   at System.Net.WebSockets.Client.Tests.WebSocketHelper.<Retry>d__5`1[[System.Net.WebSockets.ClientWebSocket, System.Net.WebSockets.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext() in /_/src/libraries/System.Net.WebSockets.Client/tests/WebSocketHelper.cs:line 109
   at System.Net.WebSockets.Client.Tests.WebSocketHelper.<Retry>d__5`1[[System.Net.WebSockets.ClientWebSocket, System.Net.WebSockets.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext() in /_/src/libraries/System.Net.WebSockets.Client/tests/WebSocketHelper.cs:line 116
   at System.Net.WebSockets.Client.Tests.WebSocketHelper.TestEcho(Uri server, WebSocketMessageType type, Int32 timeOutMilliseconds, ITestOutputHelper output) in /_/src/libraries/System.Net.WebSockets.Client/tests/WebSocketHelper.cs:line 30
   at System.Net.WebSockets.Client.Tests.ConnectTest.EchoBinaryMessage_Success(Uri server) in /_/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs:line 49
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1363
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1268
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1371
   at System.Net.Http.HttpConnectionPool.SendUsingHttp11Async(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 854
   at System.Net.Http.HttpConnectionPool.DetermineVersionAndSendAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 901
   at System.Net.Http.HttpConnectionPool.SendAndProcessAltSvcAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 906
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 925
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:line 30

Example of failed CI run

https://dev.azure.com/dnceng/public/_build/results?buildId=1156947&view=ms.vss-test-web.build-test-results-tab&runId=34938616&resultId=103675&paneView=debug

Configuration

To reproduce locally

ghost commented 3 years ago

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.

Issue Details
### Description Outerloop unit tests are failing for System.Net.WebSockets.Client.Tests unit tests on Mono runtime on Windows. ``` System.Net.WebSockets.WebSocketException : Unable to connect to the remote server ---- System.Net.Http.HttpRequestException : Unknown error (0xffffffff) (corefx-net-http11.azurewebsites.net:80) -------- System.Net.Sockets.SocketException : Unknown error (0xffffffff) at System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) in /_/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs:line 237 at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken) in /_/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocket.cs:line 96 at System.Net.WebSockets.Client.Tests.WebSocketHelper.<>c__DisplayClass4_0.<b__0>d.MoveNext() in /_/src/libraries/System.Net.WebSockets.Client/tests/WebSocketHelper.cs:line 93 --- End of stack trace from previous location --- at System.Net.WebSockets.Client.Tests.WebSocketHelper.d__5`1[[System.Net.WebSockets.ClientWebSocket, System.Net.WebSockets.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext() in /_/src/libraries/System.Net.WebSockets.Client/tests/WebSocketHelper.cs:line 109 at System.Net.WebSockets.Client.Tests.WebSocketHelper.d__5`1[[System.Net.WebSockets.ClientWebSocket, System.Net.WebSockets.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext() in /_/src/libraries/System.Net.WebSockets.Client/tests/WebSocketHelper.cs:line 116 at System.Net.WebSockets.Client.Tests.WebSocketHelper.TestEcho(Uri server, WebSocketMessageType type, Int32 timeOutMilliseconds, ITestOutputHelper output) in /_/src/libraries/System.Net.WebSockets.Client/tests/WebSocketHelper.cs:line 30 at System.Net.WebSockets.Client.Tests.ConnectTest.EchoBinaryMessage_Success(Uri server) in /_/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs:line 49 --- End of stack trace from previous location --- ----- Inner Stack Trace ----- at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1363 at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1268 at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1371 at System.Net.Http.HttpConnectionPool.SendUsingHttp11Async(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 854 at System.Net.Http.HttpConnectionPool.DetermineVersionAndSendAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 901 at System.Net.Http.HttpConnectionPool.SendAndProcessAltSvcAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 906 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 925 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:line 30 ``` ### Example of failed CI run https://dev.azure.com/dnceng/public/_build/results?buildId=1156947&view=ms.vss-test-web.build-test-results-tab&runId=34938616&resultId=103675&paneView=debug ### Configuration To reproduce locally - build mono `build.cmd -bl -subset libs+mono+host+packs -c Release` - run test `dnet build /p:DebuggerSupport=true /p:RuntimeFlavor=mono /p:OuterLoop=true /p:Configuration=Release /t:Test src/libraries/System.Net.WebSockets.Client/tests`
Author: pavelsavara
Assignees: -
Labels: `area-System.Net`, `runtime-mono`, `untriaged`
Milestone: -
karelz commented 3 years ago

@pavelsavara can you please triage this one? (set milestone + remove Untriaged label) Thanks!

karelz commented 3 years ago

@pavelsavara ping?

lewing commented 3 years ago

This is desktop mono on Windows? I don't think that is a priority right now

cc @marek-safar @steveisok

steveisok commented 3 years ago

This is definitely not a high priority from my perspective.

VincentBu commented 3 years ago

Failed again in runtime-libraries-coreclr outerloop 20210801.2

Failed test:

net6.0-windows-Release-x64-CoreCLR_release-(Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h1.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-amd64-20200904200251-272704c

- System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAndCloseAsync_UseProxyServer_ExpectedClosedState(server: ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx)

Error message:

System.Net.WebSockets.WebSocketException : Unable to connect to the remote server
---- System.Net.Http.HttpRequestException : An error occurred while sending the request.
-------- System.IO.IOException : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
------------ System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host.

Stack trace
   at System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) in /_/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs:line 237
   at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken) in /_/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocket.cs:line 104
   at System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAndCloseAsync_UseProxyServer_ExpectedClosedState(Uri server) in /_/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs:line 247
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs:line 817
   at System.Net.Http.HttpConnectionPool.SendUsingHttp11Async(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 981
   at System.Net.Http.HttpConnectionPool.DetermineVersionAndSendAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1015
   at System.Net.Http.HttpConnectionPool.SendAndProcessAltSvcAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1028
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1038
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:line 30
   at System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) in /_/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs:line 143
----- Inner Stack Trace -----
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1267
   at System.Net.Http.HttpConnection.ReadAsync(Memory`1 destination) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs:line 1703
   at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs:line 88
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs:line 1593
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs:line 580
----- Inner Stack Trace -----