dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.28k stars 520 forks source link

"Not found" when accessing Tye dashboard on second start #1156

Open mathiasi opened 3 years ago

mathiasi commented 3 years ago

Describe the bug

New to Tye and following the standard tutorial but I've noticed that once I stop my "tye run" and rerun then the dashboard and service is returning 404 Not Found. I have to restart Docker in order for it to work again.

To Reproduce

$ dotnet new razor -n frontend $ tye run frontend Access dashboard on http://127.0.0.1:8000/ - observe dashboard is working. Ctrl+C $ tye run frontend Access dashboard on http://127.0.0.1:8000/ - observe 404 is returned.

Further technical details

[15:10:01 INF] Executing application from C:\Src\Hackathon\microservices\frontend\frontend.csproj [15:10:01 INF] Dashboard running on http://127.0.0.1:8000 [15:10:01 INF] Building projects [15:10:02 INF] Launching service frontend_a9d613b5-2: C:\Src\Hackathon\microservices\frontend\bin\Debug\net5.0\frontend.exe [15:10:02 INF] frontend_a9d613b5-2 running on process id 19316 bound to http://localhost:59639, https://localhost:59640 [15:10:02 INF] Replica frontend_a9d613b5-2 is moving to a ready state [15:10:03 INF] Selected process 19316. [15:10:03 INF] Listening for event pipe events for frontend_a9d613b5-2 on process id 19316


- The platform (Linux/macOS/Windows)
Windows
ignacioerrico commented 3 years ago

I couldn't reproduce this. Used the same version of Tye on Windows 10 v20H2.

When pressing CTRL+C on the terminal to stop Tye, the dashboard immediately displays this:

image

When running tye run frontend again, I need to refresh the browser (F5) to display the dashboard, but it shows just like on the first tye run.

Is this intermittent or does it happen every time? What happens if you open one of the bindings in the output?

ace90210 commented 2 years ago

I have the same issue only its now permanent.

A workaround i found (that works for now at least) which might give a clue as to the issue, is, it seems bizarrely that only firefox can run the dashboard still. Postman gets the same 404 (even if i copy the request straight out of firefox with identical headers) and no chromium browsers can load it either. Theres something firefox is silently doing to make it work but im at a loss as to what. Anything other than firefox gets a basic 404 response with a text/plain content type saying "Not found".

Note: if firefox doesnt work either i found the following two steps reliably fix it on firefox.

  1. close and rerun tye
  2. run firefox in private mode

also previously control F5 or incognito in chrome was working but even thats stopped working entirely now.

as i can reproduce this easily i could run any tests or extract debug info if you want.

edit: just after posting this i saw in the logs it stating its running on http://127.0.0.1:8000 which until now i had just looked over as its http and port 8000 BUT i thought id try copy pasting it in the ip format instead of localhost and voila it works.

so another workaround is just use the local ip explicitly and this indicates its a dns issue i guess.