Opened 6 years ago

Closed 6 years ago

#986 closed defect (fixed)

UPnP thrashing and failures

Reported by: guest Owned by: zzz
Priority: minor Milestone: 0.9.8
Component: router/transport Version: 0.9.7
Keywords: Cc: zab@…
Parent Tickets:

Description

Hi,

I've noticed UPnP failing on my router. It is unable to port forward (leading to a generic "Router does not support port forwarding" error in /logs) via UPnP.

Unsure of how true this was, I set about debugging my router. My router is able to use UPnP with other applications. Following str4d's advice, I set the below settings at /configlogging:

net.i2p.router.transport.UPnP=DEBUG
net.i2p.router.transport.UPnPManager=DEBUG

This lead to various debug output from I2P (notably thrashing and failure):

22/07/13 21:57:58 INFO  [JobQueue 1/1] net.i2p.router.transport.UPnP : UP&P Forwarding 1 ports...
22/07/13 21:57:58 INFO  [JobQueue 1/1] net.i2p.router.transport.UPnP : Starting thread to forward 1 ports
22/07/13 21:57:59 WARN  [ort Opener 1] net.i2p.router.transport.UPnP : Registering a port mapping for XXXX/UDP
22/07/13 21:57:59 WARN  [ort Opener 1] net.i2p.router.transport.UPnP : UPnP device does not support port forwarding
22/07/13 21:57:59 WARN  [ort Opener 1] net.i2p.router.transport.UPnP : Mapping has failed! (1 tries)
22/07/13 21:57:59 DEBUG [ort Opener 1] p.router.transport.UPnPManager: UPnP Callback:
22/07/13 21:57:59 INFO  [ort Opener 1] net.i2p.router.transport.UPnP : UP&P.getAddress() is called \o/
22/07/13 21:57:59 WARN  [ort Opener 1] net.i2p.router.transport.UPnP : No external address returned
22/07/13 21:57:59 DEBUG [ort Opener 1] p.router.transport.UPnPManager: No external address returned
22/07/13 21:57:59 DEBUG [ort Opener 1] p.router.transport.UPnPManager: SSU 17 XXXX status: -1 reason: UPnP port forwarding apparently failed ext port: XXXX

I do not intend on flooding this ticket with debug outputs so I will paste the rest (thrashing) to pastethis.i2p. It consists mainly of I2P's UPnP system trying to open NTCP and SSU ports but failing: http://pastethis.i2p/show/2Fi1Q6WPsmTaFoC1W5a7/

I could be entirely wrong in feeling this is a bug but my router is definitely able to use UPnP with some applications, I figure this could be relevant.
This bug from a torrent application could be relevant: http://forum.deluge-torrent.org/viewtopic.php?f=7&t=12245 / http://dev.deluge-torrent.org/ticket/610

Thanks,

Subtickets

Change History (9)

comment:1 Changed 6 years ago by zzz

  • Component changed from unspecified to router/transport
  • Owner set to zzz

you may get more info from org.cybergarage.util.Debug=DEBUG

comment:2 Changed 6 years ago by zab

  • Cc zab@… added

comment:3 Changed 6 years ago by zzz

As of 0.9.7-9 4ab03127162c9317e0da2c9871d5f0a6e631e068 you can use the following to dump out the UPnP device info:

java -cp $I2P/lib/i2p.jar:$I2P/lib/router.jar net.i2p.router.transport.UPnP > out.html
view that file in a browser, edit out your IP address and pastebin it or attach it here. Our code thinks the device does not have an AddPortMapping? action available.

re: "thrashing", that's just internal logging, it's remembered that the device is bad. It's not repeatedly querying it. I don't think. But adding the debug log line above will tell you.

comment:4 Changed 6 years ago by zzz

NPE in test fixed in 3d4a5cd3d933f75fdff7696f560c569f4674bd73

comment:6 Changed 6 years ago by zzz

Important info to know: OP reports that he has the same device as that in the deluge ticket.

comment:7 Changed 6 years ago by zzz

with NPE fix and cybergarage debug: http://pastethis.i2p/show/JF42tmHml7ywVuSl7fnU/

note / that shouldn't be there

comment:8 Changed 6 years ago by zzz

Next step is to figure out if this is already fixed upstream and if not, file a ticket with them. We updated to 2.1 (released Sept. 2011?) in 0.9.2 last year.

Looks like 2.1 is still the latest and I don't see much recent activity. Perhaps one of the forks on github https://github.com/cybergarage/CyberLink4Java has a fix. Will take some back-and-forth to fix it without access to a device.

The fix will be either at Service.java:439 or in HTTP.toRelativeURL() - probably the latter, needs to remove moar slashes? Will need some debug logging to verify.

comment:9 Changed 6 years ago by zzz

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in 0.9.7-10 75e5f5d4e0f0dd44140908bb6e73830e3448bdde

I looked at Device.java in Cyberlink SVN... getAbsoluteURL() was completely rewritten, but I tried updating that file (alone) and it didn't work at all. Rather than try updating and merging the whole library just to see if it worked, we simply added a one-line fix for the double slash.

Note: See TracTickets for help on using tickets.