Skip to content

[WebToolsE2E][Aspire] After adding Aspire.Confluent.Kafka component and related codes, restarting messaging container resource fails with some errors "Failed to delete 'messaging-rmdxzjam' successfully before restart." in the Aspire dashboard console log #5972

@Rita003

Description

@Rita003

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU

  2. Install SDK 9.0.100-rc.2.24474.11

    • Apply feed for SDK 9.0 RC2
  3. Install Aspire 9.0.0-preview.4.24475.9

    • Apply the dotnet8 feed for Aspire 9.0

REPRO STEPS

  1. Open CMD, create an Aspire Starter App using following commands:
dotnet new aspire-starter -o AspireStarterApp
cd AspireStarterApp
  1. Add the Aspire.Confluent.Kafka component to your AspireStarterApp.Web app:
cd AspireStarterApp.Web
dotnet add package Aspire.Confluent.Kafka --version 9.0.0-preview.4.24475.9
  1. In the Program.cs file of the AspireStarterApp.Web project, type following codes:
    builder.AddKafkaProducer<string, string>("messaging");
  2. Open appsettings.json of AspireStarterApp.AppHost project, add ConnectionStrings configuration section:
{
  "ConnectionStrings": {
    "myConnection": "broker:9092"
  }
}
  1. Add the Aspire.Hosting.Kafka component to your AspireStarterApp.AppHost app:
cd ..
cd AspireStarterApp.AppHost
dotnet add package Aspire.Hosting.Kafka --version 9.0.0-preview.4.24475.9
  1. Open Program.cs of AspireStarterApp.AppHost project, add following codes:
var messaging = builder.AddKafka("messaging");
	
var myService = builder.AddProject<Projects.MyService>()
                   .WithReference(messaging);
  1. Run the project in CMD, and open URL in the browser.
    dotnet run
  2. Click the 'Restart' option behind the messaging container resource in the Aspire dashboard

ACTUAL
Restart failed with some errors in the console
Restart
Screenshot 2024-09-27 105531

Error Log:

2024-09-27T02:55:20 Executing command 'restart'.
2024-09-27T02:55:23
 Error executing command 'restart'.
Aspire.Hosting.DistributedApplicationException: Failed to delete 'messaging-rmdxzjam' successfully before restart.
   at Aspire.Hosting.Dcp.ApplicationExecutor.<>c__DisplayClass80_2`1.<<StartResourceAsync>b__2>d.MoveNext() in /_/src/Aspire.Hosting/Dcp/ApplicationExecutor.cs:line 2098
--- End of stack trace from previous location ---
   at Polly.ResiliencePipeline.<>c.<<ExecuteAsync>b__3_0>d.MoveNext()
--- End of stack trace from previous location ---
   at Polly.Outcome`1.GetResultOrRethrow()
   at Polly.ResiliencePipeline.ExecuteAsync(Func`2 callback, CancellationToken cancellationToken)
   at Aspire.Hosting.Dcp.ApplicationExecutor.<>c__DisplayClass80_0.<<StartResourceAsync>g__StartExecutableOrContainerAsync|0>d`1.MoveNext() in /_/src/Aspire.Hosting/Dcp/ApplicationExecutor.cs:line 2093
--- End of stack trace from previous location ---
   at Aspire.Hosting.Dcp.ApplicationExecutor.StartResourceAsync(String resourceName, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/ApplicationExecutor.cs:line 2041
   at Aspire.Hosting.ApplicationModel.CommandsConfigurationExtensions.<>c.<<AddLifeCycleCommands>b__3_5>d.MoveNext() in /_/src/Aspire.Hosting/ApplicationModel/CommandsConfigurationExtensions.cs:line 88
--- End of stack trace from previous location ---
   at Aspire.Hosting.Dashboard.DashboardCommandExecutor.ExecuteCommandAsync(String resourceId, ResourceCommandAnnotation annotation, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dashboard/DashboardCommandExecutor.cs:line 31
   at Aspire.Hosting.Dashboard.DashboardServiceData.ExecuteCommandAsync(String resourceId, String type, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dashboard/DashboardServiceData.cs:line 108

Metadata

Metadata

Assignees

Labels

area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationarea-orchestrator

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions