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][MacOS][Unstable]Debugging Aspire project using "dotnet watch", Safari browser page displays the error "Can't connect to the server" and manually refresh the browser can display the correct page. #1008

Open
lemon0213 opened this issue Nov 23, 2023 · 15 comments
Labels
area-tooling bug Something isn't working safari
Milestone

Comments

@lemon0213
Copy link

lemon0213 commented Nov 23, 2023

REGRESSION INFO: Not a Regression
INSTALL STEPS

  1. Clean machine: MacOS Sonoma(14.1) on Intel machine
  2. Install latest 8.0 SDK: 8.0.100(latest-released-build)
  3. Apply NuGet Feeds
  4. Install the latest VS Code from: Download Visual Studio Code - Mac, Linux, Windows
  5. Download the latest released C# Dev Kit from: C# Dev Kit - Visual Studio Marketplace
  6. Open Terminal and run commands below to install aspire workload

REPRO STEPS

  1. Open VS Code, click Extension button > Install from VSIX… > select the downloaded "Green" file > Install.
  2. Type 'Command+Shift+P' to open Command Palette > .NET: New Project > click .NET Aspire Application to create a new project
  3. Right-click the project > Build
  4. Right-click the aspire.AppHost project > Open in Integrated Terminal > dotnet watch.

NOTE:

  1. This issue may occur during the second or third time using dotnet watch to debug the project, I have tried many times, but the first debugging project rarely replicates this bug, so I added the unstable tag.
  2. Using Edge browser displays the error "Can't reach this page", but the Edge browser can automatically refresh to the correct page.

ACTUAL
The Safari browser page displays the error "Can't connect to the server", then manually refresh the browser multiple times can display the correct page.

image

EXPECTED:
The Safari browser can automatically refresh to the correct page.

@lemon0213
Copy link
Author

lemon0213 commented Nov 23, 2023

Verify this issue using aspire 8.0 preview 1, the third time using dotnet watch to debug the project can meet the bug, added the REGRESSION INFO as "Not a Regression".

@DamianEdwards
Copy link
Member

This seems like it could be a timing issue in that the browser gets launched by dotnet watch but for some reason the endpoint the dashboard is on can't serve a response yet. Chrome and Edge will automatically retry connecting to the server if the first request fails to connect (e.g. DNS or TCP connection issue) but Safari might not.

@davidfowl could this be related to the decoupling of the dashboard from Aspire.Hosting? How is the "Now listening on.." message printed to the console coordinated to ensure it only happens once the server is running in the new design?

@smitpatel
Copy link
Member

Currently dashboard starts after calls to start projects/containers. I think purpose of current way was to make sure things are starting to run when we show dashboard rather than empty dashboard. Perhaps dotnet watch could launch browser after "Now listening on.." appears.

@DamianEdwards
Copy link
Member

DamianEdwards commented Nov 28, 2023

Perhaps dotnet watch could launch browser after "Now listening on.." appears.

I'm pretty sure that's what it does already as that logic is in dotnet watch itself (it sniffs console output for a known message). What I was wondering is did the changes RE the dashboard hosting/factoring change something about how that message is emitted.

@balachir
Copy link

@lemon0213 @v-cazhang this seems to be a 'dotnet watch' scenario on macOS. Does this issue still reproduce using Aspire 8.0 P2? How about when using latest Aspire 8.0 P3 builds?

@v-gaolisa
Copy link

@balachir Verified today, this issue does not repro on Aspire 8.0 P2, but it still repro using latest Aspire 8.0 P3 builds (8.0.0-preview.3.24072.7).

@danmoseley
Copy link
Member

@kvenkatrajan should this be in P5, P6, or postponed?

@kvenkatrajan
Copy link
Member

@adamint can you try reproing this in safari please?

@adamint
Copy link
Member

adamint commented Mar 12, 2024

@kvenkatrajan the issue (can't reach this page) appears in all browsers, and the specific safari behavior is reproducible

@adamint
Copy link
Member

adamint commented Mar 25, 2024

Blocked on above linked sdk issue

@adamint adamint modified the milestones: preview 6 (Apr), GA Mar 26, 2024
@adamint adamint removed their assignment Apr 3, 2024
@v-polly
Copy link

v-polly commented Apr 10, 2024

@adamint , On Mac OS arm64 aspire preview 5 [8.0.0-preview.5.24201.12] + .NET 8.0.204 SDK(latest-released-build) with safari version 17.4.1 (19618.1.15.11.14), this issue is not repro with 'dotnet watch' / 'dotnet run -lp http/https'.
But it repro every time on safari with 'Ctrl + Shift + P' > Debug: Select and Start Debugging > C#: xxx.AppHost [https/http].
On Mac OS x64 with the same Configuration, the issue is reproduced on safari in both ways above.

  • Manually refresh the browser can display the correct page, Chrome and Edge not repro.
  • Also repro with Aspire preview 6 [8.0.0-preview.6.24210.22]
    image

@joperezr joperezr modified the milestones: GA, 8.1 May 6, 2024
@joperezr
Copy link
Member

joperezr commented May 6, 2024

@kvenkatrajan will take a look to see if there is something to fix for 8.1 and to check if this still repros.

@adamint
Copy link
Member

adamint commented May 6, 2024

This issue does reproduce with dotnet watch on Mac, all browsers. Also reproduces in VSCode with the above steps.

cc @joperezr @kvenkatrajan

@kvenkatrajan kvenkatrajan modified the milestones: 8.1, 8.4 Jul 8, 2024
@eerhardt eerhardt removed this from the 8.4 milestone Aug 21, 2024
@eerhardt eerhardt added this to the 9.0 milestone Aug 21, 2024
@joperezr
Copy link
Member

@kvenkatrajan is there anything to fix for 9.0 here?

@adamint
Copy link
Member

adamint commented Aug 26, 2024

@kvenkatrajan is there anything to fix for 9.0 here?

There is not, the linked sdk issue is still active.

@davidfowl davidfowl added the bug Something isn't working label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-tooling bug Something isn't working safari
Projects
None yet
Development

No branches or pull requests