navilg / media-stack

A stack of self-hosted tools to manage and stream media. Sonarr + Radarr + qBitTorrent + Prowlarr + Jellyfin + Jellyseerr + VPN
GNU General Public License v3.0
573 stars 92 forks source link

qBittorent/Prowler not connecting to a port, vpn constantly restarting #29

Closed Jazih closed 10 months ago

Jazih commented 10 months ago

I had several issues building this container, most of which I managed to get through. One such issue was that I couldn't specify the static IP addresses for radarr and sonarr due to this error:

Error response from daemon: user specified IP address is supported only when connecting to networks with user configured subnets

I got around this by removing the docker network 'mynetwork' that was set up in the beginning, and reran that command as:

docker network create --gateway 172.21.0.1 --subnet 172.21.0.0/24 mynetwork

Since then the vpn image has been constantly restarting and no ports are listed for qbittorrent and prowlarr when running docker ps -a. I can't access them through browser, whereas all other images like radarr and sonarr are working.

86c3c2cfd6a5   linuxserver/prowlarr:1.8.6              "/init"                 28 seconds ago   Up 20 seconds   prowlarr
 2f3959bc26b3   lscr.io/linuxserver/qbittorrent:4.5.5   "/init"                 28 seconds ago   Up 20 seconds    qbittorrent
ff3eb92e1bb0   qmcgaw/gluetun:v3.35.0                  "/gluetun-entrypoint"   28 seconds ago   Restarting (1) 2 seconds ago   0.0.0.0:5080->5080/tcp, 8000/tcp, 8388/tcp, 0.0.0.0:6881->6881/tcp, 0.0.0.0:9696->9696/tcp, 0.0.0.0:6881->6881/udp, 8888/tcp, 8388/udp   vpn
db0958de6247   linuxserver/sonarr:4.0.0-develop        "/init"                 12 minutes ago   Up 11 minutes        0.0.0.0:8989->8989/tcp     sonarr
e1cd576e3f0a   lscr.io/linuxserver/radarr:5.0.3        "/init"                 12 minutes ago   Up 11 minutes       0.0.0.0:7878->7878/tcp     radarr

Here's my compose file:

version: "3.9"
name: media-stack
services:

  # To use/enable VPN, Run this compose file with --profile=vpn. Its highly recommended to use VPN.
  vpn:
  ## Read https://github.com/qdm12/gluetun/wiki for details on configuring VPN for different service providers.
    profiles: ["vpn"]
    container_name: vpn
    image: qmcgaw/gluetun:v3.35.0
    cap_add:
      - NET_ADMIN
    environment:
      - VPN_SERVICE_PROVIDER=nordvpn # Valid values: nordvpn, expressvpn, protonvpn, surfshark or custom
      #- VPN_TYPE=openvpn
      - OPENVPN_USERNAME=**************
      - OPENVPN_PASSWORD=*************
      #- OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60

      ## For list of server countries, visit https://raw.githubusercontent.com/qdm12/gluetun/master/internal/storage/servers.json

      #- SERVER_COUNTRIES=${SERVER_COUNTRIES:-Switzerland}

      # - FREE_ONLY=on  # Valid with protonvpn only. Value willbe set "on" if using free subscription provided by protonvpn

      ## Enable below if VPN_SERVICE_PROVIDER=custom
      # - VPN_TYPE=openvpn # or wireguard. 

      ## If VPN_TYPE is openvpn
      # - OPENVPN_CUSTOM_CONFIG=/gluetun/custom.conf

      ## If VPN_TYPE is wireguard. Replace below env variables as required.
      # - VPN_ENDPOINT_IP=1.2.3.4                                               # Replace with your wg endpoint ip or domain
      # - VPN_ENDPOINT_PORT=51820                                               # Replace with wg server port
      # - WIREGUARD_PUBLIC_KEY=wAUaJMhAq3NFutLHIdF8AN0B5WG8RndfQKLPTEDHal0=     # Replace with your wg public key
      # - WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU=    # Replace with your wg client private key
      # - WIREGUARD_PRESHARED_KEY=xOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU=  # Replaced with your wg pre-shared key
      # - WIREGUARD_ADDRESSES="10.64.222.21/32"                                 # Replace with wg address

    ## Enable volume if VPN_SERVICE_PROVIDER=custom and VPN_TYPE=openvpn is used
    # volumes:
      # - /yourpath/yourconfig.conf:/gluetun/config.conf:ro

    networks:
      - mynetwork

    # Uncomment/enable below ports if VPN is used/enabled
    ports:
       # qbittorrent ports
       - 5080:5080
       - 6881:6881
       - 6881:6881/udp
       # prowlarr ports
       - 9696:9696
    restart: "unless-stopped"

  ## Default credentials of qBittorrent - Username: admin password: adminadmin ##
  ## Change password after install from UI --> Tools --> Options --> WebUI ##
  qbittorrent:
    container_name: qbittorrent
    image: lscr.io/linuxserver/qbittorrent:4.5.5

    # Unomment below if vpn is enabled
    depends_on:               # Uncomment this line if vpn is enabled
      - vpn                   # Uncomment this line if vpn is enabled

    # Comment below lines if VPN is enabled
    #networks:               # Comment this line if vpn is enabled
    #  - mynetwork           # Comment this line if vpn is enabled

    # Unomment below line if vpn is enabled
    network_mode: service:vpn

    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - WEBUI_PORT=5080
    volumes:
      - qbittorrent-config:/config
      - torrent-downloads:/downloads

    ## Comment/Disable below ports if VPN is enabled
    #ports:
    #  - 5080:5080
    #  - 6881:6881
    #  - 6881:6881/udp
    restart: "unless-stopped"

  radarr:
    container_name: radarr
    image: lscr.io/linuxserver/radarr:5.0.3
    networks:
    #  - mynetwork   # Comment this line if VPN is enabled
    ## Uncomment below lines if VPN is enabled
      mynetwork:
        ipv4_address: 172.21.0.2 # It should be available IPv4 address in range of docker network `mynetwork` e.g. 172.20.0.2
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    ports:
      - 7878:7878
    volumes:
      - radarr-config:/config
      - torrent-downloads:/downloads
    restart: "unless-stopped"

  sonarr:
    image: linuxserver/sonarr:4.0.0-develop
    container_name: sonarr
    networks:
    #  - mynetwork   # Comment this line if VPN is enabled
    ## Uncomment below lines if VPN is enabled
      mynetwork:
        ipv4_address: 172.21.0.4 # It should be available IPv4 address in range of docker network `mynetwork` e.g. 172.20.0.2
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    volumes:
      - sonarr-config:/config
      - torrent-downloads:/downloads
    ports:
      - 8989:8989
    restart: unless-stopped

  prowlarr:
    container_name: prowlarr
    image: linuxserver/prowlarr:1.8.6

    # Uncomment below if vpn is enabled
    depends_on:               # Uncomment this line if vpn is enabled
       - vpn                   # Uncomment this line if vpn is enabled
    network_mode: service:vpn # Uncomment this line if vpn is enabled

    #networks:               # Comment this line if vpn is enabled
    #  - mynetwork           # Comment this line if vpn is enabled
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    volumes:
      - prowlarr-config:/config

    # Comment below ports if VPN is enabled.
    #ports:
    #  - 9696:9696
    restart: unless-stopped

  #jellyfin:
   # image: linuxserver/jellyfin:10.8.11
  # container_name: jellyfin
   # networks:
    #  - mynetwork
    #environment:
    #  - PUID=1000
     # - PGID=1000
      #- TZ=UTC
    #volumes:
     # - jellyfin-config:/config
      #- torrent-downloads:/data
  # devices:
   #  - /dev/videoN:/dev/videoN # Mount GPU device 
    #ports:
    #  - 8096:8096
     # - 7359:7359/udp
      #- 8920:8920
   # restart: unless-stopped

  # Doc: https://github.com/navilg/cleanmyarr
  # cleanmyarr:
  #   depends_on:
  #     - radarr
  #     - sonarr
  #   image: linuxshots/cleanmyarr:0.8.1
  #   container_name: cleanmyarr
  #   networks:
  #     - mynetwork
  #   volumes:
  #     - cleanmyarr-config:/config
    # restart: unless-stopped
    # environment:
    # - CMA_MAINTENANCE_CYCLE=${CMA_MAINTENANCE_CYCLE:-""}
    # - CMA_DELETE_AFTER_DAYS=${CMA_DELETE_AFTER_DAYS:-""}
    # - CMA_ENABLE_EMAIL_NOTIFICATION=${CMA_ENABLE_EMAIL_NOTIFICATION:-""}
    # - CMA_SMTP_USERNAME=${CMA_SMTP_USERNAME:-""}
    # - CMA_SMTP_ENCODED_PASSWORD=${CMA_SMTP_ENCODED_PASSWORD:-""}
    # - CMA_SMTP_TO_EMAILS=${CMA_SMTP_TO_EMAILS:-""}
    # - CMA_ENABLE_GOTIFY_NOTIFICATION=${CMA_ENABLE_GOTIFY_NOTIFICATION:-""}
    # - CMA_GOTIFY_URL=${CMA_GOTIFY_URL:-""}
    # - CMA_GOTIFY_ENCODED_APP_TOKEN=${CMA_GOTIFY_ENCODED_APP_TOKEN:-""}
    # - CMA_ENABLE_TELEGRAM_NOTIFICATION=${CMA_ENABLE_TELEGRAM_NOTIFICATION:-""}
    # - CMA_TELEGRAM_ENCODED_BOT_TOKEN=${CMA_TELEGRAM_ENCODED_BOT_TOKEN:-""}
    # - CMA_TELEGRAM_CHAT_ID=${CMA_TELEGRAM_CHAT_ID:-""}
    # - CMA_MONITOR_RADARR=${CMA_MONITOR_RADARR:-""}
    # - CMA_RADARR_URL=${CMA_RADARR_URL:-""}
    # - CMA_RADARR_ENCODED_API_KEY=${CMA_RADARR_ENCODED_API_KEY:-""}
    # - CMA_RADARR_ENABLE_NOTIFICATION=${CMA_RADARR_ENABLE_NOTIFICATION:-""}

volumes:
  torrent-downloads:
  radarr-config:
  sonarr-config:
  prowlarr-config:
  #jellyfin-config:
  qbittorrent-config:
  # cleanmyarr-config:

networks:
  mynetwork:
    external: true

Not sure what I've done wrong here, but any pointers would be great, thanks!

navilg commented 10 months ago

Can you share the vpn container logs ? (Make sure to redact any IP address and any sensitive info if visible in logs) What is the version of docker and docker compose you are using ?

Jazih commented 10 months ago

I'm using docker version 20.10.5 and docker compose version 2.21.0

I found the issue in the vpn log, it seems I copied over the environment variable OPENVPN_USER as OPENVPN_USERNAME which was throwing OpenVPN off. Thanks!