qdm12 / gluetun-wiki

Home to the Markdown Wiki page for Gluetun
MIT License
346 stars 40 forks source link

ERROR creating TUN device file node: file exists #55

Closed sudarshan-uc closed 6 months ago

sudarshan-uc commented 6 months ago

URL to the Wiki page

https://github.com/qdm12/gluetun-wiki/blob/main/errors/tun.md#creating-tun-device-file-node-file-exists

What's missing?

Describe: container has been running properly for a while. Suddenly container is failing to start with above error. But already provided solution did not help.

Previous issues:

System:

Command to run the Gluetun container:

podman run -d --name=pia-vpn --ip 101.0.0.21 --pull newer --cap-add=NET_ADMIN --device=/dev/net/tun:/dev/net/tun -p 8888:8888/tcp -p 8388:8388/tcp -p 8388:8388/udp -v vpn-config:/gluetun -e HTTPPROXY=on -e VPN_SERVICE_PROVIDER="private internet access" -e OPENVPN_USER=Username -e OPENVPN_PASSWORD=Password -e SERVER_REGIONS="US East" -e PRIVATE_INTERNET_ACCESS_OPENVPN_ENCRYPTION_PRESET=strong qmcgaw/gluetun:latest

Error:

2024-03-12T17:28:00Z INFO [routing] default route found: interface eth0, gateway 10.88.0.1, assigned IP 10.88.0.21 and family v4
2024-03-12T17:28:00Z INFO [routing] deleting route for 0.0.0.0/0
2024-03-12T17:28:00Z ERROR creating TUN device file node: file exists
2024-03-12T17:28:00Z INFO Shutdown successful

Investigation done:

Validation:

# lsmod | grep tun   <--- returned no output
# ll /dev/net/tun
crw-rw-rw-. 1 root root 10, 200 Mar 11 00:00 /dev/net/tun

manually loaded the module:

# modprob tun
# lsmod | grep tun
tun                    73728  0

Post-loading, the container started correctly.

Solution: Load the module during boot:

echo 'tun' > /etc/modules-load.d/tun.conf
cat /etc/modules-load.d/tun.conf
tun
qdm12 commented 6 months ago

Awesome detailed issue, thanks for the investigation and explanations! Closing this with #56 merged now.