haugene / docker-transmission-openvpn

Docker container running Transmission torrent client with WebUI over an OpenVPN tunnel
GNU General Public License v3.0
4.17k stars 1.21k forks source link

Does Not Download Newly Added Torrents Unless Container Restarted First #1710

Closed LarsaSolidor closed 3 years ago

LarsaSolidor commented 3 years ago

Before creating this issue I have:

Describe the problem

When new torrents are added to transmission, they do not download until the container is restarted. They begin downloading immediately after a container restart.

Add your docker run command or docker-compose file

  transmission-vpn:
    container_name: transmission-vpn
    image: haugene/transmission-openvpn:latest
    restart: always
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    restart: always
    ports:
      - "10005:9091"
      - "10015:8888"
    dns:
      - 209.222.18.222
      - 209.222.18.218
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DATASTOREDIR}/transmission/transmission-vpn:/data
      - ${MEDIADIR}/Downloads/Completed:/data/completed
      - ${MEDIADIR}/Downloads/Incomplete:/data/incomplete
    healthcheck:
      start_period: "10s"
      interval: "5s"
    env_file:
      - .env
    networks:
      - traefik_proxy
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.transmission-router.entrypoints=websecure"
      - "traefik.http.routers.transmission-router.rule=Host(`transmission.${DOMAINNAME}`)"
      - "traefik.http.routers.transmission-router.tls=true"
      - "traefik.http.routers.transmission-router.middlewares=chain-no-auth@file"
      - "traefik.http.routers.transmission-router.service=transmission-svc"
      - "traefik.http.services.transmission-svc.loadbalancer.server.port=9091"

Logs

Starting container with revision: f13eb3e908521a5d0f7a51e965fd5ad028e4ab49
One or more OVERRIDE_DNS addresses found. Will use them to overwrite /etc/resolv.conf
Creating TUN device /dev/net/tun
mknod: /dev/net/tun: File exists
Using OpenVPN provider: PIA
Provider PIA has a custom setup script, executing it
Downloading OpenVPN config bundle openvpn-tcp into temporary file /tmp/tmp.NekkNL
Extract OpenVPN config bundle into PIA directory /etc/openvpn/pia
No VPN configuration provided. Using default.
Modifying /etc/openvpn/pia/default.ovpn for best behaviour in this container
Setting OpenVPN credentials...
adding route to local network 174.24.24.0/24 via 172.24.24.1 dev eth0
adding route to local network 192.168.0.0/24 via 172.24.24.1 dev eth0
2021-02-09 17:41:03 DEPRECATED OPTION: --cipher set to 'aes-128-cbc' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM). Future OpenVPN version will ignore --cipher for cipher negotiations. Add 'aes-128-cbc' to --data-ciphers or change --cipher 'aes-128-cbc' to --data-ciphers-fallback 'aes-128-cbc' to silence this warning.
2021-02-09 17:41:03 OpenVPN 2.5.0 x86_64-alpine-linux-musl [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Dec 26 2020
2021-02-09 17:41:03 library versions: OpenSSL 1.1.1i  8 Dec 2020, LZO 2.10
2021-02-09 17:41:03 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
2021-02-09 17:41:03 CRL: loaded 1 CRLs from file -----BEGIN X509 CRL-----
***
-----END X509 CRL-----

2021-02-09 17:41:03 TCP/UDP: Preserving recently used remote address: [AF_INET]**.**.**.**:502
2021-02-09 17:41:03 Attempting to establish TCP connection with [AF_INET]**.**.**.**:502 [nonblock]
2021-02-09 17:41:03 TCP connection established with [AF_INET]**.**.**.**:502
2021-02-09 17:41:03 TCP_CLIENT link local: (not bound)
2021-02-09 17:41:03 TCP_CLIENT link remote: [AF_INET]**.**.**.**:502
2021-02-09 17:41:03 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
2021-02-09 17:41:04 [oslo401] Peer Connection Initiated with [AF_INET]**.**.**.**:502
2021-02-09 17:41:05 sitnl_send: rtnl: generic error (-101): Network unreachable
2021-02-09 17:41:05 TUN/TAP device tun0 opened
2021-02-09 17:41:05 /sbin/ip link set dev tun0 up mtu 1500
2021-02-09 17:41:05 /sbin/ip link set dev tun0 up
2021-02-09 17:41:05 /sbin/ip addr add dev tun0 10.18.111.19/24
2021-02-09 17:41:05 /etc/openvpn/tunnelUp.sh tun0 1500 1555 10.18.111.19 255.255.255.0 init
Up script executed with tun0 1500 1555 10.18.111.19 255.255.255.0 init
Updating TRANSMISSION_BIND_ADDRESS_IPV4 to the ip of tun0 : 10.18.111.19
Using Transmission Web Control  UI, overriding TRANSMISSION_WEB_HOME
Updating Transmission settings.json with values from env variables
Using existing settings.json for Transmission /data/transmission-home/settings.json
Overriding alt-speed-down because TRANSMISSION_ALT_SPEED_DOWN is set to 5000
Overriding alt-speed-time-begin because TRANSMISSION_ALT_SPEED_TIME_BEGIN is set to 540
Overriding alt-speed-time-day because TRANSMISSION_ALT_SPEED_TIME_DAY is set to 127
Overriding alt-speed-time-enabled because TRANSMISSION_ALT_SPEED_TIME_ENABLED is set to true
Overriding alt-speed-time-end because TRANSMISSION_ALT_SPEED_TIME_END is set to 1410
Overriding alt-speed-up because TRANSMISSION_ALT_SPEED_UP is set to 1500
Overriding bind-address-ipv4 because TRANSMISSION_BIND_ADDRESS_IPV4 is set to 10.18.111.19
Overriding download-dir because TRANSMISSION_DOWNLOAD_DIR is set to /data/completed
Overriding download-queue-enabled because TRANSMISSION_DOWNLOAD_QUEUE_ENABLED is set to false
Overriding encryption because TRANSMISSION_ENCRYPTION is set to 1
Overriding incomplete-dir because TRANSMISSION_INCOMPLETE_DIR is set to /data/incomplete
Overriding peer-limit-global because TRANSMISSION_PEER_LIMIT_GLOBAL is set to 480
Overriding port-forwarding-enabled because TRANSMISSION_PORT_FORWARDING_ENABLED is set to true
Overriding ratio-limit because TRANSMISSION_RATIO_LIMIT is set to 3
Overriding ratio-limit-enabled because TRANSMISSION_RATIO_LIMIT_ENABLED is set to true
Overriding rpc-authentication-required because TRANSMISSION_RPC_AUTHENTICATION_REQUIRED is set to true
Overriding rpc-enabled because TRANSMISSION_RPC_ENABLED is set to true
Overriding rpc-password because TRANSMISSION_RPC_PASSWORD is set to [REDACTED]
Overriding rpc-port because TRANSMISSION_RPC_PORT is set to 9091
Overriding rpc-username because TRANSMISSION_RPC_USERNAME is set to transmission
Overriding rpc-whitelist because TRANSMISSION_RPC_WHITELIST is set to 127.0.0.*,192.168.0.*,172.24.24.*
Overriding rpc-whitelist-enabled because TRANSMISSION_RPC_WHITELIST_ENABLED is set to true
Overriding scrape-paused-torrents-enabled because TRANSMISSION_SCRAPE_PAUSED_TORRENTS_ENABLED is set to false
Overriding speed-limit-down because TRANSMISSION_SPEED_LIMIT_DOWN is set to 8000
Overriding speed-limit-down-enabled because TRANSMISSION_SPEED_LIMIT_DOWN_ENABLED is set to true
Overriding speed-limit-up because TRANSMISSION_SPEED_LIMIT_UP is set to 1900
Overriding speed-limit-up-enabled because TRANSMISSION_SPEED_LIMIT_UP_ENABLED is set to true
Overriding umask because TRANSMISSION_UMASK is set to 777
Overriding watch-dir because TRANSMISSION_WATCH_DIR is set to /data/watch
sed'ing True to true
Enforcing ownership on transmission config directories
Applying permissions to transmission config directories
Setting owner for transmission paths to 1000:1000
Setting permission for files (644) and directories (755)
Setting permission for watch directory (775) and its files (664)

-------------------------------------
Transmission will run as
-------------------------------------
User name:   abc
User uid:    1000
User gid:    1000
-------------------------------------

STARTING TRANSMISSION
Transmission startup script complete.
STARTING TINYPROXY
Found config file /etc/tinyproxy/tinyproxy.conf, updating settings.
Setting tinyproxy port to 8888
tinyproxy is on the PATH, run it
WARNING: logging deactivated (can't log to stdout when daemonized)
Tinyproxy startup script complete.
2021-02-09 17:41:05 WARNING: OpenVPN was configured to add an IPv6 route. However, no IPv6 has been configured for tun0, therefore the route installation may fail or may not work as expected.
2021-02-09 17:41:05 add_route_ipv6(2000::/3 -> :: metric -1) dev tun0
RTNETLINK answers: Permission denied
2021-02-09 17:41:05 ERROR: Linux route -6 add command failed: external program exited with error status: 2
2021-02-09 17:41:05 Initialization Sequence Completed

Host system:

Ubuntu 20.04.1 LTS Docker version 20.10.3, build 48d30b5
pkishino commented 3 years ago

check #1355 , think this might help

LarsaSolidor commented 3 years ago

check #1355 , think this might help

The --sysctl net.ipv6.conf.all.disable_ipv6=0 fix suggested in #1355 hasn't resolved the issue.

CurtC2 commented 3 years ago

Likely this is the same issue that has been plaguing transmission-vpn on PIA since the fall where no trackers can be contacted after initial container creation/start. Can replicate at will and I am not experiencing the ipv6 route add permission denied result on my environment:

dc stop transmission-vpn dc up -d transmission-vpn [All scrape attempts to http and udp trackers will with 'cannot connect', indefinitely] dc restart transmission-vpn [trackers immediately scrape, voila. Until next time]

Of course this was all recently exacerbated by #1725, back to above after the fix w/adding --dhcp-option DNS 8.8.8.8 to the OPENVPN_OPTS documented there.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

CurtC2 commented 3 years ago

Still an issue. Every time my containers update themselves, I have to issue a docker-compose restart on transmission-vpn to get DNS resolution working.

andreixk commented 3 years ago

still an issue

pkishino commented 3 years ago

is this still an issue with the dev branch? dev is based on ubuntu and has fixed a few dns issues..

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

CurtC2 commented 3 years ago

Looks like dev has gone to latest now. I just did some testing and my recreate from above now works fine - no longer requiring a restart for UDP trackers to work. Seems fixed from what I can tell.

nowkillkennys commented 1 year ago

same issue here