Transmission not starting the download

Hello,

I have installed transmission-daemon, can make it start, add files to download…but it does not download anything. It stays at 0 of 0 peers. It is not related to the router (I guess) since I have only re-installed completely OSMC on a new uSD, but haven’t changed anything on the router.

Any idea where to start ?

Thank you

Hi,

How did you install transmission-daemon?

In the app-store on MyOSMC

or

via the command line and apt-get

If it was via the command line, purge this and install the one in app-store

Are you sure you pi is online?

Thanks Tom.

Hi,

I installed it via the command and apt-get. Since I thought that the “client server” from the app store was different. Why shouldn’t we do that way ? Is the config done through the setting.json too, the same way as it is done from the command line one ?

How to purge it ?

Also, I had it running for years on OSMC, without problem. Have things changed in a way that it does not work anymore from the command line ?

Sorry :), many questions… Curious to understand

Hi,

Installing via MyOSMC, is the recommended way to install Transmission on OMSC; Also you configure it via the web interface.

I’ve installed via apt-get, but it should purge via this command:

sudo apt-get purge transmission-daemon

I’m not aware of any changes, but being as the torrents fail to download and assuming the pi is online and the torrents have seeds and peers; it makes sense to try the recommended route.

Thanks Tom.

If you’ve had it running successfully before, then I see no reason to reinstall transmission. I’ve not installed the OSMC version myself but I understand that the differences between it and the standard version are small, eg it no longer runs under user debian-transmission.

That said, I don’t quite understand how on the one hand you have had it “running for years on OSMC, without problem” but in your first post you say:

A couple of tests:

  • If you add a magnet link, does it download the torrent metadata?
  • Can you download a copy of Linux Mint? (Don’t bother downloading the whole file, just see if it works.)

Hi Nikox9,

Apologies when I posted my initially response, I’d forgotten about the VPN topic you’d created.

Just for testing: if you disconnect from the vpn (sudo systemctl stop openvpn), do your torrents start to download? You may need to pause and restart the download.

I only ask, as when first setup my VPN I had similar issues with my torrents.

Thanks Tom.

I suddenly had a problem and it showed that my SD card got (somehow) corrupted. And re-installing the .img I had (with transmission working) showed problems too. I therefore decided to re-install OSMC and all programs I need.

A couple of tests:

If you add a magnet link, does it download the torrent metadata?
Can you download a copy of Linux Mint? (Don’t bother downloading the whole file, just see if it works.)

The magnet link does not work. I will try the Linux Mint later and let you know.

EDIT: both magnet link and Linux Mint do not work

I will try… but it used to be working without problem

EDIT: not working without VPN either

I have purged transmission. I tried to install from OSMC, but got the following error:
Error installing: armv7-transmission-app-osmc (2.8.1-11)

Hi,

Have you tried the torrent provided by dilthedog for linux mint? With or without VPN

Thanks Tom.

This may seem to be a silly question, but can you ping the tracker from the Pi? If you can’t, can you ping 8.8.8.8?

I’d suggest you disable the vpn for now with sudo systemctl disable openvpn and then reboot the Pi.

Do you by any chance have user nobody group nogroup (or something similar) in your vpn config file? It’s a useful security measure but it means that openvpn can’t change the routing table back to “normal” when it shuts down.

How to ping the “tracker” ? what is that actually ?[quote=“dillthedog, post:11, topic:37669”]
Do you by any chance have user nobody group nogroup (or something similar) in your vpn config file?
[/quote]

No such line

I’d suggest you do a little reading up on what BitTorrents are if you are going to use them! BitTorrent - Wikipedia

So what happens if you ping 8.8.8.8?

Will do. Thanks for the link.

it responds fine.

UPDATE: I have re-installed the daemon through the apt-get and it works fine now, with VPN as well. :smiley:
Don’t know really why it didn’t…

The next step is: how to bind transmission to the VPN address so that transmissiononly runs when the VPN is runnnig ?
I used to have the following instructions - under Xbian (not using systemd):

In the /etc/transmission-daemon/settings_template.json I changed the bind-address-ipv4": "0.0.0.0" by "bind-address-ipv4": "VPN_IP_ADDRESS" and then wrote a script in a created file called up.sh, placed as follows in /etc/openvpn/up.sh

Here the script:
#!/bin/sh /etc/init.d/transmission-daemon stop sed s/VPN_IP_ADDRESS/$4/ /etc/transmission-daemon /settings_template.json > /etc/transmission-daemon /settings.json /etc/init.d/transmission-daemon start

And the script was launched once openvpn started

sudo nano /etc/init.d/startSB.sh

#!/bin/sh sudo openvpn --config /etc/openvpn/FIP/NL.ovpn --script-security 2 --up /etc/openvpn/up.sh

How to handle this under systemd ?

Thank you

Hi,

You could try making the following change to unit section of transmission-daemon.service:

[Unit]
Transmission BitTorrent Daemon
Requisite=openvpn.service
After=openvpn.service

Edit: Apologies I’ve just been advised by dilthedog, that it should be Requires=openvpn.service and I’ve had a quick look at the systemd man pages and I agree with him; so cheers Dill. Any way the unit edit should be:

[Unit]
Transmission BitTorrent Daemon
Requires=openvpn.service
After=openvpn.service

Thanks Tom.

1 Like

As Tom says, you need to add thos two lines to the transmission-daemon.service file and enable transmission to run at system startup with sudo systemctl enable transmission-daemon. Since transmission now requires openvpn, if the latter is stopped, transmission will also be stopped by systemd.

Binding to the VPN address isn’t strictly necessary but should give an extra level of assurance. Reading the script, it’s unclear which IP address you’re going to bind to, but AFAICT, it should be the one associated with tun0 (or whatever your tunnel is called).

From ifconfig:

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.1.1.41  P-t-P:10.1.1.41  Mask:255.255.0.0
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

In this case the IP address you’re interested in is 10.1.1.41. Unfortunately, it’s likely to change with each connection, so you’ll need to extract it and paste it into settings.json for each system startup.

I can foresee a few issues at startup, since openvpn will run before transmission, but will not know whether it’s able to issue the transmission. stop/start. I’d therefore recommend that you place a 5 second sleep in the [Service] section of the transmission-daemon.service file:

ExecStartPre=/bin/sleep 5

This will avoid the need for the stop/start when amending settings.json.

Edit: On reflection, I think that binding transmission to the VPN address is going to be more trouble than it’s worth. First, because connman still can’t deal with openvpn DNS push directives, you need to deal with them yourself. The only thing that I know of that works with OSMC is openresolv. (NB resolvconf should not be installed since it also installs the ifupdown package.) If you really do want to go down this path, I think the best way to update settings.json is via a shell script run from ExecStartPre in transmission-daemon.service. Either keep the 5-second sleep or, better still, check periodically to see if tun0 is UP, then get the IP address.

1 Like

Thanks a lot for all your help. I really appreciate it. [quote=“Tom_Doyle, post:15, topic:37669”]
You could try making the following change to unit section of transmission-daemon.service:
[/quote]

Thanks Tom. Where is this “unit section” located ?

Actually, it is the same address all the time. So no need to update it.

Not sure to get this comment: why would openvpn not know when to issue the stop/start command ? When openvpn is running, then transmission should be running too. And when the vpn is down, it should stop it.In the previous commands, I had stopped transmission from starting at boot, and it was then only launched when the openvpn was running.

Hi,

The [unit] section is at the top, this is what mine looks like on my raspbian pi:

[Unit]
Description=Transmission BitTorrent Daemon
Requires=openvpn..service
After=openvpn.service

[Service]
User=debian-transmission
Type=notify
ExecStart=/usr/bin/transmission-daemon -f --log-error
ExecReload=/bin/kill -s HUP $MAINPID
ExecStartPre=/bin/sleep 5

[Install]
WantedBy=multi-user.target

You only want to modify the unit section and leave [service] & [install] alone, unless you wish to add ExecStartPre=/bin/sleep 5 as dilthedog suggested; you add this to the [Service] as above.

Thanks Tom.

Tom, I am sorry :confused:, the top of what ? I don’t remember having seen such [Unit], [Service]…

Hi,

The /lib/systemd/system/transmission-daemon.service unit file.

Thanks Tom.

Transmission will start after openvpn, so it depends on when systemd gets around to starting it.

If you can be sure that the tun0 IP address is always the same, then you can hard-code it into settings.json, can’t you, otherwise moving the logic to ExecStartPre in transmission-daemon.service still makes more sense than running it under upenvpn.