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.54k stars 387 forks source link

Unable to run Aspire apps and RabbitMQ containers with Podman on Windows 11 #3517

Open rkttu opened 4 months ago

rkttu commented 4 months ago

I'm testing my code to use .NET Aspire out of the box, but it's not working as well as I thought it would, so I'm creating an issue.

Symptoms

fail: Aspire.Hosting.Dcp.dcpctrl.ContainerReconciler[0]
      could not inspect the container   {"Container": {"name":"messaging"}, "Reconciliation": 2, "error": "json: cannot unmarshal array into Go struct field podmanInspectedContainerConfig.Config.Entrypoint of type string"}
fail: Aspire.Hosting.Dcp.dcpctrl.ContainerReconciler[0]
      container has failed to start     {"Container": {"name":"messaging"}, "Reconciliation": 4, "error": "json: cannot unmarshal array into Go struct field podmanInspectedContainerConfig.Config.Entrypoint of type string"}

Reproducing Steps

var builder = DistributedApplication.CreateBuilder(args);

// Add Rabbit MQ
builder.AddRabbitMQ("messaging");

builder.Build().Run();

Environment

davidfowl commented 4 months ago

There are a couple of issues:

  1. podman 5 is incompatbile with aspire preview 4, it'll be fixed in preview 6 unfortunately. Preview 5 has this same issue (https://github.com/dotnet/aspire/issues/3249)
  2. A newer version of visual studio won't have the popup problem.
davidfowl commented 4 months ago

If you want to live on the edge you can install the latest daily build

AndreKfm commented 2 months ago

Does the problem still exist?

I'm on

Aspire 8.0.1/8.0.100
Visual Studio 17.10.0 or Visual Studio 17.11.0 Preview 1.0

Followed the documentation for RabbitMQ:

Server. builder.AddRabbitMQClient("messaging");

Client: var messaging = builder.AddRabbitMQ("messaging");

But get then autenthication issues, because it's using the default client creds and is not connecting over localhost. But configuring the container to use another dedicated port failed too. I could startup manually but then the advantage of Aspire would be missing.

davidfowl commented 2 months ago

I don't think this problem still exists no. The original problem with a podman 5.0 specific problem.

AndreKfm commented 2 months ago

Thx, I will try to reproduce on another machine and create a new one if it still exists

AndreKfm commented 2 months ago

Approved, seems to be a misconfiguration on my other PC. Retried on another PC and it worked out of the box. Thx again.