[SOLVED] QVPN problem: OpenVPN not starting anymore, tun device not being created

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
Post Reply
bigcookie
Getting the hang of things
Posts: 64
Joined: Fri Jan 30, 2009 6:00 pm

[SOLVED] QVPN problem: OpenVPN not starting anymore, tun device not being created

Post by bigcookie » Mon Aug 10, 2020 4:59 pm

Hi,

I posted this issue in the according firmware thread viewtopic.php?f=142&t=156188&p=761281#p761281 as it happened after updating to 4.4.3.1381for information, in case it is connected to the firmware.

I opened this second post not for information, but to get help in debugging/fixing (I didnt want to flood the firmware thread with this)... QNAP support ticket is already opened.

Device:
TS-653B
QTS 4.4.3.1381

Issue:
I can configure OpenVPN and start is in the UI, but actually - though it is shown as enabled - openvpn server is not running. I tried
> ps -ef | grep vpn
but openvpn is not shown
> ifconfig
show no tun# device before or after starting OpenVPN server in the UI.

I tried:
- uninstalling/reinstalling QVPN
- disabling/enabling OpenVPN
- stopping/starting QVPN
- restarting server

nothing worked - I would like to get around setting up the server newly (just did that 8 weeks ago). Does anyone have hints how to debug this? I didnt find log entries or anything helpful :-(.
Thanks, regards,

André
Last edited by bigcookie on Mon Aug 10, 2020 7:04 pm, edited 1 time in total.

bigcookie
Getting the hang of things
Posts: 64
Joined: Fri Jan 30, 2009 6:00 pm

Re: QVPN problem: OpenVPN not starting anymore, tun device not being created

Post by bigcookie » Mon Aug 10, 2020 7:04 pm

SOLVED
It is a race condition between docker and QVPN. I have wireguard running in userspace via docker container. Wireguard also uses the tun device. For any reason, the early start of the wireguard application led to the creation od a /dev/net/tun directory, which prohibited the creation of the /dev/net/tun character device.

temporary fix (lost after reboot):
> rmmod tun
> rmdir /dev/net/tun
> modprobe tun

permamanent fix:
removing the docker wireguard application, then removing /dev/net/tun directory, reboot server.

I filed a QNAP ticket regarding the race condition, though I assume not too many people experience it (running OpenVPN and wireguard in parallel)

AlastairStevenson
Experience counts
Posts: 2267
Joined: Wed Jan 08, 2014 10:34 pm

Re: [SOLVED] QVPN problem: OpenVPN not starting anymore, tun device not being created

Post by AlastairStevenson » Mon Aug 10, 2020 7:37 pm

Well done for figuring it out, and for sharing the workaround.

But I'm curious - why are you running both OpenVPN and wireguard?
TS-431+ for storage and media and a bunch of IP cams under Surveillance Station. TVS-473 as files backup and QVR Pro.

Post Reply

Return to “Miscellaneous”