gluetun icon indicating copy to clipboard operation
gluetun copied to clipboard

Bug: qbittorrent works with `"container:gluetun"` but not with `"service:gluetun"`

Open Silun opened this issue 1 year ago β€’ 3 comments

Is this urgent?

No

Host OS

Ubuntu Server 22.04

CPU arch

x86_64

VPN service provider

Windscribe

What are you using to run the container

Portainer

What is the version of Gluetun

Running version latest built on 2024-08-25T07:04:32.409Z (commit 01fa993)

What's the problem πŸ€”

As per the wiki, containers defined in the same compose/stack should be connected to gluetun via network_mode: "service:gluetun". When done this way, qBittorrent does not work: It cannot connect to any tracker, does not find peers, etc. and will just complain that everything is unreachable. I can ping the outside world fine from within the qb container, though.

When I separate the qb part from the same stack into a new one and only change the network mode to network_mode: "container:gluetun", it works just fine.

Edit: This is so weird, sometimes it just works with both containers in one stack. I can't see any difference in the logs, though. I'll start the exact same compose and suddenly it just works. After another restart of the stack, it won't work any more, except sometimes it will. Again, ping always works from within the qb container, which seems even weirder.

Share your logs (at least 10 lines)

========================================
========================================
=============== gluetun ================
========================================
=========== Made with ❀️ by ============
======= https://github.com/qdm12 =======
========================================
========================================
Running version latest built on 2024-08-25T07:04:32.409Z (commit 01fa993)
πŸ”§ Need help? β˜• Discussion? https://github.com/qdm12/gluetun/discussions/new/choose
πŸ› Bug? ✨ New feature? https://github.com/qdm12/gluetun/issues/new/choose
πŸ’» Email? [email protected]
πŸ’° Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2024-09-01T03:58:19+02:00 INFO [routing] default route found: interface eth0, gateway 172.18.0.1, assigned IP 172.18.0.7 and family v4
2024-09-01T03:58:19+02:00 INFO [routing] local ethernet link found: eth0
2024-09-01T03:58:19+02:00 INFO [routing] local ipnet found: 172.18.0.0/16
2024-09-01T03:58:19+02:00 INFO [firewall] enabling...
2024-09-01T03:58:19+02:00 INFO [firewall] enabled successfully
2024-09-01T03:58:19+02:00 INFO [storage] creating /gluetun/servers.json with 20480 hardcoded servers
2024-09-01T03:58:20+02:00 INFO Alpine version: 3.20.2
2024-09-01T03:58:20+02:00 INFO OpenVPN 2.5 version: 2.5.10
2024-09-01T03:58:20+02:00 INFO OpenVPN 2.6 version: 2.6.11
2024-09-01T03:58:20+02:00 INFO IPtables version: v1.8.10
2024-09-01T03:58:20+02:00 INFO Settings summary:
β”œβ”€β”€ VPN settings:
|   β”œβ”€β”€ VPN provider settings:
|   |   β”œβ”€β”€ Name: windscribe
|   |   └── Server selection settings:
|   |       β”œβ”€β”€ VPN type: wireguard
|   |       β”œβ”€β”€ Regions: Switzerland
|   |       └── Wireguard selection settings:
|   └── Wireguard settings:
|       β”œβ”€β”€ Private key: 2KA...lM=
|       β”œβ”€β”€ Pre-shared key: GUD...rE=
|       β”œβ”€β”€ Interface addresses:
|       |   └── ###############
|       β”œβ”€β”€ Allowed IPs:
|       |   β”œβ”€β”€ 0.0.0.0/0
|       |   └── ::/0
|       └── Network interface: tun0
|           └── MTU: 1400
β”œβ”€β”€ DNS settings:
|   β”œβ”€β”€ Keep existing nameserver(s): no
|   β”œβ”€β”€ DNS server address to use: 127.0.0.1
|   └── DNS over TLS settings:
|       β”œβ”€β”€ Enabled: yes
|       β”œβ”€β”€ Update period: every 24h0m0s
|       β”œβ”€β”€ Upstream resolvers:
|       |   └── cloudflare
|       β”œβ”€β”€ Caching: yes
|       β”œβ”€β”€ IPv6: no
|       └── 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:127.0.0.1/104
|               β”œβ”€β”€ ::ffff:10.0.0.0/104
|               β”œβ”€β”€ ::ffff:169.254.0.0/112
|               β”œβ”€β”€ ::ffff:172.16.0.0/108
|               └── ::ffff:192.168.0.0/112
β”œβ”€β”€ Firewall settings:
|   β”œβ”€β”€ Enabled: yes
|   └── VPN input ports:
|       └── 10288
β”œβ”€β”€ Log settings:
|   └── Log level: info
β”œβ”€β”€ Health settings:
|   β”œβ”€β”€ Server listening address: 127.0.0.1:9999
|   β”œβ”€β”€ Target address: cloudflare.com:443
|   β”œβ”€β”€ Duration to wait after success: 5s
|   β”œβ”€β”€ 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
β”œβ”€β”€ Storage settings:
|   └── Filepath: /gluetun/servers.json
β”œβ”€β”€ OS Alpine settings:
|   β”œβ”€β”€ Process UID: 1000
|   β”œβ”€β”€ Process GID: 1000
|   └── Timezone: Europe/Berlin
β”œβ”€β”€ Public IP settings:
|   β”œβ”€β”€ Fetching: every 12h0m0s
|   β”œβ”€β”€ IP file path: /tmp/gluetun/ip
|   β”œβ”€β”€ Public IP data API: ipinfo
|   └── API token: [set]
β”œβ”€β”€ Server data updater settings:
|   β”œβ”€β”€ Update period: 24h0m0s
|   β”œβ”€β”€ DNS address: 1.1.1.1:53
|   β”œβ”€β”€ Minimum ratio: 0.8
|   └── Providers to update: windscribe
└── Version settings:
    └── Enabled: yes
2024-09-01T03:58:20+02:00 INFO [routing] default route found: interface eth0, gateway 172.18.0.1, assigned IP 172.18.0.7 and family v4
2024-09-01T03:58:20+02:00 INFO [routing] adding route for 0.0.0.0/0
2024-09-01T03:58:20+02:00 INFO [firewall] setting allowed subnets...
2024-09-01T03:58:20+02:00 INFO [routing] default route found: interface eth0, gateway 172.18.0.1, assigned IP 172.18.0.7 and family v4
2024-09-01T03:58:20+02:00 INFO TUN device is not available: open /dev/net/tun: no such file or directory; creating it...
2024-09-01T03:58:20+02:00 INFO [dns] using plaintext DNS at address 1.1.1.1
2024-09-01T03:58:20+02:00 INFO [http server] http server listening on [::]:8000
2024-09-01T03:58:20+02:00 INFO [healthcheck] listening on 127.0.0.1:9999
2024-09-01T03:58:20+02:00 INFO [firewall] allowing VPN connection...
2024-09-01T03:58:20+02:00 INFO [wireguard] Using available kernelspace implementation
2024-09-01T03:58:20+02:00 INFO [wireguard] Connecting to 89.187.165.99:1194
2024-09-01T03:58:20+02:00 INFO [wireguard] Wireguard setup is complete. Note Wireguard is a silent protocol and it may or may not work, without giving any error message. Typically i/o timeout errors indicate the Wireguard connection is not working.
2024-09-01T03:58:20+02:00 INFO [firewall] setting allowed input port 10288 through interface tun0...
2024-09-01T03:58:20+02:00 INFO [dns] downloading hostnames and IP block lists
2024-09-01T03:58:20+02:00 INFO [healthcheck] healthy!
2024-09-01T03:58:21+02:00 INFO [dns] DNS server listening on [::]:53
2024-09-01T03:58:22+02:00 INFO [dns] ready
2024-09-01T03:58:22+02:00 INFO [ip getter] Public IP address is 89.187.165.119 (Switzerland, Zurich, ZΓΌrich)
2024-09-01T03:58:22+02:00 INFO [vpn] You are running 1 commit behind the most recent latest

Share your configuration

# Environment Variable: forward_port_value -> Windscribe MATCHING port forward!

services:
  gluetun:
    image: ghcr.io/qdm12/gluetun
    container_name: gluetun
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    ports:
      - 8082:8082/tcp # qB WebUI
    environment:
      - FIREWALL_VPN_INPUT_PORTS=${forward_port_value} # port forward
      - VPN_SERVICE_PROVIDER=windscribe
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=###############
      - WIREGUARD_ADDRESSES=###############
      - WIREGUARD_PRESHARED_KEY=###############
      - SERVER_REGIONS=Switzerland
      - TZ=Europe/Berlin
      - UPDATER_PERIOD=24h
      - PUBLICIP_API=ipinfo
      - PUBLICIP_API_TOKEN=###############


  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    network_mode: "service:gluetun"
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - WEBUI_PORT=8082
      - TORRENTING_PORT=${forward_port_value}
    volumes:
      - /home/docker-data/qbittorrent/appdata:/config
      - /home/docker-data/qbittorrent/downloads:/downloads #optional
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "ping", "-c", "1", "1.1.1.1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s


networks:
  default:
    external: true
    name: reverse-proxied

Silun avatar Sep 01 '24 02:09 Silun