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

ERROR creating TUN device file node: file exists #55

Closed
sudarshan-uc opened this issue Mar 12, 2024 · 1 comment
Closed

ERROR creating TUN device file node: file exists #55

sudarshan-uc opened this issue Mar 12, 2024 · 1 comment

Comments

@sudarshan-uc
Copy link
Contributor

sudarshan-uc commented Mar 12, 2024

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:

  • RHEL 9: kernel: 5.14.0-362.18.1.el9_3.x86_64
  • Podman + crun to manage gluetun.

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:

  • Running the container as root.
  • Validated the correct module and kernel version
  • rebooted system
  • listed the loaded module: Noticed that the tun module was not getting loaded during the boot.

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

qdm12 commented Mar 18, 2024

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

@qdm12 qdm12 closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants