JetBrains / aspire-plugin

.NET Aspire Plugin for JetBrains Rider
https://plugins.jetbrains.com/plugin/23289-aspire
MIT License
60 stars 0 forks source link

Plugin unable to launch Aspire AppHost because of bad handshake #235

Closed khalidabuhakmeh closed 2 days ago

khalidabuhakmeh commented 2 months ago

When attempting to launch the run configuration of an Aspire application, I get the following error output.

run session could not be started: failed to connect to IDE run session notification endpoint: websocket: bad handshake

/Users/khalidabuhakmeh/RiderProjects/AspireApp1/AspireApp1.AppHost/bin/Debug/net9.0/AspireApp1.AppHost
info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 9.0.0-preview.3.24210.17+c2d83148f169bdf4980393a66eff2a28e94eb6c9
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: /Users/khalidabuhakmeh/RiderProjects/AspireApp1/AspireApp1.AppHost
info: Aspire.Hosting.DistributedApplication[0]
      Now listening on: http://localhost:15174
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application started. Press Ctrl+C to shut down.
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      failed to start Executable        {"Executable": {"name":"apiservice-s6t0mf0"}, "Reconciliation": 6, "error": "run session could not be started: failed to connect to IDE run session notification endpoint: websocket: bad handshake"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      failed to start Executable        {"Executable": {"name":"webfrontend-upeha00"}, "Reconciliation": 7, "error": "run session could not be started: failed to connect to IDE run session notification endpoint: websocket: bad handshake"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      failed to start Executable        {"Executable": {"name":"apiservice-s6t0mf0"}, "Reconciliation": 8, "error": "run session could not be started: failed to connect to IDE run session notification endpoint: websocket: bad handshake"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      failed to start Executable        {"Executable": {"name":"webfrontend-upeha00"}, "Reconciliation": 9, "error": "run session could not be started: failed to connect to IDE run session notification endpoint: websocket: bad handshake"}
^C
Process finished with exit code 0.

Running the same project from Rider's terminal results in a successful launch.

dotnet run --project AspireApp1.AppHost

With the resulting output of:

info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 9.0.0-preview.3.24210.17+c2d83148f169bdf4980393a66eff2a28e94eb6c9
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: /Users/khalidabuhakmeh/RiderProjects/AspireApp1/AspireApp1.AppHost
info: Aspire.Hosting.DistributedApplication[0]
      Now listening on: http://localhost:15174
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application started. Press Ctrl+C to shut down.
rafaelldi commented 2 months ago

Probably something changed on the Aspire side because we don't have any changes.

Running the same project from Rider's terminal results in a successful launch.

Because it can't connect to the IDE, and in the CLI scenario it runs all the projects by itself.

khalidabuhakmeh commented 2 months ago

Workload

Installed Workload Id      Manifest Version                                Installation Source
------------------------------------------------------------------------------------------------
aspire                     9.0.0-preview.3.24210.17/9.0.100-preview.1      SDK 9.0.100-preview.6

.NET SDK

9.0.100-preview.6.24328.19

Rider Information

More information:

- JetBrains Rider 2024.2 RC 1
Build #RD-242.20224.285, built on August 6, 2024
Licensed to JetBrains Rider EAP user: Khalid Abuhakmeh
Expiration date: September 5, 2024
Runtime version: 21.0.3+13-b509.4 x86_64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.5
.NET Core v8.0.4 x64 (Server GC)
This IDE is managed by JetBrains via JetBrains IDE Services.<br>JetBrains IDE Services version: 2024.3.5.6-ij242, <a href="https://tbe.labs.jb.gg">https://tbe.labs.jb.gg</a>
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
Registry:
  ide.experimental.ui=true
  terminal.new.ui=true
  llm.chat.in.popup=true
  rider.razor.use.frontend.formatter=true
Non-Bundled Plugins:
  com.intellij.ja (242.21794)
  com.intellij.javafx (1.0.4)
  com.intellij.zh (242.21794)
  com.intellij.resharper.HeapAllocationsViewer (2024.2.0-eap02)
  com.intellij.ko (242.21794)
  avalonia-rider (1.4.0)
  com.jetbrains.rider.android (242.20224.285)
  ice.explosive.gdscript (2.5.6)
  com.intellij.mermaid (0.0.22+IJ.232)
  com.intellij.ml.llm (242.20224.387)
  org.jetbrains.plugins.gitlab (242.20224.385)
  org.jetbrains.plugins.github (242.20224.385)
  org.jetbrains.toolbox-enterprise-client (2024.3.5.6-ij242)
  com.jetbrains.outsight (1.1.24)
rafaelldi commented 3 days ago

@khalidabuhakmeh I've tested with the latest Aspire RC, and it seems to work fine. Could you please recheck it?

khalidabuhakmeh commented 2 days ago

It works again in RC2. We can close this issue.