gluetun: Bug: QBittorrent loses internet connectivity after running for some time
Is this urgent?
None
Host OS
Latest version of OpenMediaVault
CPU arch
x86_64
VPN service provider
Mullvad
What are you using to run the container
docker-compose
What is the version of Gluetun
I donβt see this line in my logs
Whatβs the problem π€
I recently switched from using an old deprecated docker container for qBittorrent with OVPN support built in. I am now running the latest qBittorrent docker from linuxserver along with gluetun using Mullvad/Wireguard. My issue is that qBittorrent will connect to torrents and work just fine for awhile but it will eventually become unable to connect to any peers. I do not know if this is a qBittorrent issue or a gluetun issue. Restarting the qBittorrent container solves the issue temporarily.
Share your logs
| βββ VPN provider settings:
| | βββ Name: mullvad
| | βββ Server selection settings:
| | βββ VPN type: wireguard
| | βββ Cities: atlanta ga
| | βββ Wireguard selection settings:
| βββ Wireguard settings:
| βββ Private key: oO...WA=
| βββ Interface addresses:
| | βββ 10.66.214.103/32
| βββ Network interface: tun0
βββ DNS settings:
| βββ DNS server address to use: 127.0.0.1
| βββ Keep existing nameserver(s): no
| βββ DNS over TLS settings:
| βββ Enabled: yes
| βββ Update period: every 24h0m0s
| βββ Unbound settings:
| | βββ Authoritative servers:
| | | βββ cloudflare
| | βββ Caching: yes
| | βββ IPv6: no
| | βββ Verbosity level: 1
| | βββ Verbosity details level: 0
| | βββ Validation log level: 0
| | βββ System user: root
| | βββ Allowed networks:
| | βββ 0.0.0.0/0
| | βββ ::/0
| βββ DNS filtering settings:
| βββ Block malicious: yes
| βββ Block ads: no
| βββ Block surveillance: no
| βββ Blocked IP networks:
| βββ 127.0.0.1/8
| βββ 10.0.0.0/8
| βββ 172.16.0.0/12
| βββ 192.168.0.0/16
| βββ 169.254.0.0/16
| βββ ::1/128
| βββ fc00::/7
| βββ fe80::/10
| βββ ::ffff:7f00:1/104
| βββ ::ffff:a00:0/104
| βββ ::ffff:a9fe:0/112
| βββ ::ffff:ac10:0/108
| βββ ::ffff:c0a8:0/112
βββ Firewall settings:
| βββ Enabled: yes
| βββ VPN input ports:
| βββ 56595
βββ Log settings:
| βββ Log level: INFO
βββ Health settings:
| βββ Server listening address: 127.0.0.1:9999
| βββ Target address: cloudflare.com:443
| βββ Read header timeout: 100ms
| βββ Read timeout: 500ms
| βββ VPN wait durations:
| βββ Initial duration: 6s
| βββ Additional duration: 5s
βββ Shadowsocks server settings:
| βββ Enabled: no
βββ HTTP proxy settings:
| βββ Enabled: no
βββ Control server settings:
| βββ Listening address: :8000
| βββ Logging: yes
βββ OS Alpine settings:
| βββ Process UID: 1000
| βββ Process GID: 100
| βββ Timezone: US/Eastern
βββ Public IP settings:
| βββ Fetching: every 12h0m0s
| βββ IP file path: /tmp/gluetun/ip
βββ Version settings:
βββ Enabled: yes
2022-12-08T17:50:48-05:00 INFO IPv6 is not supported
2022-12-08T17:50:48-05:00 INFO [routing] default route found: interface eth0, gateway 172.27.0.1 and assigned IP 172.27.0.2
2022-12-08T17:50:48-05:00 INFO [routing] adding route for 0.0.0.0/0
2022-12-08T17:50:48-05:00 INFO [firewall] setting allowed subnets...
2022-12-08T17:50:48-05:00 INFO [routing] default route found: interface eth0, gateway 172.27.0.1 and assigned IP 172.27.0.2
2022-12-08T17:50:48-05:00 INFO [dns over tls] using plaintext DNS at address 1.1.1.1
2022-12-08T17:50:48-05:00 INFO [http server] http server listening on [::]:8000
2022-12-08T17:50:48-05:00 INFO [healthcheck] listening on 127.0.0.1:9999
2022-12-08T17:50:48-05:00 INFO [firewall] allowing VPN connection...
2022-12-08T17:50:48-05:00 INFO [wireguard] Using available kernelspace implementation
2022-12-08T17:50:48-05:00 INFO [wireguard] Connecting to 45.134.140.130:51820
2022-12-08T17:50:48-05:00 INFO [wireguard] Wireguard is up
2022-12-08T17:50:48-05:00 INFO [firewall] setting allowed input port 56595 through interface tun0...
2022-12-08T17:50:48-05:00 INFO [dns over tls] downloading DNS over TLS cryptographic files
2022-12-08T17:50:48-05:00 INFO [dns over tls] downloading hostnames and IP block lists
2022-12-08T17:50:49-05:00 INFO [healthcheck] healthy!
2022-12-08T17:50:52-05:00 INFO [dns over tls] init module 0: validator
2022-12-08T17:50:52-05:00 INFO [dns over tls] init module 1: iterator
2022-12-08T17:50:52-05:00 INFO [dns over tls] start of service (unbound 1.15.0).
2022-12-08T17:50:52-05:00 INFO [dns over tls] generate keytag query _ta-4a5c-4f66. NULL IN
2022-12-08T17:50:52-05:00 INFO [dns over tls] ready
2022-12-08T17:50:53-05:00 INFO [vpn] You are running 1 commit behind the most recent latest
2022-12-08T17:50:53-05:00 INFO [ip getter] Public IP address is 45.134.140.139 (United States, Georgia, Atlanta)
Share your configuration
version: "3"
services:
gluetun:
image: qmcgaw/gluetun
container_name: gluetun
# line above must be uncommented to allow external containers to connect. See https://github.com/qdm12/gluetun/wiki/Connect-a-container-to-gluetun#external-container-to-gluetun
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
ports:
- 8888:8888/tcp # HTTP proxy
- 8388:8388/tcp # Shadowsocks
- 8388:8388/udp # Shadowsocks
- 8080:8080 # webgui
- 56595:56595 # mullvad
- 56595:56595/udp #mullvad
volumes:
- /srv/dev-disk-by-uuid-137ab035-ce9c-4366-b522-fd21bd139153/appdata/gluetun:/gluetun
environment:
# See https://github.com/qdm12/gluetun/wiki
- VPN_SERVICE_PROVIDER=mullvad
- VPN_TYPE=wireguard
- FIREWALL_VPN_INPUT_PORTS=redacted
- WIREGUARD_PRIVATE_KEY=redacted
- WIREGUARD_ADDRESSES=redacted
- SERVER_CITIES=Atlanta GA
- PUID=1000
- PGID=100
- TZ=US/Eastern
restart: unless-stopped
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
network_mode: "service:gluetun"
environment:
- PUID=1000
- PGID=100
- TZ=US/Eastern
- WEBUI_PORT=8080
volumes:
- /srv/dev-disk-by-uuid-137ab035-ce9c-4366-b522-fd21bd139153/appdata/qbittorrent:/config
- /srv/mergerfs/pool/data/torrents/:/data/torrents
#ports:
#- 8005:8005
#- 56595:56595
#- 56595:56595/udp
depends_on:
- gluetun
restart: unless-stopped
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 38 (4 by maintainers)
Yes, it does.
@jdoe29103 Although, it doesnβt really solve the issue as I just noticed that qBittorrent isnβt working (i.e. it canβt connect to trackers, fails the ipleak torrent test etc.) but I manually checked that I can ping from inside the container. Iβll try out the address binding method that you suggested.
Update: I bound it to the network
tun0
instead of a specific IP, and that seems to be working well (it has the advantage that qBittorrent binds to both IPV4 and IPV6, and some of my private trackers seem to perform better with one or the other). My guess it that whenever the network fromgluetun
went down,qBittorrent
bound itself to another network (which isnβt really connected to the internet) and for some reason refused to bind totun0
when it came back on. So, restricting it to the proper network works.Thats what I need to do. Bind tun0 in qbit settings and use libtorrentv1 image. Works like a dream
binding tun0 and ipv4 does not resolve for me on the latest gluetun (v3.33.0) and qb (lscr.io/linuxserver/qbittorrent) release
@SinTan1729 I have been poking around with it the past week and I may have found a somewhat βbetterβ fix. The other day I installed some updates on my OPNsense router which required a reboot. While the router rebooted I watched qBittorrent to see if it would recover once the router came back online and sure enough it did not and all torrents were stalled. However, after some trial and error it seems that binding the local IP address in qBittorrentβs advanced settings resolved this issue. It can survive a router reboot and come back online after I changed this. It has been going strong for a few days now so we shall see.
@qdm12 It could be. I have had this issue in the past with much older versions of qbittorrent in combination with OpenVPN. I have not tested an older version of qbittorrent with gluetun yet so that could also be a potential fix. I am going to poke around with it a bit more sometime this week and see what I can find.
@SinTan1729 does this cause qbittorrent to reboot if the gluetun container is restarted?
Iβm also facing this issue. Looks like it might be a
qBittorrent
issue sincegluetun
seems to maintain the connection.Youβve both said youβre using linuxserver/qbittorrent, have you tried linuxserver/qbittorrent:libtorrentv1 with these settings? Curious to see if it helps you too
Iβve also been running into this issue and Iβve been bound to the tun0 adapter from the beginning. I have found a 100% repro rate with AirVpn, if you manually disconnect the session gluten is using through their website this issue will occur upon reconnection. Hopefully this will help someone more experienced find whatβs happening as I havenβt been able to find out why yet π
So it seems the issue is not completely resolved. I noticed this morning that many torrents were unable to connect to trackers and adding new torrents just stalled. It seems the issue still persists sadly.
A (not nice) solution that I ended up using it adding this in the docker-compose for qbittorrent:
@jdoe29103
Youβre probably ahead of me on this one, but I see in the linuxserver/qbittorrent Github page that they have the βtempβ directory set to /downloads in the qbittorrent configuration file. I donβt see where that path is exposed in the WebUI, so is it possible youβre using up whatever free space is available in the container and a restart clears it out?
@jdoe29103
My apologies then, I always thought those volume mappings mattered. π