Skip to content

[AspireE2E]The health check details show an exception ”System.Threading.Tasks.TaskCanceledException: A task was canceled.“ after rebuilding the project #15274

@EmilyFeng97

Description

@EmilyFeng97

REGRESSION INFO: New feature changes on Aspire.ProjectTemplates 13.2

INSTALL STEPS

  1. Clean machine: Windows 23h2 x64
  2. Install SDK 10.0.201
  3. Add feed:
    dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json --name dotnet9
  4. Install Aspire.ProjectTemplate:
    dotnet new install Aspire.ProjectTemplates@13.2.0-preview.1.26165.2 --force

REPRO STEPS

  1. Open CMD, create an Aspire Starter App using following commands:
    dotnet new aspire-starter -o aspire01
    cd aspire01/aspire01.AppHost
    
  2. Run the app with dotnet run
  3. Open the Dashboard URL in browser
  4. Click the View options icon in the upper right corner, then click Show hidden resources option
  5. For the apiservice project, click ellipsis in Action column, then click the rebuild button.
  6. Wait the apiservice project rebuild succeeded
  7. For the apiservice-rebuilder project, click ellipsis in Action column, then click the View details button
  8. View the Health checks table

ACTUAL
The health check table shows the status as unhealthy, and the details column indicates there are exceptions.

Image

Image

There is no Exception info in the Console log.
Image

Note:

  1. This issue also repro after rebuilding the webfrontend project.
  2. The apiservice and webfrontend project can work well after rebuilding.

Error Info

System.Threading.Tasks.TaskCanceledException: A task was canceled.
 ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.<SendCoreAsync>g__Core|4_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.<SendCoreAsync>g__Core|4_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at HealthChecks.Uris.UriHealthCheck.CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken) in /home/runner/work/AspNetCore.Diagnostics.HealthChecks/AspNetCore.Diagnostics.HealthChecks/src/HealthChecks.Uris/UriHealthCheck.cs:line 54

Metadata

Metadata

Assignees

Labels

needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions