PSA + fix: VyprVPN users get a gluetun crash loop that takes the whole media stack down — sparkbox hardcodes SERVER_COUNTRIES for every non-custom provider
Posted by d4xe
This is lot of AI "slop" but really had this issue, so if a fix is possible that would be greatly appreciated TL;DR: If you're on VyprVPN and your media stack is dead after updating, sb-gluetun is crash-looping because the sparkbox script injects SERVERCOUNTRIES="United States" when you leave the country field blank. Gluetun has zero country data for VyprVPN, so it rejects it and exits. One-line fix at the bottom. Spent a while chasing this today, posting in case it saves someone else the trouble. Symptom: everything media-related is unreachable — qBit, Sonarr, Radarr, Prowlarr all dead. Jellyfin and Seerr still work fine, which is confusing at first. sudo docker logs sb-gluetun shows this on loop, roughly once a minute: ERROR VPN settings: provider settings: server selection: for VPN service provider vyprvpn: the country specified is not valid: one or more values is set but there is no possible value available INFO Shutdown successful The cause. In /opt/sparkbox/sparkbox around line 1037: if [[ "${vpnprov}" == "custom" ]]; then export SERVERCOUNTRIES="" SERVERCITIES="" SERVERHOSTNAMES="" SERVERREGIONS="" elif [[ -z "${srvtrimmed}" ]]; then export SERVERCOUNTRIES="United States" else export SERVERCOUNTRIES="${srvraw}" fi Leave the VPN Server Country field blank — which is what you're supposed to do on VyprVPN — and the script hardcodes "United States" for every provider except custom. Gluetun's VyprVPN integration only supports SERVERREGIONS and SERVERHOSTNAMES; it has no country list at all, so any value fails. The nasty part: your .env is empty and correct. Nothing in the dashboard shows a country set anywhere. The bad value is injected purely by the script at runtime, so there's nothing to find in the UI. Two things that made this way harder than it needed to be: A crash-looping container renders in the dashboard with a Resume button and -- for CPU/RAM — which looks exactly like a paused container. I wasted time trying to unpause something that was never paused. docker unpause just tells you "container is not paused." sparkbox status showed qBittorrent, Sonarr, Radarr, Prowlarr, SABnzbd and FlareSolverr all as Up 12 hours (healthy) while every one of them was completely unreachable. They share gluetun's network namespace and their ports are published by gluetun, so when it dies they're stranded but still report healthy. Check gluetun first, not the app that looks broken. The fix — makes the fallback provider-aware, leaves every other provider's behaviour unchanged: sudo cp -a /opt/sparkbox/sparkbox /opt/sparkbox/sparkbox.bak-$(date +%F) sudo sed -i -E 's|^([[:space:]])export SERVERCOUNTRIES="United States"$|\1if [[ "${vpnprov}" == "vyprvpn" ]]; then export SERVERCOUNTRIES="" SERVERCITIES=""; else export SERVERCOUNTRIES="United States"; fi|' /opt/sparkbox/sparkbox bash -n /opt/sparkbox/sparkbox && echo "syntax OK" sudo sparkbox restart media Then confirm the tunnel actually came up — this must NOT be your home IP: sudo docker exec sb-gluetun wget -qO- ipinfo.io Heads up: updates overwrite this file, so it'll come back. Mine had been patched before and v1.6.496 reverted it. If your VPN dies right after an update, check here first. Reporting it upstream so it hopefully gets fixed properly.