Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser][MT] The WebSocket is not connected. #88084

Closed
pavelsavara opened this issue Jun 27, 2023 · 6 comments
Closed

[browser][MT] The WebSocket is not connected. #88084

pavelsavara opened this issue Jun 27, 2023 · 6 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@pavelsavara
Copy link
Member

pavelsavara commented Jun 27, 2023

Error Blob

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=395678&view=results

{
  "ErrorMessage": "MONO_WASM: WebSocket error",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=395678
Error message validated: MONO_WASM: WebSocket error
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 9/5/2023 5:51:29 PM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' area-System.Runtime.InteropServices.JavaScript Known Build Error Use this to report build issues in the .NET Helix tab labels Jun 27, 2023
@pavelsavara pavelsavara added this to the 8.0.0 milestone Jun 27, 2023
@pavelsavara pavelsavara self-assigned this Jun 27, 2023
@ghost
Copy link

ghost commented Jun 27, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Error Blob

{
  "ErrorMessage": "The WebSocket is not connected",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}

Reproduction Steps

No response

Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, blocking-clean-ci, area-System.Runtime.InteropServices.JavaScript, Known Build Error

Milestone: 8.0.0

pavelsavara added a commit to pavelsavara/runtime that referenced this issue Jun 27, 2023
pavelsavara added a commit that referenced this issue Jun 27, 2023
@pavelsavara pavelsavara removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jul 4, 2023
@lewing lewing modified the milestones: 8.0.0, 9.0.0 Jul 25, 2023
@pavelsavara
Copy link
Member Author

Reproduced it locally on my system on MT build

[2023-07-27T10:02:04.641Z] [FAIL] System.Net.Http.Functional.Tests.HttpMetricsTest_Http11_Async.RequestDuration_CustomTags_Recorded
System.IO.IOException : Unable to write data to the transport connection
---- System.InvalidOperationException : The WebSocket is not connected.
   at System.Net.WebSockets.WebSocketStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\WebSockets\WebSocketStream.cs:line 233
   at System.Net.Test.Common.LoopbackServer.Connection.SendResponseAsync(Byte[] response) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 756
   at System.Net.Test.Common.LoopbackServer.Connection.SendResponseBodyAsync(Byte[] content, Boolean isFinal) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 1000
   at System.Net.Test.Common.GenericLoopbackConnection.SendResponseBodyAsync(String content, Boolean isFinal) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\GenericLoopbackServer.cs:line 162
   at System.Net.Test.Common.LoopbackServer.Connection.SendResponseAsync(HttpStatusCode statusCode, IList`1 headers, String content, Boolean isFinal) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 960
   at System.Net.Test.Common.LoopbackServer.Connection.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 1070
   at System.Net.Test.Common.LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 1103
   at System.Net.Test.Common.LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 1103
   at System.Net.Http.Functional.Tests.HttpMetricsTest.<>c.<<RequestDuration_CustomTags_Recorded>b__11_1>d.MoveNext() in C:\Dev\runtime\src\libraries\System.Net.Http\tests\FunctionalTests\MetricsTest.cs:line 301
--- End of stack trace from previous location ---
   at System.Threading.Tasks.TaskTimeoutExtensions.GetRealException(Task task) in C:\Dev\runtime\src\libraries\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs:line 120
--- End of stack trace from previous location ---
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in C:\Dev\runtime\src\libraries\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs:line 90
   at System.Net.Test.Common.LoopbackServerFactory.<>c__DisplayClass5_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\GenericLoopbackServer.cs:line 39
--- End of stack trace from previous location ---
   at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 107
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.WebSockets.BrowserWebSocket.SendAsync(ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\System.Net.WebSockets.Client\src\System\Net\WebSockets\BrowserWebSockets\BrowserWebSocket.cs:line 153
   at System.Net.WebSockets.WebSocket.SendAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\System.Net.WebSockets\src\System\Net\WebSockets\WebSocket.cs:line 57
   at System.Net.WebSockets.ClientWebSocket.SendAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\System.Net.WebSockets.Client\src\System\Net\WebSockets\ClientWebSocket.cs:line 149
   at System.Net.WebSockets.WebSocketStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\WebSockets\WebSocketStream.cs:line 229

...


@pavelsavara
Copy link
Member Author

Another

[2023-07-27T10:11:33.507Z] [FAIL] System.Net.Http.Functional.Tests.HttpClientHandlerTest_Url.TrimmingTrailingWhiteSpace(requestPath: "/test%20", expectedServerPath: "/test%20")
System.IO.IOException : Unable to write data to the transport connection
---- System.InvalidOperationException : The WebSocket is not connected.
   at System.Net.WebSockets.WebSocketStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\WebSockets\WebSocketStream.cs:line 233
   at System.Net.Test.Common.LoopbackServer.Connection.SendResponseAsync(Byte[] response) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 756
   at System.Net.Test.Common.LoopbackServer.Connection.SendResponseBodyAsync(Byte[] content, Boolean isFinal) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 1000
   at System.Net.Test.Common.GenericLoopbackConnection.SendResponseBodyAsync(String content, Boolean isFinal) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\GenericLoopbackServer.cs:line 162
   at System.Net.Test.Common.LoopbackServer.Connection.SendResponseAsync(HttpStatusCode statusCode, IList`1 headers, String content, Boolean isFinal) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 960
   at System.Net.Test.Common.LoopbackServer.Connection.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 1070
   at System.Net.Test.Common.LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 1103
   at System.Net.Test.Common.LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 1103
   at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Url.<>c__DisplayClass1_0.<<TrimmingTrailingWhiteSpace>b__0>d.MoveNext() in C:\Dev\runtime\src\libraries\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.Url.cs:line 37
--- End of stack trace from previous location ---
   at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs:line 107
   at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Url.TrimmingTrailingWhiteSpace(String requestPath, String expectedServerPath) in C:\Dev\runtime\src\libraries\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.Url.cs:line 29
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.WebSockets.BrowserWebSocket.SendAsync(ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\System.Net.WebSockets.Client\src\System\Net\WebSockets\BrowserWebSockets\BrowserWebSocket.cs:line 153
   at System.Net.WebSockets.WebSocket.SendAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\System.Net.WebSockets\src\System\Net\WebSockets\WebSocket.cs:line 57
   at System.Net.WebSockets.ClientWebSocket.SendAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\System.Net.WebSockets.Client\src\System\Net\WebSockets\ClientWebSocket.cs:line 149
   at System.Net.WebSockets.WebSocketStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Dev\runtime\src\libraries\Common\tests\System\Net\WebSockets\WebSocketStream.cs:line 229

@pavelsavara
Copy link
Member Author

This is slightly different, this is non-MT, log

[06:46:49] info: Process node exited with 1
                 
[06:46:49] info: Waiting to flush log messages with a timeout of 120 secs ..
[06:46:48] fail: RemoteLoopHandler.ProcessWebSocketRequest failed
                 System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
                  ---> Microsoft.AspNetCore.Connections.ConnectionResetException: Connection reset by peer
                  ---> System.Net.Sockets.SocketException (104): Connection reset by peer
                    --- 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.Http.Http1UpgradeMessageBody.ReadAsyncInternalAwaited(ValueTask`1 readTask, CancellationToken cancellationToken)
                    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)
                    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 System.Threading.Tasks.ValueTask`1.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
                 --- End of stack trace from previous location ---
                    at RemoteLoopServer.RemoteLoopHandler.ProcessWebSocketRequest(HttpContext context, WebSocket control, ILogger logger) in /_/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Handlers/RemoteLoopHandler.cs:line 53
[06:46:49] fail: Application has finished with exit code 1 but 0 was expected
XHarness exit code: 71 (GENERAL_FAILURE)

@pavelsavara pavelsavara modified the milestones: 9.0.0, 8.0.0 Jul 28, 2023
@pavelsavara pavelsavara modified the milestones: 8.0.0, 9.0.0 Aug 7, 2023
@pavelsavara
Copy link
Member Author

Log

info: MONO_WASM: WebSocket error Error: Server sent a subprotocol but none was requested
info:     at WebSocket.p (file:///root/helix/work/workitem/e/_framework/dotnet.runtime.js:3:82620)
info:     at WebSocket.onError (/root/helix/work/workitem/e/node_modules/ws/lib/event-target.js:220:18)
info:     at Object.onceWrapper (node:events:628:26)
info:     at WebSocket.emit (node:events:513:28)
info:     at Object.onceWrapper (node:events:628:26)
info:     at TLSSocket.emit (node:events:513:28)
info:     at emitErrorNT (node:internal/streams/destroy:157:8)
info:     at emitErrorCloseNT (node:internal/streams/destroy:122:3)
info:     at processTicksAndRejections (node:internal/process/task_queues:83:21)
info: MONO_WASM: WebSocket error Error: socket hang up
info:     at WebSocket.p (file:///root/helix/work/workitem/e/_framework/dotnet.runtime.js:3:82620)
info:     at WebSocket.onError (/root/helix/work/workitem/e/node_modules/ws/lib/event-target.js:220:18)
info:     at Object.onceWrapper (node:events:628:26)
info:     at WebSocket.emit (node:events:513:28)
info:     at emitErrorAndClose (/root/helix/work/workitem/e/node_modules/ws/lib/websocket.js:922:13)
info:     at ClientRequest.<anonymous> (/root/helix/work/workitem/e/node_modules/ws/lib/websocket.js:781:5)
info:     at ClientRequest.emit (node:events:513:28)
info:     at Socket.socketOnEnd (node:_http_client:518:9)
info:     at Socket.emit (node:events:525:35)
info:     at endReadableNT (node:internal/streams/readable:1358:12)
info:     at processTicksAndRejections (node:internal/process/task_queues:83:
info: MONO_WASM: WebSocket error Error: getaddrinfo ENOTFOUND e23c0f1eb78a4093adfdf2548103ec0f
info:     at WebSocket.p (file:///root/helix/work/workitem/e/_framework/dotnet.runtime.js:3:82620)
info:     at WebSocket.onError (/root/helix/work/workitem/e/node_modules/ws/lib/event-target.js:220:18)
info:     at Object.onceWrapper (node:events:628:26)
info:     at WebSocket.emit (node:events:513:28)
info:     at emitErrorAndClose (/root/helix/work/workitem/e/node_modules/ws/lib/websocket.js:922:13)
info:     at ClientRequest.<anonymous> (/root/helix/work/workitem/e/node_modules/ws/lib/websocket.js:781:5)
info:     at ClientRequest.emit (node:events:513:28)
info:     at Socket.socketErrorListener (node:_http_client:494:9)
info:     at Socket.emit (node:events:513:28)
info:     at emitErrorNT (node:internal/streams/destroy:157:8)
info:     at emitErrorCloseNT (node:internal/streams/destroy:122:3)
info:     at processTicksAndRejections (node:internal/process/task_queues:83:21)

@build-analysis build-analysis bot removed this from the 9.0.0 milestone Nov 15, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 15, 2023
@pavelsavara pavelsavara added this to the 9.0.0 milestone Nov 20, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 20, 2023
@pavelsavara
Copy link
Member Author

no hits

@github-actions github-actions bot locked and limited conversation to collaborators Feb 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

No branches or pull requests

2 participants