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

bug: UPnP error when trying to map a port #1987

Closed
mickvandijke opened this issue Jul 19, 2024 · 5 comments
Closed

bug: UPnP error when trying to map a port #1987

mickvandijke opened this issue Jul 19, 2024 · 5 comments
Assignees
Labels
Bug Something isn't working

Comments

@mickvandijke
Copy link
Contributor

I noticed that nodes weren't opening any ports on my router through UPnP. I checked with miniupnpc and in my router logs. UPnP is definitely supported and enabled on my ASUS consumer router (tested it with other apps and miniupnpc).

So I checked the node logs to see what is going on:

SN_LOG=all,libp2p=trace cargo run --bin safenode --features "upnp" -- --upnp --peer /ip4/139.59.168.228/udp/56309/quic-v1/p2p/12D3KooWFTMtaqu24ddDSXk9v5YxnuhJmTLFRunER1CG4wZ2XLUU
2024-07-19T12:08:46.155489Z DEBUG libp2p_upnp::behaviour/Swarm::poll] network gateway not found, UPnP port mapping of multiaddres discarded multiaddres=/ip4/192.168.0.207/udp/56711/quic-v1

It looks like the issue stemmed from libp2p. To test it, I ran the libp2p upnp example and got this error:

Gateway does not support UPnP

Again, I saw that no ports were opened.

@b-zee then asked me to test the igd_next example, which did work:

It worked! Got port 59710
...
3 UDP 59710->192.168.0.207:8080  'add_port example' '' 52
...

I'm afraid that lots of other users are running into the same issue without them knowing. Perhaps this is the reason that some users report not receiving any node rewards?

@mickvandijke mickvandijke added the Bug Something isn't working label Jul 19, 2024
@mickvandijke
Copy link
Contributor Author

cc @b-zee @joshuef @grumbach

@b-zee
Copy link
Contributor

b-zee commented Jul 19, 2024

I have searched the forums and Discord but can not find people experiencing the same problem. If this is a bug, it's likely a bug that needs fixed in libp2p.

Depending on how many bump into this problem, it can cause problems. However, home nodes should function properly even without port forwarding by using relays.

@mickvandijke
Copy link
Contributor Author

Opened an issue on the libp2p repo for this: libp2p/rust-libp2p#5506

@mickvandijke mickvandijke self-assigned this Jul 22, 2024
@mickvandijke
Copy link
Contributor Author

I have opened a PR to fix this in igd-next (which libp2p uses): dariusc93/rust-igd#8

The issue was that I have multiple UPnP enabled devices on my network (like a Philips HUE bridge). When searching for a router/gateway to open the UPnP ports on, igd-next incorrectly assumed that the first UPnP enabled device would be the router (but for me, it happened to be my HUE bridge). Instead of trying other UPnP enabled devices to look for the router, the search would just fail if the first device is not the router/gateway.

@mickvandijke
Copy link
Contributor Author

Closed by dariusc93/rust-igd#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants