qbittorrent disconnected: tun0 interface is invalid

Questions about qBittorrent or Gluetun (VPN).
Post Reply
bloop
Posts: 4
Joined: Fri Mar 07, 2025 10:57 pm
United States of America

qbittorrent disconnected: tun0 interface is invalid

Post by bloop »

Hello! Installation instructions were great! I'm having one issue, though.

My qbittorrent is reporting its connection status as disconnected. If I enable the execution log in the ui, I can see the message:
The configured network interface is invalid. Interface: "tun0"

Running yams check-vpn is successful:
✅ Success: Your IPs are different. qBittorrent is masking your IP!

I am using protonvpn. I am using my OpenVPN credentials in ".env". I have port forwarding on, so I have "+pmp" at the end of my OpenVPN "VPN_USER" in the ".env" file.
My docker-compose.yaml is left untouched from the install process.
The gluetun service has "8080:8080/tcp" and "8081:8081/tcp" listed, uncommented, under ports.
PORT_FORWARD_ONLY and VPN_PORT_FORWARDING are both set to on, and uncommented.
The qbittorrent service has the ports section commented out, and has:
network_mode: "service:gluetun"

I have crontab setup with: "*/5 * * * * /opt/yams/scripts/update-port.sh".
I can also run this script manually with no errors.
Script body is from: https://gitlab.com/-/snippets/4788387

Please let me know if there's anything else I can check or any other information you need. Thank you so much for any help!

User avatar
rogs
Site Admin
Posts: 254
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: qbittorrent disconnected: tun0 interface is invalid

Post by rogs »

Hey @bloop!

Thank you for the amount of detail! Can you run the port forwarding script manually and see the output? Also, try adding a torrent manually in qBittorrent to see if it starts connecting.

Cheers!

Roger.

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
bloop
Posts: 4
Joined: Fri Mar 07, 2025 10:57 pm
United States of America

Re: qbittorrent disconnected: tun0 interface is invalid

Post by bloop »

Code: Select all

2025-03-07 23:11:31 | VPN container gluetun in healthy state!
2025-03-07 23:11:31 | qBittorrent Cookie invalid, getting new SessionID
2025-03-07 23:11:31 | Public IP: ###.###.###.###
2025-03-07 23:11:31 | Configured Port: #####
2025-03-07 23:11:31 | Active Port: #####
2025-03-07 23:11:31 | Port OK (Act: ##### Cfg: #####)

Censored everything because iunno what matters haha, but the ip looked good, and all ports were the same value.
I did notice that it gives the "qBittorrent Cookie invalid, getting new SessionID" message every time.

I tried manually adding a debian iso torrent through the web ui, and it is also stalled.

User avatar
rogs
Site Admin
Posts: 254
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: qbittorrent disconnected: tun0 interface is invalid

Post by rogs »

Ok, everything looks right except for 'qBittorrent Cookie invalid, getting new SessionID'. Is the port being set correctly? You might have a problem with the configuration.

Maybe you can try deleting the qBittorrent config and regenerating it? I don't know what else to try to be honest.

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
bloop
Posts: 4
Joined: Fri Mar 07, 2025 10:57 pm
United States of America

Re: qbittorrent disconnected: tun0 interface is invalid

Post by bloop »

I tried doing the ol':

Code: Select all

mv /opt/yams/config/qbittorrent/qBittorrent/qBittorrent.conf /opt/yams/config/qbittorrent/qBittorrent/qBittorrent.conf.old

and running through the setup again (https://yams.media/config/qbittorrent/) as well as verifying the port forwarding stuff again (https://yams.media/advanced/port-forwarding/), but I'm still stuck in the same state.

Yeah I'm not sure what else to try either, haha.

bloop
Posts: 4
Joined: Fri Mar 07, 2025 10:57 pm
United States of America

Re: qbittorrent disconnected: tun0 interface is invalid

Post by bloop »

Well, I don't think port forwarding was working. I tried entering the qbittorrent ip from "yams check-vpn" and the port from running "/opt/yams/scripts/update-port.sh" into https://www.yougetsignal.com/tools/open-ports/ and the port was not open, even after adding the port forward to my router.

So I tried disabling port forwarding by running "yams stop", editing "/opt/yams/.env" to remove "+pmp" from my vpn username, and editing the docker-compose.yaml to comment out the "PORT_FORWARD_ONLY=on" and "VPN_PORT_FORWARDING=on" lines. I also deleted the qbittorrent config again to make sure the port was set back to the default 6881.

qbittorrent was still disconnected. I even tried removing all torrents, setting the network interface to eth0, and adding a distro iso torrent, and the connection status is firewalled. So it seems I've got myself quite the mess here, haha.

Additional mess notes:

  • I am running this on an raspberry pi 4, but the OS is "Debian GNU/Linux 12 (bookworm)".
  • I am only able to connect to the services via my external IP after port forwarding in my router, but not through the server's internal 192.168.. ip for some reason (but I can ssh to it via the internal ip).
Post Reply