dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.8k stars 450 forks source link

[AzureTools][Aspire][Unstable] The state of the container in the Dashboard changes "Running (Not ready)" when stopping the running container and then starting the container in Podman Desktop #5952

Open v-mengwe opened 1 month ago

v-mengwe commented 1 month ago

Clean machine: Win11 x64 23h2 ENU VS Version: VS 17.12.0 Preview 3.0 [35325.140.main] Aspire Version: 9.0.0-preview.4.24475.6 Apply NuGet Feeds Podman Desktop: 1.12.0 Podman CLI: 5.2.3

REPRO STEPS:

  1. Create an Aspire starter project with "Use Redis for caching (requires Docker)" checked.
  2. Update package references to all of Aspire dependencies to version 9.0.0-preview.4.24475.6-> Add <Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0-preview.4.24475.6" /> to the AppHost project file.
  3. F5/execute dotnet run in the AppHost project path and open the dashboard.
  4. Stop the running container in Podman Desktop -> Start container in Podman Desktop.
  5. Check whether the state of the container in the Dashboard changes "Running".

Expect: The state of the container in the Dashboard changes "Running".

Actual: [Unstable] The state of the container in the Dashboard changes "Running (Not ready)". image

More Info:

  1. This issue doesn't reproduce when stopping the running container and then starting the container in Dashboard.
  2. Frequency of recurrence, 7 out of 10 times. You can perform step 4 multiple times if you can't reproduce it.
balachir commented 2 days ago

@v-sherryfan can you try out this scenario too using latest VS 17.12 / CLI + VS Code? I'm interested to know if podman scenarios are blocked due to this issue.

cc: @v-elenafeng

v-sherryfan commented 1 day ago

@balachir I also reproduced this issue using SDK 9.0 GA + Aspire 9.0.0, but it currently behaves slightly differently than in this issue, as shown below. My verification results are unstable as mentioned in the issue. And it does not block our scenario, only when we manually stop and then start the container in podman desktop will we encounter this. Image

cc: @v-elenafeng

davidfowl commented 1 day ago

Does it stay unhealthy forever? The reason it says Running (unhealthy) is because even though the container is running it might be ready to receive traffic. The app host is doing health checks (for resources that have them configured) and that happens once the resource is running. It should eventually just say running.

v-sherryfan commented 1 day ago

@davidfowl Yes, the result of my verification is that if you encounter this problem, it will always be in an unhealthy state.

balachir commented 1 day ago

Some more info from @v-elenafeng: Repro with SDK 9.0 GA + Aspire 9.0.0. Only happens when we stop and start the container in podman desktop. And the unhealthy state persists.

@davidfowl I went ahead added this to 9.0 milestone for now. Can you help triage / assign?