Linuxserver/transmission no uploads

transmission

#1

Hello all!

I am trying to figure out why my Transmission docker image does not upload what it is seeding. This might turn out a a large post as I will try to give as much details as possible.

I am using a Ubuntu 18 virtual machine. I use opentracker with it’s default config.

this section of my docker-compose file is about the tracker and transmission images. The other part if for my Flask app and Nginx containers

  
  tracker:
    build:
      dockerfile: compose/opentracker/Dockerfile
      context: .
    ports:
      - 6969:6969
      - 6969:6969/udp
    volumes:
      - ~/api_file_server/opentracker:/etc/opentracker
    hostname: tracker
    container_name: tracker

  transmission:
    build:
      dockerfile: compose/transmission/Dockerfile
      context: .
    container_name: transmission
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Bucharest
      - TRANSMISSION_WEB_HOME=/combustion-release/ #optional
    volumes:
      - ~/api_file_server/converted:/downloads
      - ~/api_file_server/converted:/watch
    ports:
      - 9091:9091
      - 51413:51413
      - 51413:51413/udp
    restart: unless-stopped
    hostname: transmission

In ~/api_file_server/converted I have my files that I will like to seed with Transmission so that I can download then on other devices on my network.

Transmission is configured to be quite permissive at this point and the downloads folder is set where my files exist so when the torrent is added it’s sent directly into seeding.

{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": false,
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 4,
    "dht-enabled": true,
    "download-dir": "/downloads",
    "download-queue-enabled": true,
    "download-queue-size": 5,
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "/downloads/incomplete",
    "incomplete-dir-enabled": false,
    "lpd-enabled": false,
    "message-level": 2,
    "peer-congestion-algorithm": "",
    "peer-id-ttl-hours": 6,
    "peer-limit-global": 200,
    "peer-limit-per-torrent": 50,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": "default",
    "pex-enabled": true,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "prefetch-enabled": true,
    "queue-stalled-enabled": true,
    "queue-stalled-minutes": 30,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": false,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-host-whitelist": "*",
    "rpc-host-whitelist-enabled": true,
    "rpc-password": "{1ddd3f1f6a71d655cde7767242a23a575b44c909n5YuRT.f",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "",
    "rpc-whitelist": "*",
    "rpc-whitelist-enabled": false,
    "scrape-paused-torrents-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "seed-queue-enabled": false,
    "seed-queue-size": 10,
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 100,
    "speed-limit-up-enabled": false,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 2,
    "upload-slots-per-torrent": 14,
    "utp-enabled": true,
    "watch-dir": "/watch",
    "watch-dir-enabled": true
}

I create the torrent using python, point it to the docker tracker announce (both docker network and host network) and then add it to transmission with a POST request.

class BoxTorrent:
    ANNOUNCE_URLS = ['http://tracker:6969/announce/', 'udp://tracker:6969/announce/', 'http://0.0.0.0:6969/announce/']
    TORRENT_PATH = 'converted/'

    TRANSMISSION_HOST = 'transmission'
    TRANSMISSION_PORT = 9091

    TRANSMISSION_HOST_RPC = 'http://{}:{}/transmission/rpc'.format(TRANSMISSION_HOST, TRANSMISSION_PORT)

    def __init__(self, uid):
        self.torrent = Torrent.create_from(self.TORRENT_PATH + uid + '.mp4')
        self.torrent.announce_urls = self.ANNOUNCE_URLS
        
        self.torrent_file = self.TORRENT_PATH + uid + '.torrent'
        self.torrent.to_file(self.torrent_file)
        
        self.magnet = self.torrent.get_magnet()

    @property
    def get_magnet(self):
        return self.torrent.get_magnet()

    def addtorrent(self):
        with open(self.torrent_file, 'rb') as f:
            metainfo = b64encode(f.read())

        h = Http(".cache")

        resp, content = h.request(self.TRANSMISSION_HOST_RPC, "GET")
        headers = { "X-Transmission-Session-Id": resp['x-transmission-session-id'] }

        body = dumps({'method': 'torrent-add', 'arguments': {'metainfo': metainfo}})
        
        conn = HTTPConnection(host=self.TRANSMISSION_HOST, port=self.TRANSMISSION_PORT)
        conn.request('POST', '/transmission/rpc', body, headers)
        r1 = conn.getresponse()

        conn.close()

The result is that the torrent is added to transmission, transmission sees the tracker and starts seeding

I open the torrent in Transmission GUI(in host OS) and hope it will start downloading.

Tracker seems to monitor the activity

But I get no download in Transmission GUI. where did I mess up?


#2

and these are logs start of the logs for the transmission container

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

usermod: no changes
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing... 
[cont-init.d] 20-config: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2019-03-07 17:13:48.593] Transmission 2.94 (d8e60ee44f) started (session.c:740)
[2019-03-07 17:13:48.593] RPC Server Adding address to whitelist: * (rpc-server.c:971)
[2019-03-07 17:13:48.593] RPC Server Adding address to whitelist: * (rpc-server.c:971)
[2019-03-07 17:13:48.593] RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:1213)
[2019-03-07 17:13:48.593] UDP Failed to set receive buffer: requested 4194304, got 425984 (tr-udp.c:84)
[2019-03-07 17:13:48.593] UDP Please add the line "net.core.rmem_max = 4194304" to /etc/sysctl.conf (tr-udp.c:89)
[2019-03-07 17:13:48.594] UDP Failed to set send buffer: requested 1048576, got 425984 (tr-udp.c:95)
[2019-03-07 17:13:48.594] UDP Please add the line "net.core.wmem_max = 1048576" to /etc/sysctl.conf (tr-udp.c:100)
[2019-03-07 17:13:48.594] DHT Reusing old id (tr-dht.c:307)
[2019-03-07 17:13:48.594] DHT Bootstrapping from 82 IPv4 nodes (tr-dht.c:156)
[2019-03-07 17:13:48.594] Using settings from "/config" (daemon.c:528)
[2019-03-07 17:13:48.594] Saved "/config/settings.json" (variant.c:1266)
[2019-03-07 17:13:48.594] Watching "/watch" for new .torrent files (daemon.c:573)
[2019-03-07 17:13:48.594] Loaded 1 torrents (session.c:2034)
[2019-03-07 17:13:48.594] Port Forwarding (NAT-PMP) initnatpmp succeeded (0) (natpmp.c:70)
[2019-03-07 17:13:48.594] Port Forwarding (NAT-PMP) sendpublicaddressrequest succeeded (2) (natpmp.c:70)
[2019-03-07 17:13:56.596] Port Forwarding State changed from "Not forwarded" to "Starting" (port-forwarding.c:92)
[2019-03-07 17:13:56.597] Port Forwarding State changed from "Starting" to "???" (port-forwarding.c:92)
[2019-03-07 17:13:56.597] 586ded46eee14d4b9dcb8d513c2a75a2.mp4 Could not connect to tracker (announcer.c:996)
[2019-03-07 17:13:56.597] 586ded46eee14d4b9dcb8d513c2a75a2.mp4 Retrying announce in 0 seconds. (announcer.c:1005)
[2019-03-07 17:13:56.598] 586ded46eee14d4b9dcb8d513c2a75a2.mp4 Could not connect to tracker (announcer.c:996)
[2019-03-07 17:13:56.598] 586ded46eee14d4b9dcb8d513c2a75a2.mp4 Retrying announce in 20 seconds. (announcer.c:1005)
[2019-03-07 17:13:57.593] Changed open file limit from 1048576 to 1024 (fdlimit.c:380)
[2019-03-07 17:14:17.589] 586ded46eee14d4b9dcb8d513c2a75a2.mp4 Could not connect to tracker (announcer.c:996)
[2019-03-07 17:14:17.591] 586ded46eee14d4b9dcb8d513c2a75a2.mp4 Retrying announce in 336 seconds. (announcer.c:1005)
[2019-03-07 17:19:47.588] Saved "/config/resume/586ded46eee14d4b9dcb8d513c2a75a2.mp4.b6dfff0acc67c7cf.resume" (variant.c:1266)
[2019-03-07 17:19:52.589] 586ded46eee14d4b9dcb8d513c2a75a2.mp4 Could not connect to tracker (announcer.c:996)
[2019-03-07 17:19:52.589] 586ded46eee14d4b9dcb8d513c2a75a2.mp4 Retrying announce in 924 seconds. (announcer.c:1005)

It complains Could not connect to tracker because I also added the host accessible link (http:0.0.0.0:6969/announce)


#3

Hello,
Transmission container says Could not connect to tracker probably because, you are trying to use 6969 in image opentracker. If thats the case, check that both container are on same docker network, assign them static ip (optional) or address them by hostname, then set in config in URL where you specify tracker URL you hostname instead of ip or static assigned ip.

I hope it helps.


#4

In my docker-compose file i’ve defined hostnames for all my containers. Opentracker has hostname: tracker

When I create the torrent I add both host accessible url and internal docker accessible url (htttp://tracker:6969/announce, htttp://0.0.0.0.0:6969/announce)

This way both transmissions (the docker one and the one from my host OS) can access the tracker.

As I side effect docker-transmission will complain it cannot connect to http://0.0.0.0 and host transmission will complain it cannot connect to http//tracker


#5

Where is your “host transmission” located ? In Virtual Machine ? Your PC ? by the way there is : missing in http//tracker.

Based on additional info, you provided, I assume you have transmission on docker and it worked until you connected with your PCs transmission, then your docker complains it can’t connect to tracker and also your hosts transmission ?


#6

I’m running this in my Ubuntu machine. I use docker and transmission gui.

Inside docker I have:

  • flask app where I upload files. These are added to volumes
  • opentracker
  • linuxserver/transmission

Whenever I upload a file to my flask app I will create a torrent for it. I will add the opentracker announce links to this torrent.

linuxserver/transmission uses the same volumes as my flask app and will see the torrent, open it and start seeding immediately. (downloads and watch folders are set to the files volume of flask)

Outside of docker I try to use transmission gui to download the same torrent that is seeded by linuxserver/transmission container.

The torrent receives 2 announce links so that both transmission in docker and transmission in OS will be able to use the tracker. Opentracker sees this two activities but there is no upload from linuxserver/transmission


#7

If download is working, but no upload, then you need to set up port-forwarding for torrent.

  1. I would put your virtual machine network card in bridge mode (so it would be easier to setup)
  2. Set static IP for your virtual machine
  3. Port-forward to your virtual machine ports for transmission (this must be done on youre router)
  4. If you disabled iptables addition for docker you need to manually add routes to iptables on your virtualmachine (no need if you use default settings).

Then it should get better.


#8

Port-forwarding might be a thing. I assume that the port 51413 needs to be managed as this is for the one use for incoming connections.

But should this make a difference? linuxserver/transmission and the transmission gui client are both on the same network, even on the same machine. linuxserver/transmission is running inside docker but i’ve mapped the port outside of docker so it can be accessed from the OS.

I will try keeping the transmission instances on different machines and see if that makes a difference.


#9

Found the issue.

The problem was that I was using two instances of transmission on the same host. Both used the same ports and this caused conflict.

I made another test using two separate machines on the same network. On one I used linuxserver/transmission to seed and on the other I used a torrent client to open the same torrent file. I had to let it run for almost 30 minutes but in the end the file downloaded.

Now I just need to see if I can make the download start faster but other that that transmission works just fine. Sorry for the trouble and thank you for the responses!