microsoft / microsoft/aspire

When running two AppHosts Aspire.Hosting.Dcp reports a proxy error when both AppHosts have the same .AddContainer

Open
#10,534 7 comments 0 reactions 0 assignees View on GitHub
needs-area-label
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

I have two different AppHost projects, both configured as follows
```
var builder = DistributedApplication.CreateBuilder(args);

var rabbitmqUserName = builder.AddParameter("rabbitmq-username", true);
var rabbitmqPassword = builder.AddParameter("rabbitmq-password", true);
var rabbitmq = builder
.AddRabbitMQ("rabbitmq", rabbitmqUserName, rabbitmqPassword, 5273)
.WithContainerName("shared-rabbitmq")
.WithDataVolume("shared-rabbitmq")
.WithManagementPlugin(15673)
.WithLifetime(ContainerLifetime.Persistent);
builder.Build().Run();
```

(there are other things, but this is the bare minimum to reproduce)

Starting the first AppHost I can see everything healthy in the Aspire dashboard, and that the shared-rabbitmq container has started. After starting the second AppHost it also reports rabbitmq has healthy in the dashboard however after a few minutes it starts logging the following error in the console

```
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"rabbitmq-management"}, "Reconciliation": 46, "error": "could not start the proxy for the service: listen tcp [::1]:15673: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
```

it logs this error periodically, however everything is working correctly

### Expected Behavior

Not expecting to see this error.

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version info

Dotnet 9
Aspire 9.3.1

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.