navilg / media-stack

A stack of self-hosted tools to manage and stream media. Sonarr + Radarr + qBitTorrent + Prowlarr + Jellyfin + Jellyseerr + VPN
MIT License
516 stars 83 forks source link

[QUERY] Getting Deployment error failed to deploy a stack: no such service: vpn #37

Closed ivanricsan closed 5 months ago

ivanricsan commented 5 months ago

First of all, for sure I am doing something wrong as this is my first time with Docker.

I am using portainer and following the Readme in this repo, adding the compose yaml. I am using a VPN and setup as explained in the yaml file.

I created a network but called it media_stack and replaced all mynetwork on the doc with media_stack.

When I try to deploy the stack, I get:

Deployment error failed to deploy a stack: no such service: vpn

Could anyone help me diagnose what is wrong?

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.36.0 cap_add: - NET_ADMIN environment: - VPN_SERVICE_PROVIDER=${VPN_SERVICE_PROVIDER:-nordvpn} # Valid values: nordvpn, expressvpn, protonvpn, surfshark or custom - OPENVPN_USER=${OPENVPN_USER:-"XXXXXXXXXXXXXXX"} - OPENVPN_PASSWORD=${OPENVPN_PASSWORD:-"XXXXXXXXXXXXXXX"} ## For list of server countries, visit https://raw.fgithubusercontent.com/qdm12/gluetun/master/internal/storage/servers.json ## When VPN_SERVICE_PROVIDER is custom. Comment the below line - SERVER_COUNTRIES=${SERVER_COUNTRIES:-France} # - 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: - media_stack # 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.6.2 # 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=Europe/Madrid - 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.2.6 networks: # - mynetwork # Comment this line if VPN is enabled ## Uncomment below lines if VPN is enabled media_stack: ipv4_address: ${RADARR_STATIC_CONTAINER_IP} # It should be available IPv4 address in range of docker network `mynetwork` e.g. 172.20.0.2 environment: - PUID=1000 - PGID=1000 - TZ=Europe/Madrid 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 media_stack: ipv4_address: ${SONARR_STATIC_CONTAINER_IP} # It should be available IPv4 address in range of docker network `mynetwork` e.g. 172.20.0.2 environment: - PUID=1000 - PGID=1000 - TZ=Europe/Madrid volumes: - sonarr-config:/config - torrent-downloads:/downloads ports: - 8989:8989 restart: unless-stopped prowlarr: container_name: prowlarr image: linuxserver/prowlarr:1.11.4 # 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=Europe/Madrid volumes: - prowlarr-config:/config # Comment below ports if VPN is enabled. # ports: # - 9696:9696 restart: unless-stopped jellyfin: image: linuxserver/jellyfin:10.8.13 container_name: jellyfin networks: - media_stack environment: - PUID=1000 - PGID=1000 - TZ=Europe/Madrid 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: media_stack: external: true ```

navilg commented 5 months ago

Are you using vpn profile ? If yes how are you setting this ?

When deploying it with docker-compose it is used with --profiles. But with portainer, You need to create a variable COMPOSE_PROFILES=vpn.

This docker compose file is written to be used with vpn by default. If you don't want to use it with vpn, You will need to update docker compose as guided in comment messages in docker-compose.yml file.

ivanricsan commented 5 months ago

Yes, I want to use a VPN. I am setting everything up as the compose file says. Commenting and un commenting the lines it mentions, nothing less and nothing more.

I will try the variable you mention but I thought that if in the compose it specified

Profiles: ["vpn"] it was equivalent.

I pasted the compose file on my original comment, you mind having a quick look and letting me know if anything looks out of place?

navilg commented 5 months ago

When a service has profile :["vpn"] it will only be created when profile is provided during deployment. Try above variable to use vpn profile. It should work. compose file looks good.

ivanricsan commented 5 months ago

COMPOSE_PROFILES=vpn

This fixed the issue above, thank you.

I am now getting:

Container vpn Started Error response from daemon: user specified IP address is supported only when connecting to networks with user configured subnet

Which i believe is because of the network created.

ivanricsan commented 5 months ago

EDIT: I see you have updated the readme to:

docker network create --subnet 172.20.0.0/16 mynetwork

Will try to create my network the same way in portainer

ivanricsan commented 5 months ago

Sorted, thank you