-
Notifications
You must be signed in to change notification settings - Fork 854
App host shutdown - "Hosting failed to start" error message #6314
Copy link
Copy link
Closed
Labels
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
If I CTRL+C the app host just after it starts up in TestShop I see this error in the console:
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
Hosting failed to start
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Text.Json.Utf8JsonWriter.FlushAsync(CancellationToken cancellationToken)
at Aspire.Hosting.RedisBuilderExtensions.<WithRedisInsight>g__ImportRedisDatabases|2_0(ILogger resourceLogger, IEnumerable`1 redisInstances, HttpClient client, CancellationToken ct) in C:\Development\Source\aspire\src\Aspire.Hosting.Redis\RedisBuilderExtensions.cs:line 209
at Aspire.Hosting.RedisBuilderExtensions.<>c__DisplayClass2_1.<<WithRedisInsight>b__1>d.MoveNext() in C:\Development\Source\aspire\src\Aspire.Hosting.Redis\RedisBuilderExtensions.cs:line 175
--- End of stack trace from previous location ---
at Aspire.Hosting.Eventing.DistributedApplicationEventing.<>c__DisplayClass4_0`1.<<Subscribe>b__0>d.MoveNext() in C:\Development\Source\aspire\src\Aspire.Hosting\Eventing\DistributedApplicationEventing.cs:line 82
--- End of stack trace from previous location ---
at Aspire.Hosting.Eventing.DistributedApplicationEventing.PublishAsync[T](T event, EventDispatchBehavior dispatchBehavior, CancellationToken cancellationToken) in C:\Development\Source\aspire\src\Aspire.Hosting\Eventing\DistributedApplicationEventing.cs:line 69
at Aspire.Hosting.Dcp.ApplicationExecutor.RunApplicationAsync(CancellationToken cancellationToken) in C:\Development\Source\aspire\src\Aspire.Hosting\Dcp\ApplicationExecutor.cs:line 148
at Aspire.Hosting.Dcp.DcpHostService.StartAsync(CancellationToken cancellationToken) in C:\Development\Source\aspire\src\Aspire.Hosting\Dcp\DcpHostService.cs:line 75
at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
I think this is related to #6038. The problem is starting the app host is waiting on user code and wait fors. It shouldn't be. These things should happen in another task.
Expected Behavior
No error.
Steps To Reproduce
- Start TestShop
- Don't have Docker running
- CTRL+C host
- Host shuts down and prints error
Exceptions (if any)
No response
.NET Version info
No response
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication