You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time I restart my aspire project, I am getting a bunch of "Only one usage of each socket address" errors. The only way I can avoid getting these errors is to explicitly kill the already running app host instance before starting a new one. I haven't seen this on my work machine, but am consistently seeing it on my personal machine.
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-https"}, "Reconciliation": 9, "error": "could not start the proxy for the service: listen tcp [::1]:7415: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
Expected Behavior
No errors on startup.
Steps To Reproduce
Have an AppHost project in VS
Start without debugging
Start without debugging again to restart the app
20241115-2114-36.4003668.mp4
Don't think the contents of my project is relevant, but it's essentially the starter project
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-http"}, "Reconciliation": 7, "error": "could not start the proxy for the service: listen tcp [::1]:5321: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"webfrontend-https"}, "Reconciliation": 8, "error": "could not start the proxy for the service: listen tcp [::1]:7249: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"webfrontend-http"}, "Reconciliation": 9, "error": "could not start the proxy for the service: listen tcp [::1]:5244: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-https"}, "Reconciliation": 12, "error": "could not start the proxy for the service: listen tcp [::1]:7415: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-https"}, "Reconciliation": 15, "error": "could not start the proxy for the service: listen tcp [::1]:7415: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-http"}, "Reconciliation": 16, "error": "could not start the proxy for the service: listen tcp [::1]:5321: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
.NET Version info
.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.b7b342be
MSBuild version: 17.12.7+5b8665660
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100\
.NET workloads installed:
[aspire]
Installation Source: VS 17.12.35506.116
Manifest Version: 9.0.0-preview.4.24454.4/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\9.0.0-preview.4.24454.4\WorkloadManifest.json
Install Type: Msi
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4
.NET SDKs installed:
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.100-rc.2.24474.11 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-rc.2.24474.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.2.24473.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0-rc.2.24474.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Thank you for the report, @afscrome . I have a strong suspicion this is a timing issue. The stopping on of the project Executable, and the stopping of associated Endpoint proxies happens asynchronously. If the Executable gets re-created quickly (which is the case during restart), and if it uses fixed ports (which .NET projects typically do), the proxies from the previous run might still occupy the ports.
We probably need to delay reporting the Executable until all its Endpoints are gone. At least if the Executable is using fixed ports.
@dbreshears pointed out this is AppHost restart, not project restart. Still it is a timing issue associated with the port checks and the previous instance not freeing up the ports/stopping the proxies fast enough. The solution here is probably to re-try the project startup and port allocation (new instance)
I am facing the same issue. Tried different things already, nothing helped so far
David mentioned in .NET Aspire Starter Application not working.. #4257 that it might be something with IPv6 - I used environment variable and switched to v4 "DCP_IP_VERSION_PREFERENCE": "IPv4", - I can confirm proxy was setup with ipv4 but problem persists
I tried to disable firewall
I tried to change ports (I hope I got you right) but for me each new run result with the same issue - you can see error with ports that haven't been used before
Not sure if this will be helpful in any way but I uploaded my project here: aspire_issue_6693 - it's a fresh solution with api project + orchestrator
Is there an existing issue for this?
Describe the bug
Every time I restart my aspire project, I am getting a bunch of "Only one usage of each socket address" errors. The only way I can avoid getting these errors is to explicitly kill the already running app host instance before starting a new one. I haven't seen this on my work machine, but am consistently seeing it on my personal machine.
Expected Behavior
No errors on startup.
Steps To Reproduce
20241115-2114-36.4003668.mp4
Don't think the contents of my project is relevant, but it's essentially the starter project
Exceptions (if any)
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-http"}, "Reconciliation": 7, "error": "could not start the proxy for the service: listen tcp [::1]:5321: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"webfrontend-https"}, "Reconciliation": 8, "error": "could not start the proxy for the service: listen tcp [::1]:7249: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"webfrontend-http"}, "Reconciliation": 9, "error": "could not start the proxy for the service: listen tcp [::1]:5244: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-https"}, "Reconciliation": 12, "error": "could not start the proxy for the service: listen tcp [::1]:7415: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-https"}, "Reconciliation": 15, "error": "could not start the proxy for the service: listen tcp [::1]:7415: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
could not start the proxy {"ServiceName": {"name":"apiservice-http"}, "Reconciliation": 16, "error": "could not start the proxy for the service: listen tcp [::1]:5321: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
.NET Version info
Anything else?
The text was updated successfully, but these errors were encountered: