Qbittorrent running through Gluetun VPN container makes all torrents get "Errored Status"

I created a docker compose file which had Qbit and GlueTun VPN running with a Private Internet Access VPN. That said, all my torrents get “Errored” status.

This is my docker compose file:

services:
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    network_mode: service:gluetun
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - WEBUI_PORT=8081
      - TORRENTING_PORT=6881
    volumes:
      - ./config:/config
      - /mnt/storage/Torrents:/downloads
    restart: unless-stopped

  gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    ports:
      - 6881:6881
      - 6881:6881/udp
      - 8081:8081

    devices:
      - /dev/net/tun:/dev/net/tun
    volumes:
      - ./gluetun:/gluetun
    environment:
      - VPN_SERVICE_PROVIDER=private internet access
      - OPENVPN_USER=.....................
      - OPENVPN_PASSWORD=..........
      - SERVER_REGIONS=Netherlands
      - VPN_PORT_FORWARDING=on
      - VPN_PORT_FORWARDING_UP_COMMAND=/bin/sh -c 'wget -O- --retry-connrefused --post-data "json={\"listen_port\":{{PORTS}}}" http://127.0.0.1:8081/api/v2/app/setPreferences 2>&1'
      - PRIVATE_INTERNET_ACCESS_VPN_PORT_FORWARDING=on

In qbit, I set the network interface as tun0, added the correct listening port, and checked that the vpn’s ip showed up in qbit’s shell. I also made sure to connect to a server that was capable of port forwarding. To test to see what was causing issues I tried using Transmission instead and it did work. I still think something was up in my compose file and I would prefer to use qbittorrent instead.

This was running on Ubuntu Sever 24.04.3. If you need more info I will gladly give it. Any help is appreciated.

You used transmission as a Docker container with the same network_mode: service:gluetun?

Yes. I just removed qbittorrent from the file and put in transmission instead.

Then it seems to be a qbit configuration issue. Are you sure you need to set tun0?