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

mutually exclusive `network_mode` and `networks` error #16

Closed mbkoper closed 1 year ago

mbkoper commented 1 year ago

When running docker compose --profile stack-2 up -d it shows an error: service qbittorrent declares mutually exclusive 'network_mode' and 'networks': invalid compose project

docker version: 23.0.5 docker compose version: v2.17.3

I used the latest code (commit fd6ca8f)

hersch-eckerd commented 1 year ago

I'm running into the same issue with docker-desktop. Docker v23.0.5 .

If I run it multiple times, it will show the same error for prowlarr and qbittorrent, but not at the same time.

service qbittorrent declares mutually exclusive 'network_mode' and 'networks': invalid compose project service prowlarr declares mutually exclusive network_mode and networks: invalid compose project

EDIT:

I didn't see the first line docker network create mynetwork

After running that, it seems works properly. my bad!

Ard3ny commented 1 year ago

I did run the docker network create mynetwork and I still got the error.

What fixed it for me was manually commenting out the network_mode line under qbittorent and prowlarr as it states in the comment in the docker-compose.yml file.

From: "network_mode: service:vpn # Uncomment this line if vpn is enabled "

To: "# network_mode: service:vpn # Uncomment this line if vpn is enabled"

navilg commented 1 year ago

@Ard3ny If vpn is not being used, in that case network_mode should be commented. VPN is strongly recommended.

navilg commented 1 year ago

@mbkoper is network named mynetwork created ? Are you using vpn service ? Can you try what @hersch-eckerd tried and let me know

mbkoper commented 1 year ago

@navilg I did create the network before starting the VPN profile. See the attached screenshot. I am running on a Debian Linux machine. image

I also tried on a windows machine with Docker installed and get the same error. image

Ard3ny commented 1 year ago

@mbkoper As I've mentioned above, go to the docker-compose.yml file and edit out the network_mode lines in qbittorent and prowlarr

From: "network_mode: service:vpn # Uncomment this line if vpn is enabled "

To: "# network_mode: service:vpn # Uncomment this line if vpn is enabled"

ksejan commented 1 year ago

Hello, i have that line uncommented, I'm trying to install the stack1 configuration without any vpn since i don't have one but i keep getting the same error message, i have the mynetwork created and also docker version: 24.0.1 and docker compose version: 2.18.1. Please Help. image image

Ard3ny commented 1 year ago

I'm guessing you only did it once. You have to do it 2 times. One for bittorent section and one for prowlarr section in the config.

If that's not the case please post the whole config file.

ksejan commented 1 year ago

Sorry for the long time in getting back in advance. Ok, changed my mind and now want to use protonvpn with its free servers, adapted the config file for the vpn but still the same problem presists, tried it on diferrent servers and nothing changed. Here is the full config:

version: "3.9"
name: media-stack
services:
  vpn:
  ## Read https://github.com/qdm12/gluetun/wiki for details on configuring VPN for different service providers.
    profiles: ["vpn", "stack-2"]
    container_name: vpn
    image: qmcgaw/gluetun:v3.33
    cap_add:
      - NET_ADMIN
    environment:
      - VPN_SERVICE_PROVIDER=${VPN_SERVICE_PROVIDER:-protonvpn} # Valid values: nordvpn, expressvpn, protonvpn, surfshark or custom
      - OPENVPN_USER=${OPENVPN_USER:-"D8EyIRfcjiAlmWcK"}
      - OPENVPN_PASSWORD=${OPENVPN_PASSWORD:-"dCi1eAFPjhNCrkXZaCdjjwDWljRUJDhl"}

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

      ## SERVER_REGIONS is required for NordVPN and Surfshark VPN. Comment SERVER_COUNTRIES if SERVER_REGIONS is used.
      #- SERVER_REGIONS=${SERVER_REGIONS:-Switzerland}

      ## SERVER_COUNTRIES is required for ExpressVPN and ProtonVPN. Comment SERVER_REGIONS if SERVER_COUNTRIES is used.
      - SERVER_COUNTRIES=${SERVER_COUNTRIES:-Netherlands}
      - FREE_ONLY=on  # Valid with protonvpn only. on if using free service 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 custom VPN_SERVICE_PROVIDER is used
    # volumes:
      # - /yourpath/yourconfig.conf:/gluetun/config.conf:ro

    networks:
      - mynetwork
    ports:
      # qbittorrent ports
      - 5080:5080
      - 6881:6881
      - 6881:6881/udp
      # prowlarr ports
      - 9696:9696
      # Transmission ports. Uncomment below if Transmission is used with VPN
      - 9091:9091
      - 51413:51413
      - 51413:51413/udp
    restart: "unless-stopped"
  transmission:
    profiles: ["tx", "stack-1"]
    container_name: transmission
    image: linuxserver/transmission:4.0.3
    networks:
      - mynetwork
    network_mode: service:vpn # Uncomment this line if vpn is enabled
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - USER=admin
      - PASS=nimdatx

    ## Comment below ports if VPN is enabled.
   # ports:
    #  - 9091:9091
     # - 51413:51413
     # - 51413:51413/udp
    volumes:
      - tx-config:/config
      - torrent-downloads:/downloads
      - tx-watch:/watch
    restart: "unless-stopped"

  ## Default credentials - Username: admin password: adminadmin ##
  ## Change password after install from UI --> Tools --> Options --> WebUI ##
  qbittorrent:
    container_name: qbittorrent
    profiles: ["qbt", "stack-2"]
    image: linuxserver/qbittorrent:4.5.2
    # Comment this if vpn is disabled
    depends_on:
      - vpn
    networks:
      - mynetwork
    network_mode: service:vpn # Comment this line if vpn is disabled
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - WEBUI_PORT=5080
    volumes:
      - qbittorrent-config:/config
      - torrent-downloads:/downloads

    ## Uncomment below ports if VPN is disabled.
    # ports:
    #   - 5080:5080
    #   - 6881:6881
    #   - 6881:6881/udp
    restart: "unless-stopped"
  radarr:
    profiles: ["base", "radarr", "stack-1", "stack-2"]
    container_name: radarr
    image: linuxserver/radarr:4.4.4
    networks:
      - mynetwork
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    ports:
      - 7878:7878
    volumes:
      - radarr-config:/config
      - torrent-downloads:/downloads
    restart: "unless-stopped"

  sonarr:
    profiles: ["base", "sonarr", "stack-1", "stack-2"]
    image: linuxserver/sonarr:4.0.0-develop
    container_name: sonarr
    networks:
      - mynetwork
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    volumes:
      - sonarr-config:/config
      - torrent-downloads:/downloads
    ports:
      - 8989:8989
    restart: unless-stopped

  jackett:
    profiles: ["jackett", "stack-1"]
    container_name: jackett
    image: linuxserver/jackett:0.20.4078
    networks:
      - mynetwork
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    volumes:
      - jackett-config:/config
      - jackett-blackhole:/downloads
    ports:
      - 9117:9117
    restart: unless-stopped

  prowlarr:
    profiles: ["prowlarr", "stack-2"]
    container_name: prowlarr
    image: linuxserver/prowlarr:1.4.1-develop
    # Comment this if vpn is disabled
    depends_on:
      - vpn
    network_mode: service:vpn # Comment this line if vpn is disabled
    networks:
      - mynetwork
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    volumes:
      - prowlarr-config:/config
    ## Uncomment below ports if VPN is disabled.
    # ports:
    #   - 9696:9696
    restart: unless-stopped

  jellyfin:
    profiles: ["base", "jelly", "stack-1", "stack-2"]
    image: linuxserver/jellyfin:10.8.10
    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

  # cleanmyarr:
  #   depends_on:
  #     - radarr
  #     - sonarr
  #   profiles: ["base", "cleanmyarr", "stack-2"]
  #   image: linuxshots/cleanmyarr:0.4.1-beta
  #   container_name: cleanmyarr
  #   networks:
  #     - mynetwork
  #   volumes:
  #     - cleanmyarr-config:/config
  #   restart: unless-stopped

volumes:
  torrent-downloads: #/root/media-stack/torrent-downloads
  radarr-config: #/root/media-stack/radarr-config
  sonarr-config: #/root/media-stack/sonarr-config
  jackett-config: #/root/media-stack/jackett-config
  jackett-blackhole: #/root/media-stack/jackett-blackhole
  prowlarr-config: #/root/media-stack/prowlarr-config
  jellyfin-config: #/root/media-stack/jellyfin-config
  qbittorrent-config: #/root/media-stack/qbittorrent-config
  tx-config: #/root/media-stack/tx-config
  tx-watch: #/root/media-stack/tx-watch

networks:
  mynetwork:
    external: true

image

Wizard-Ex-Machina commented 1 year ago

I have the same issue while trying to use stack 2 with a vpn my compose file is as follows does anyone know how to fix it

services:
  vpn:
    ## Read https://github.com/qdm12/gluetun/wiki for details on configuring VPN for different service providers.
    profiles: [ "vpn", "stack-2" ]
    container_name: vpn
    image: qmcgaw/gluetun:v3.33
    environment:
      - VPN_SERVICE_PROVIDER=mullvad
      - VPN_TYPE=openvpn
      - OPENVPN_USER=xxxxxxxxxxxxxxxxx
      - SERVER_CITIES=manchester

    networks:
      - mynetwork
    ports:
      # qbittorrent ports
      - 5080:5080
      - 6881:6881
      - 6881:6881/udp
      # prowlarr ports
      - 9696:9696
      # Transmission ports. Uncomment below if Transmission is used with VPN
      # - 9091:9091
      # - 51413:51413
      # - 51413:51413/udp
    restart: "unless-stopped"

  ## Default credentials - Username: admin password: adminadmin ##
  ## Change password after install from UI --> Tools --> Options --> WebUI ##
  qbittorrent:
    container_name: qbittorrent
    profiles: [ "qbt", "stack-2" ]
    image: linuxserver/qbittorrent:4.5.2
    # Comment this if vpn is disabled
    depends_on:
      - vpn
    networks:
      - mynetwork
    network_mode: service:vpn # Comment this line if vpn is disabled
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - WEBUI_PORT=5080
    volumes:
      - qbittorrent-config:/config
      - torrent-downloads:/downloads

    ## Uncomment below ports if VPN is disabled.
    # ports:
    #   - 5080:5080
    #   - 6881:6881
    #   - 6881:6881/udp
    restart: "unless-stopped"
  radarr:
    profiles: [ "base", "radarr", "stack-1", "stack-2" ]
    container_name: radarr
    image: linuxserver/radarr:4.4.4
    networks:
      - mynetwork
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    ports:
      - 7878:7878
    volumes:
      - radarr-config:/config
      - torrent-downloads:/downloads
    restart: "unless-stopped"

  sonarr:
    profiles: [ "base", "sonarr", "stack-1", "stack-2" ]
    image: linuxserver/sonarr:4.0.0-develop
    container_name: sonarr
    networks:
      - mynetwork
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    volumes:
      - sonarr-config:/config
      - torrent-downloads:/downloads
    ports:
      - 8989:8989
    restart: unless-stopped

  prowlarr:
    profiles: [ "prowlarr", "stack-2" ]
    container_name: prowlarr
    image: linuxserver/prowlarr:1.4.1-develop
    # Comment this if vpn is disabled
    depends_on:
      - vpn
    network_mode: service:vpn # Comment this line if vpn is disabled
    networks:
      - mynetwork
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
    volumes:
      - prowlarr-config:/config
    ## Uncomment below ports if VPN is disabled.
    # ports:
    #   - 9696:9696
    restart: unless-stopped

  jellyfin:
    profiles: [ "base", "jelly", "stack-1", "stack-2" ]
    image: linuxserver/jellyfin:10.8.10
    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
  # cleanmyarr:
  #   depends_on:
  #     - radarr
  #     - sonarr
  #   profiles: ["base", "cleanmyarr", "stack-2"]
  #   image: linuxshots/cleanmyarr:0.4.1-beta
  #   container_name: cleanmyarr
  #   networks:
  #     - mynetwork
  #   volumes:
  #     - cleanmyarr-config:/config
  #   restart: unless-stopped

volumes:
  torrent-downloads:
  radarr-config:
  sonarr-config:
  prowlarr-config:
  jellyfin-config:
  qbittorrent-config:
  tx-config:
  tx-watch:

networks:
  mynetwork:
    external: true