MarkusMcNugen / docker-qBittorrentvpn

Docker container which runs a headless qBittorrent client with WebUI and optional OpenVPN
https://hub.docker.com/r/markusmcnugen/qbittorrentvpn/
GNU General Public License v3.0
177 stars 90 forks source link

ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2) #150

Closed Ordi-Chic closed 1 year ago

Ordi-Chic commented 1 year ago

Hi, Since several days, qBittorrent doesn't work and give this error (at the end of this log):

2023-01-03 08:51:34.701132 [info] VPN_ENABLED defined as 'yes'
2023-01-03 08:51:34.873502 [info] OpenVPN config file (ovpn extension) is located at /config/openvpn/france.ovpn
dos2unix: converting file /config/openvpn/france.ovpn to Unix format...
2023-01-03 08:51:35.067166 [info] VPN remote line defined as 'france.privacy.network 1198'
2023-01-03 08:51:35.102697 [info] VPN_REMOTE defined as 'france.privacy.network'
2023-01-03 08:51:35.138171 [info] VPN_PORT defined as '1198'
2023-01-03 08:51:35.173730 [info] VPN_PROTOCOL defined as 'udp'
2023-01-03 08:51:35.209766 [info] VPN_DEVICE_TYPE defined as 'tun0'
2023-01-03 08:51:35.245116 [info] LAN_NETWORK defined as '192.168.1.0/24'
2023-01-03 08:51:35.280399 [info] NAME_SERVERS defined as '8.8.8.8,8.8.4.4'
2023-01-03 08:51:35.315700 [info] VPN_OPTIONS not defined (via -e VPN_OPTIONS)
2023-01-03 08:51:35.351792 [info] Adding 8.8.8.8 to resolv.conf
2023-01-03 08:51:35.387779 [info] Adding 8.8.4.4 to resolv.conf
2023-01-03 08:51:35.421844 [info] Starting OpenVPN...
Tue Jan  3 08:51:35 2023 WARNING: file 'credentials.conf' is group or others accessible
Tue Jan  3 08:51:35 2023 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 19 2021
Tue Jan  3 08:51:35 2023 library versions: OpenSSL 1.1.1f  31 Mar 2020, LZO 2.10
Tue Jan  3 08:51:36 2023 TCP/UDP: Preserving recently used remote address: [AF_INET]156.146.63.138:1198
Tue Jan  3 08:51:36 2023 UDP link local: (not bound)
Tue Jan  3 08:51:36 2023 UDP link remote: [AF_INET]156.146.63.138:1198
Tue Jan  3 08:51:36 2023 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Tue Jan  3 08:51:36 2023 [paris402] Peer Connection Initiated with [AF_INET]156.146.63.138:1198
Tue Jan  3 08:51:37 2023 OpenVPN ROUTE6: OpenVPN needs a gateway parameter for a --route-ipv6 option and no default was specified by either --route-ipv6-gateway or --ifconfig-ipv6 options
Tue Jan  3 08:51:37 2023 OpenVPN ROUTE: failed to parse/resolve route for host/network: 2000::/3
Tue Jan  3 08:51:37 2023 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Tue Jan  3 08:51:37 2023 Exiting due to fatal error

I try to renew container with options cap-add and device, but it's still same issue (username and password are changed here).

docker run --privileged -d --name=qbittorrent --cap-add=NET_ADMIN --device /dev/net/tun \
              -v /volume1/docker/qbittorrent/:/config \
              -v /volume1/downloads/:/downloads \
              -e "VPN_ENABLED=yes" \
          -e "VPN_USERNAME=xxxxxxx" \
          -e "VPN_PASSWORD=xxxxxxxx" \
              -e "LAN_NETWORK=192.168.1.0/24" \
              -e "NAME_SERVERS=8.8.8.8,8.8.4.4" \
              -e "PUID=1027" \
              -e "PGID=100" \
              -p 8080:8080 \
              -p 6881:6881\
              -p 6881:6881/udp \
              markusmcnugen/qbittorrentvpn

What can I do?

Ordi-Chic commented 1 year ago

I finally solved the issue considering https://memoryleak.dev/post/fix-tun-tap-not-available-on-a-synology-nas/ already mentioned in an older thread. Good luck !