Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxies fail to start "bind: can't assign requested address" #7317

Open
1 task done
Bouke opened this issue Jan 29, 2025 · 6 comments
Open
1 task done

Proxies fail to start "bind: can't assign requested address" #7317

Bouke opened this issue Jan 29, 2025 · 6 comments

Comments

@Bouke
Copy link

Bouke commented Jan 29, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When I run the starter app template, the proxies aren't started. The webfrontend and apiservice are started and running just fine, but the proxies aren't listening. The logs show an error about not being able to assign the requested address. As a result, the service reference to apiservice in webfrontend is not working, and the 'Weather' page fails.

Expected Behavior

The proxies to be working.

Steps To Reproduce

> mkdir AspireTest
> cd AspireTest
> dotnet new aspire-starter
> cd AspireTest.AppHost
> dotnet run

Exceptions (if any)

~/D/A/AspireTest.AppHost ❱ dotnet run
Using launch settings from /Users/bouke/Developer/AspireTest/AspireTest.AppHost/Properties/launchSettings.json...
Building...
info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 9.0.0+01ed51919f8df692ececce51048a140615dc759d
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: /Users/bouke/Developer/AspireTest/AspireTest.AppHost
info: Aspire.Hosting.DistributedApplication[0]
      Now listening on: https://localhost:17198
info: Aspire.Hosting.DistributedApplication[0]
      Login to the dashboard at https://localhost:17198/login?t=feba1d44409784a6c32e9198cea00515
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy	{"ServiceName": {"name":"webfrontend-https"}, "Reconciliation": 5, "error": "could not start the proxy for the service: listen tcp [fe80::1]:7155: bind: can't assign requested address"}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy	{"ServiceName": {"name":"webfrontend-http"}, "Reconciliation": 6, "error": "could not start the proxy for the service: listen tcp [fe80::1]:5035: bind: can't assign requested address"}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy	{"ServiceName": {"name":"apiservice-https"}, "Reconciliation": 7, "error": "could not start the proxy for the service: listen tcp [fe80::1]:7520: bind: can't assign requested address"}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy	{"ServiceName": {"name":"apiservice-http"}, "Reconciliation": 8, "error": "could not start the proxy for the service: listen tcp [fe80::1]:5310: bind: can't assign requested address"}
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application started. Press Ctrl+C to shut down.
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 [fe80::1]:7520: bind: can't assign requested address"}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy	{"ServiceName": {"name":"apiservice-http"}, "Reconciliation": 10, "error": "could not start the proxy for the service: listen tcp [fe80::1]:5310: bind: can't assign requested address"}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy	{"ServiceName": {"name":"webfrontend-https"}, "Reconciliation": 11, "error": "could not start the proxy for the service: listen tcp [fe80::1]:7155: bind: can't assign requested address"}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy	{"ServiceName": {"name":"webfrontend-http"}, "Reconciliation": 12, "error": "could not start the proxy for the service: listen tcp [fe80::1]:5035: bind: can't assign requested address"}

.NET Version info

.NET SDK:
 Version:           9.0.100
 Commit:            59db016f11
 Workload version:  9.0.100-manifests.693890c1
 MSBuild version:   17.12.7+5b8665660

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.1
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.100/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: arm64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
(...)
  8.0.404 [/usr/local/share/dotnet/sdk]
  9.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
(...)
  Microsoft.NETCore.App 8.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  x64   [/usr/local/share/dotnet]
    registered at [/etc/dotnet/install_location_x64]

Environment variables:
  Not set

global.json file:
  Not found

Anything else?

I found another bug report about port binding, which is reportedly fixed (#6693), so I also tried with the latest preview build (9.1.0-preview.1.25079.2), but that doesn't fix it.

@joperezr joperezr added the untriaged New issue has not been triaged label Jan 29, 2025
@davidfowl
Copy link
Member

@Bouke Bouke changed the title Wrong ports listed for endpoints, references broken Proxies fail to start "bind: can't assign requested address" Jan 30, 2025
@Bouke
Copy link
Author

Bouke commented Jan 30, 2025

@davidfowl thank you for the pointer, I am indeed new to Aspire and trying out the starter app template to figure out what's what and what Aspire can do for me. I've updated the description to better show the problem I'm running into, which are (apparently) the proxies that fail to start.

@davidfowl
Copy link
Member

cc @danegsta

@karolz-ms
Copy link
Member

@Bouke I assume you are sure there is no more than one instance of the application running.

What is the networking stack configuration of your machine? Is it IPv6-only? Dual IPv4 and IPv6? Do you have any proxy/VPN software running on the machine? Does the errors disappear if you sed DCP_IP_VERSION_PREFERENCE=v4 environment variable?

@karolz-ms karolz-ms added needs-author-action An issue or pull request that requires more info or actions from the author. and removed untriaged New issue has not been triaged labels Feb 3, 2025
@Bouke
Copy link
Author

Bouke commented Feb 6, 2025

@karolz-ms Indeed, there's no other instance running. There's nothing bound to those ports either: netstat -abn | grep 7573 produces an empty output.

I have quite a few interfaces defined, amongst which a vpn (ipsec tunnel). With the vpn off, the error remains. My primary interface (en0) is dual IPv4 and IPv6. Using DCP_IP_VERSION_PREFERENCE=v4 makes the errors go away and fixes the proxies.

ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
	options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
	inet 127.0.0.1 netmask 0xff000000
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
	nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
anpi2: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=400<CHANNEL_IO>
	ether 1a:bd:bd:06:c3:01
	media: none
	status: inactive
anpi0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=400<CHANNEL_IO>
	ether 1a:bd:bd:06:c3:ff
	media: none
	status: inactive
anpi1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=400<CHANNEL_IO>
	ether 1a:bd:bd:06:c3:00
	media: none
	status: inactive
en4: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=400<CHANNEL_IO>
	ether 1a:bd:bd:06:c3:df
	nd6 options=201<PERFORMNUD,DAD>
	media: none
	status: inactive
en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=400<CHANNEL_IO>
	ether 1a:bd:bd:06:c3:e0
	nd6 options=201<PERFORMNUD,DAD>
	media: none
	status: inactive
en6: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=400<CHANNEL_IO>
	ether 1a:bd:bd:06:c3:e1
	nd6 options=201<PERFORMNUD,DAD>
	media: none
	status: inactive
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	options=460<TSO4,TSO6,CHANNEL_IO>
	ether 36:e6:7f:48:0e:80
	media: autoselect <full-duplex>
	status: inactive
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	options=460<TSO4,TSO6,CHANNEL_IO>
	ether 36:e6:7f:48:0e:84
	media: autoselect <full-duplex>
	status: inactive
en3: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	options=460<TSO4,TSO6,CHANNEL_IO>
	ether 36:e6:7f:48:0e:88
	media: autoselect <full-duplex>
	status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=63<RXCSUM,TXCSUM,TSO4,TSO6>
	ether 36:e6:7f:48:0e:80
	Configuration:
		id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
		maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
		root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
		ipfilter disabled flags 0x0
	member: en1 flags=3<LEARNING,DISCOVER>
	        ifmaxaddr 0 port 10 priority 0 path cost 0
	member: en2 flags=3<LEARNING,DISCOVER>
	        ifmaxaddr 0 port 11 priority 0 path cost 0
	member: en3 flags=3<LEARNING,DISCOVER>
	        ifmaxaddr 0 port 12 priority 0 path cost 0
	nd6 options=201<PERFORMNUD,DAD>
	media: <unknown type>
	status: inactive
ap1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
	ether 26:e7:d4:67:85:cc
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect (none)
	status: inactive
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
	ether ae:0a:f6:5e:b9:8e
	inet6 fe80::47:8d73:ec45:d53e%en0 prefixlen 64 secured scopeid 0xf 
	inet 192.168.1.42 netmask 0xffffff00 broadcast 192.168.1.255
	inet6 2001:XXX prefixlen 64 autoconf secured 
	inet6 2001:XXX prefixlen 64 autoconf temporary 
	inet6 fd37:XXX prefixlen 64 deprecated autoconf secured 
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active
awdl0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
	ether 3e:3e:fd:15:2d:51
	inet6 fe80::3c3e:fdff:fe15:2d51%awdl0 prefixlen 64 scopeid 0x11 
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active
llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=400<CHANNEL_IO>
	ether 3e:3e:fd:15:2d:51
	inet6 fe80::3c3e:fdff:fe15:2d51%llw0 prefixlen 64 scopeid 0x12 
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect (<unknown type>)
	status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
	inet6 fe80::edff:ecbe:8e53:d23f%utun0 prefixlen 64 scopeid 0x13 
	nd6 options=201<PERFORMNUD,DAD>
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::5a95:17a6:4b04:4b4d%utun1 prefixlen 64 scopeid 0x14 
	nd6 options=201<PERFORMNUD,DAD>
utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
	inet6 fe80::542b:def0:4f1c:e2e0%utun2 prefixlen 64 scopeid 0x15 
	nd6 options=201<PERFORMNUD,DAD>
utun3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1000
	inet6 fe80::ce81:b1c:bd2c:69e%utun3 prefixlen 64 scopeid 0x16 
	nd6 options=201<PERFORMNUD,DAD>
utun4: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::bc9a:7558:7fff:5d6b%utun4 prefixlen 64 scopeid 0x17 
	nd6 options=201<PERFORMNUD,DAD>
utun5: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::9c5b:bb90:d594:67%utun5 prefixlen 64 scopeid 0x18 
	nd6 options=201<PERFORMNUD,DAD>
utun6: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::c4af:8278:789e:988c%utun6 prefixlen 64 scopeid 0x19 
	nd6 options=201<PERFORMNUD,DAD>
utun7: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::87fb:801b:488c:87b0%utun7 prefixlen 64 scopeid 0x1a 
	nd6 options=201<PERFORMNUD,DAD>
utun8: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::b2ad:6f69:8dd2:9fe3%utun8 prefixlen 64 scopeid 0x1b 
	nd6 options=201<PERFORMNUD,DAD>
utun9: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::a85c:1c80:1831:acfb%utun9 prefixlen 64 scopeid 0x1c 
	nd6 options=201<PERFORMNUD,DAD>
utun10: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::df60:8b30:e1f6:3f18%utun10 prefixlen 64 scopeid 0x1e 
	nd6 options=201<PERFORMNUD,DAD>
utun11: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::db9e:deae:770b:aeb6%utun11 prefixlen 64 scopeid 0x24 
	nd6 options=201<PERFORMNUD,DAD>
en7: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=6464<VLAN_MTU,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
	ether 48:65:ee:13:62:a6
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect (none)
	status: inactive

@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Feb 6, 2025
@dbreshears dbreshears added this to the Backlog milestone Feb 10, 2025
@dluc
Copy link

dluc commented Feb 15, 2025

I've seen that error a lot too, usually when stopping and restarting the host. My current workaround is waiting for a minute or two. Not ideal but it seems to work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants