You are not logged in.

#1 2013-11-18 01:10:33

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

BTSync unable to map port with UPnP [Solved]

Hi everyone. I recently jumped into Arch and got everything running how I like it. SystemD rocks!!! The only small hiccup is configuring BTSync (or maybe my iptables). I get an error message when I check status using systemctl and it reports that it is unable to map port using UPnP.

I'm using btsync 1.2.73-2 from the AUR and firewalld as my firewall configuration manager. The btsync section of the wiki doesn't cover this and I was able to get it running on Debian on the same hardware. I read that Arch has most of the ports closed by default so that's where I started my search. Any tips or pointers would be greatly appreciated. Thanks, and I hope one day to pay it forward.

 [axed@Roc ~]$ sudo systemctl status btsync@axed
btsync@axed.service - Bittorent Sync service for axed
   Loaded: loaded (/usr/lib/systemd/system/btsync@.service; enabled)
   Active: active (running) since Sun 2013-11-17 17:52:23 EST; 2h 5min ago
 Main PID: 6070 (btsync)
   CGroup: /system.slice/system-btsync.slice/btsync@axed.service
           `-6070 /usr/bin/btsync --config /home/axed/.config/btsync/btsync.conf --nodaemon

Nov 17 19:33:34 Roc btsync[6070]: Using IP address 10.0.1.29
Nov 17 19:33:38 Roc btsync[6070]: UPnP: Could not map UPnP Port on this pass, retrying.
Nov 17 19:33:43 Roc btsync[6070]: UPnP: Could not map UPnP Port on this pass, retrying.
Nov 17 19:33:48 Roc btsync[6070]: UPnP: Could not map UPnP Port on this pass, retrying.
Nov 17 19:33:53 Roc btsync[6070]: UPnP: Unable to map port 10.0.1.29:8086 with UPnP.
Nov 17 19:53:57 Roc btsync[6070]: UPnP: Could not map UPnP Port on this pass, retrying.
Nov 17 19:54:02 Roc btsync[6070]: UPnP: Could not map UPnP Port on this pass, retrying.
Nov 17 19:54:07 Roc btsync[6070]: UPnP: Could not map UPnP Port on this pass, retrying.
Nov 17 19:54:12 Roc btsync[6070]: UPnP: Unable to map port 10.0.1.29:8086 with UPnP.
Nov 17 19:57:21 Roc systemd[1]: Started Bittorent Sync service for axed. 

Last edited by ImperfectLink (2013-11-18 13:23:22)

Offline

#2 2013-11-18 01:15:18

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: BTSync unable to map port with UPnP [Solved]

Can you paste the service file you are using and your btsync config file (with any sensitive information removed) if you are using one, or the network settings in the Web UI?

FWIW: it works fine for me on multiple Arch boxes with no changes to my firewall rules.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-11-18 01:22:02

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: BTSync unable to map port with UPnP [Solved]

Thanks for your speedy reply Jason. Currently my WebUI has 8086 with UPnP turned on though I've tried it both ways.

Here is my config:

/*
 * Configuration file for BitTorrent sync.
 */
{ 
  "device_name" : "axed@Roc",
  "listening_port" : 8086,                       // 0 - randomize port
  
/* storage_path dir contains auxilliary app files
   if no storage_path field: .sync dir created in the directory 
   where binary is located.
   otherwise user-defined directory will be used 
*/
  "storage_path" : "/home/axed/.btsync",

// uncomment next line if you want to set location of pid file
// "pid_file" : "/var/run/btsync/btsync.pid",


  "check_for_updates" : true, 
  "use_upnp" : true,                              // use UPnP for port mapping


/* limits in kB/s
   0 - no limit
*/
  "download_limit" : 0,                       
  "upload_limit" : 0, 

/* remove "listen" field to disable WebUI
   remove "login" and "password" fields to disable credentials check
*/
  "webui" :
  {
    "listen" : "0.0.0.0:8889",
    "login" : "axed",
    "password" : "******"
  }

/* !!! if you set shared folders in config file WebUI will be DISABLED !!!
   shared directories specified in config file
   override the folders previously added from WebUI.
*/
/*
  ,
  "shared_folders" :
  [
    {
//  use --generate-secret in command line to create new secret
      "secret" : "***********************",                   // * required field
      "dir" : "/home/btsync", // * required field

//  use relay server when direct connection fails
      "use_relay_server" : true,
      "use_tracker" : true, 
      "use_dht" : false,
      "search_lan" : true,
//  enable SyncArchive to store files deleted on remote devices
      "use_sync_trash" : true,
//  specify hosts to attempt connection without additional search     
      "known_hosts" :
      [
        "192.168.1.2:44444"
      ]
    }
  ]
*/

// Advanced preferences can be added to config file.
// Info is available in BitTorrent Sync User Guide.

}

Again, a sincere thanks for your time.

Edit: Sorry forgot the service file info. I'm not sure where to find it so I'll do a little research.

Last edited by ImperfectLink (2013-11-18 01:23:08)

Offline

#4 2013-11-18 01:26:22

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: BTSync unable to map port with UPnP [Solved]

Your conf looks OK. The service file will be /usr/lib/systemd/system/btsync@.service


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-11-18 01:29:11

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: BTSync unable to map port with UPnP [Solved]

[Unit]
Description=Bittorent Sync service for %i
After=network.target
 
[Service]
User=%i
ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.conf --nodaemon
Restart=on-abort

[Install]
WantedBy=multi-user.target

Offline

#6 2013-11-18 01:31:49

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: BTSync unable to map port with UPnP [Solved]

You are missing the Type of service and also (inexplicably, but maybe not relevantly) are starting it in non-daemon mode: is there a reason for that?

[Unit]
Description=BitTorrent Sync service for %i
After=network.target

[Service]
Type=forking
User=%i
ExecStart=/usr/local/bin/btsync --config %h/.config/Syncapp/sync.conf
Restart=on-abort
PIDFile=%h/.config/Syncapp/.sync.pid

[Install]
WantedBy=multi-user.target

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2013-11-18 01:38:40

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: BTSync unable to map port with UPnP [Solved]

I modified the config generated by btsync-autoconfig from the AUR.

Offline

#8 2013-11-18 02:01:09

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: BTSync unable to map port with UPnP [Solved]

@jasonwryan, recently on the systemd-devel mailing list, someone was asking about getting help with a service file.  It was said that the Type=forking should be used only if necessary, and is the "messiest" situation.  I can't remember the specifics, but I actually think that this change should not be a problem.  Still, ImperfectLink, maybe you should try with the default service file (though i don't think that it would necessarily have any bearing on UPnP functioanlity).

Offline

#9 2013-11-18 02:17:15

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: BTSync unable to map port with UPnP [Solved]

WonderWoofy wrote:

@jasonwryan, recently on the systemd-devel mailing list, someone was asking about getting help with a service file.

WW: thanks, I'll give it a try.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2013-11-18 02:34:35

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: BTSync unable to map port with UPnP [Solved]

You should probably check that UpnP is enabled on your router. I made that mistake when I switched routers recently....

Scott

Offline

#11 2013-11-18 02:35:39

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: BTSync unable to map port with UPnP [Solved]

I removed  btsync-autoconfig via pacman then backed my btsync.conf and copied the default one over it and edited the locations. Still unable to map port.
Tried switching PID but no good either.

Offline

#12 2013-11-18 02:49:53

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: BTSync unable to map port with UPnP [Solved]

firecat53 wrote:

You should probably check that UpnP is enabled on your router. I made that mistake when I switched routers recently....

Scott

I have btsync running on Mac, Win7 and Debian. I assume there has to be some config I'm missing in Arch.

Offline

#13 2013-11-18 02:57:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: BTSync unable to map port with UPnP [Solved]

What happens if you (briefly) disable firewalld?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2013-11-18 03:29:17

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: BTSync unable to map port with UPnP [Solved]

I'm not sure what I did but i removed everything and installed btsync another time without the autoconfig and then ran it and after that installed the autoconfig and ran it. It seems to be running although I havent seen ti sync anything yet.

Edit:Yep it's working. Thanks for your help guys. I still don't know what actually fixed it...

Last edited by ImperfectLink (2013-11-18 03:34:34)

Offline

#15 2013-11-18 13:05:08

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: BTSync unable to map port with UPnP [Solved]

Maybe your upnp on your router got confused with different OS's on the same Mac or IP address.

Don't forget to mark the thread as solved smile

Last edited by jrussell (2013-11-18 13:05:37)


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#16 2013-11-18 13:27:57

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: BTSync unable to map port with UPnP [Solved]

Thanks for the reminder jrussel. I looked over the config again and really the only things I did was to specify the listening port, change the PID to one in the user directory and turn off the --nodaemon flag. After that I just reloaded daemons and started the service. Perhaps it was the router.

Last edited by ImperfectLink (2013-11-18 13:28:31)

Offline

#17 2014-02-02 14:16:01

r0b0t
Member
From: /tmp
Registered: 2009-05-24
Posts: 505

Re: BTSync unable to map port with UPnP [Solved]

Yes, I can confirm, had the same problem but the issue here was with the UPnP being disabled on the router.

Offline

Board footer

Powered by FluxBB