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

[WebToolsE2E][Aspire] When running OrleansVoting using http, and then clicking the endpoint of any project, an unhandled exception occurs on the page: "Failed to start the transport 'WebSockets'". #277

Open
v-sherryfan opened this issue May 16, 2024 · 2 comments

Comments

@v-sherryfan
Copy link

REGRESSION INFO: Also repro on main branch (Aspire 8.0 P7)

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.10 GA FB [ Includes Aspire 8.0.0 and SDK 8.0.300 ]
  3. Apply NuGet darc-pub-dotnet-aspire Feed
  4. Install Docker Desktop for Windows
  5. Install azd [1.10.0-beta.1-daily.3787247]

REPRO STEPS

  1. Clone aspire-samples repo, checkout the release/8.0 branch
  2. Open samples\OrleansVoting.sln
  3. Build
  4. Running (F5 / Ctrl+F5) with http
  5. Click on endpoint of any peoject

ACTUAL

image

Workaround

  • Just refresh the page and it will work

NOTE

  • Running with https works fine.

EXPECTED

image

@davidfowl
Copy link
Member

Others have reported that websockets dont work as well.

@Nicolas62x
Copy link

I have the same issue, when my app tries to use websockets it crashes the webhost:

info: Aspire.Hosting.DistributedApplication[0]
      Login to the dashboard at https://localhost:17130/login?t=1219810f5d5e68bb166763b068b674a9
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application started. Press Ctrl+C to shut down.

C:\Users\nicol\source\repos\MyApp\MyApp.AppHost\bin\Debug\net8.0\MyApp.AppHost.exe (processus 5872) s'est terminé avec le code -1 (0xffffffff).

Sometimes it works but the socket is disconnected in the middle:

image

System.Net.WebSockets.WebSocketException (0x80004005): The WebSocket is in an invalid state ('Aborted') for this operation. Valid states are: 'Open, CloseReceived, CloseSent'
   at System.Net.WebSockets.WebSocketValidate.ThrowIfInvalidState(WebSocketState currentState, Boolean isDisposed, WebSocketState[] validStates)
   at System.Net.WebSockets.ManagedWebSocket.CloseAsync(WebSocketCloseStatus closeStatus, String statusDescription, CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at MyApp.API.FileUploadController.Get(HttpContext cont, CancellationToken cancellationToken) in C:\Users\nicol\source\repos\MyApp\MyApp.Web\API\FileUpload\FileUploadController.cs:line 156
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.ExecuteTaskResult[T](Task`1 task, HttpContext httpContext)
   at Program.<>c__DisplayClass0_0.<<<Main>$>b__2>d.MoveNext() in C:\Users\nicol\source\repos\MyApp\MyApp.Web\Program.cs:line 167
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

It works just fine when run the app without the apphost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants