{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/2648","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/2648/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/2648/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/2648/events","html_url":"https://github.com/syncthing/syncthing/issues/2648","id":124603539,"number":2648,"title":"UPnP port mapping failure","user":{"login":"noodle-","id":812565,"avatar_url":"https://avatars.githubusercontent.com/u/812565?v=3","gravatar_id":"","url":"https://api.github.com/users/noodle-","html_url":"https://github.com/noodle-","followers_url":"https://api.github.com/users/noodle-/followers","following_url":"https://api.github.com/users/noodle-/following{/other_user}","gists_url":"https://api.github.com/users/noodle-/gists{/gist_id}","starred_url":"https://api.github.com/users/noodle-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noodle-/subscriptions","organizations_url":"https://api.github.com/users/noodle-/orgs","repos_url":"https://api.github.com/users/noodle-/repos","events_url":"https://api.github.com/users/noodle-/events{/privacy}","received_events_url":"https://api.github.com/users/noodle-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-02T18:16:12Z","updated_at":"2016-01-02T18:25:15Z","closed_at":null,"body":"Enabling UPnP causes my router to get filled up with UPnP port mappings because Syncthing opens a new one every 20 minutes.\r\n\r\nWhen the router can't handle any more UPnP port mapping requests (it's not the most high quality router but that's beside the point I'm trying to make here) Syncthing will start showing the following error message: \r\n\"Failed to set UPnP port mapping: external port 0 on device {name} (IP)\" as also described here #1824.\r\nand my router's UPnP Port Mapping will look like this\r\n\r\n![routerupnp](https://i.imgur.com/iOKvNwA.png)\r\n\r\nThings I've tried to no avail; \r\n(While there's only one device with UPnP enabled) I've set the \"Sync Protocol Listen Addresses\" for every Syncthing device to a different one.\r\nEnabled UPnP on all other devices, to see wether it was just one device causing the issue. All latest Linux and Windows builds seem to be affected.\r\n\r\nMy Android device doesn't seem to be affected by this issue, it only has one entry in the list of UPnP port mappings and it seems to be working just fine.\r\n\r\nDevices:\r\n- Windows 10 / SyncTrayzor 1.0.32 / Syncthing v0.12.10\r\n- Windows 10 / SyncTrayzor 1.0.32 / Syncthing v0.12.10\r\n- Linux Debian 3.4.108-bananian / Syncthing v0.12.10 \r\n- Android 5.1.1 / Syncthing-Android v0.7.5 / Syncthing v0.12.6\r\n\r\nI have no idea why this only started happening recently (as in the last two or three weeks) but that's why I posted this as a seperate issue instead of adding it to #1824."},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/168414534","html_url":"https://github.com/syncthing/syncthing/issues/2648#issuecomment-168414534","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/2648","id":168414534,"user":{"login":"AudriusButkevicius","id":1144861,"avatar_url":"https://avatars.githubusercontent.com/u/1144861?v=3","gravatar_id":"","url":"https://api.github.com/users/AudriusButkevicius","html_url":"https://github.com/AudriusButkevicius","followers_url":"https://api.github.com/users/AudriusButkevicius/followers","following_url":"https://api.github.com/users/AudriusButkevicius/following{/other_user}","gists_url":"https://api.github.com/users/AudriusButkevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/AudriusButkevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudriusButkevicius/subscriptions","organizations_url":"https://api.github.com/users/AudriusButkevicius/orgs","repos_url":"https://api.github.com/users/AudriusButkevicius/repos","events_url":"https://api.github.com/users/AudriusButkevicius/events{/privacy}","received_events_url":"https://api.github.com/users/AudriusButkevicius/received_events","type":"User","site_admin":false},"created_at":"2016-01-02T18:25:15Z","updated_at":"2016-01-02T18:25:15Z","body":"It tries up to 10 first pseudo-random ports per device ID.\r\nWhich means that for device ID X, the 10 ports will always be the same.\r\nThis could happen if you cycled device ID's multiple times and the lease time you are asking is permanent.\r\n\r\nCan you remove the port mappings, and run syncthing with envvar STTRACE=upnp and provide the logs?"}}