Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: qbittorrent works with "container:gluetun" but not with "service:gluetun" #2452

Open
Silun opened this issue Sep 1, 2024 · 3 comments

Comments

@Silun
Copy link

Silun commented Sep 1, 2024

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
Copy link
Contributor

github-actions bot commented Sep 1, 2024

@qdm12 is more or less the only maintainer of this project and works on it in his free time.
Please:

@qdm12
Copy link
Owner

qdm12 commented Sep 3, 2024

Maybe #1697 (which I need to do soon ™️) would help, I'll report back here once this is implemented.

@qdm12 qdm12 changed the title Bug: Torrenting in same compose file doesn't work Bug: qbittorrent works with "container:gluetun" but not with "service:gluetun" Sep 3, 2024
@qdm12 qdm12 added Status: 🔴 Blocked Blocked by another issue or pull request Status: 🗯️ Waiting for feedback labels Sep 3, 2024
@Silun
Copy link
Author

Silun commented Sep 7, 2024

I don't know, that one sounds like an issue related to port forwarding to be reachable from the outisde. When the issue is currently happening and all trackers are unreachable, I can still ping the outside world from inside the qB container. I can also have a download going, in case the client still remembers some of the peers from before the issue occured.

If this were truly related, my guess is that if I stop forwarding the port, the issue should go away. If it doesn't go away, then it is not related to that other issue. Yes? Does that make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants