YunoHost-Apps / wireguard_ynh

WireGuard VPN software with a web UI configuration companion, packaged for YunoHost.
GNU General Public License v3.0
35 stars 10 forks source link

Error 500 when trying to start the service #69

Closed davidszerman closed 2 years ago

davidszerman commented 2 years ago

Hello,

i installed (reinstalled, restarted the server..) wireguard but it keeps failing

When I try to connect my client, it keeps trying to handshake.

When I run a diagnosis of my Yuno instance, it says that wg-quick0 service is down.

i try to start it :

Impossible de démarrer le service 'wg-quick@wg0' Journaux historisés récents : -- Logs begin at Tue 2022-07-05 09:46:17 CEST, end at Tue 2022-07-05 09:59:37 CEST. -- Jul 05 09:46:19 systemd[1]: Starting WireGuard via wg-quick(8) for wg0... Jul 05 09:46:20 wg-quick[1104]: [#] ip link add wg0 type wireguard Jul 05 09:46:20 wg-quick[1104]: [#] wg setconf wg0 /dev/fd/63 Jul 05 09:46:20 wg-quick[1104]: [#] ip -4 address add 10.10.10.0/24 dev wg0 Jul 05 09:46:20 wg-quick[1104]: [#] ip -6 address add fd42::/112 dev wg0 Jul 05 09:46:20 wg-quick[1104]: RTNETLINK answers: Permission denied Jul 05 09:46:20 wg-quick[1104]: [#] ip link delete dev wg0 Jul 05 09:46:20 systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jul 05 09:46:20 systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'. Jul 05 09:46:20 systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0. Jul 05 09:48:49 systemd[1]: Starting WireGuard via wg-quick(8) for wg0... Jul 05 09:48:49 wg-quick[3448]: [#] ip link add wg0 type wireguard Jul 05 09:48:49 wg-quick[3448]: [#] wg setconf wg0 /dev/fd/63 Jul 05 09:48:49 wg-quick[3448]: [#] ip -4 address add 10.10.10.0/24 dev wg0 Jul 05 09:48:49 wg-quick[3448]: [#] ip -6 address add fd42::/112 dev wg0 Jul 05 09:48:49 wg-quick[3448]: RTNETLINK answers: Permission denied Jul 05 09:48:49 wg-quick[3448]: [#] ip link delete dev wg0 Jul 05 09:48:49 systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jul 05 09:48:49 systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'. Jul 05 09:48:49 systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0. Jul 05 09:49:04 systemd[1]: Starting WireGuard via wg-quick(8) for wg0... Jul 05 09:49:04 wg-quick[3497]: [#] ip link add wg0 type wireguard Jul 05 09:49:04 wg-quick[3497]: [#] wg setconf wg0 /dev/fd/63 Jul 05 09:49:04 wg-quick[3497]: [#] ip -4 address add 10.10.10.0/24 dev wg0 Jul 05 09:49:04 wg-quick[3497]: [#] ip -6 address add fd42::/112 dev wg0 Jul 05 09:49:04 wg-quick[3497]: RTNETLINK answers: Permission denied Jul 05 09:49:04 wg-quick[3497]: [#] ip link delete dev wg0 Jul 05 09:49:04 systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jul 05 09:49:04 systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'. Jul 05 09:49:04 systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0. Jul 05 09:50:38 systemd[1]: Starting WireGuard via wg-quick(8) for wg0... Jul 05 09:50:38 wg-quick[3731]: [#] ip link add wg0 type wireguard Jul 05 09:50:38 wg-quick[3731]: [#] wg setconf wg0 /dev/fd/63 Jul 05 09:50:38 wg-quick[3731]: [#] ip -4 address add 10.10.10.0/24 dev wg0 Jul 05 09:50:38 wg-quick[3731]: [#] ip -6 address add fd42::/112 dev wg0 Jul 05 09:50:38 wg-quick[3731]: RTNETLINK answers: Permission denied Jul 05 09:50:38 wg-quick[3731]: [#] ip link delete dev wg0 Jul 05 09:50:39 systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jul 05 09:50:39 systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'. Jul 05 09:50:39 systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0. Jul 05 09:57:26 systemd[1]: Starting WireGuard via wg-quick(8) for wg0... Jul 05 09:57:26 wg-quick[4365]: [#] ip link add wg0 type wireguard Jul 05 09:57:26 wg-quick[4365]: [#] wg setconf wg0 /dev/fd/63 Jul 05 09:57:26 wg-quick[4365]: [#] ip -4 address add 10.10.10.0/24 dev wg0 Jul 05 09:57:26 wg-quick[4365]: [#] ip -6 address add fd42::/112 dev wg0 Jul 05 09:57:26 wg-quick[4365]: RTNETLINK answers: Permission denied Jul 05 09:57:26 wg-quick[4365]: [#] ip link delete dev wg0 Jul 05 09:57:26 systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jul 05 09:57:26 systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'. Jul 05 09:57:26 systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0. Jul 05 09:58:14 systemd[1]: Starting WireGuard via wg-quick(8) for wg0... Jul 05 09:58:14 wg-quick[4417]: [#] ip link add wg0 type wireguard Jul 05 09:58:14 wg-quick[4417]: [#] wg setconf wg0 /dev/fd/63 Jul 05 09:58:14 wg-quick[4417]: [#] ip -4 address add 10.10.10.0/24 dev wg0 Jul 05 09:58:14 wg-quick[4417]: [#] ip -6 address add fd42::/112 dev wg0 Jul 05 09:58:14 wg-quick[4417]: RTNETLINK answers: Permission denied Jul 05 09:58:14 wg-quick[4417]: [#] ip link delete dev wg0 Jul 05 09:58:14 systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jul 05 09:58:14 systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'. Jul 05 09:58:14 systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0. Jul 05 09:59:37 systemd[1]: Starting WireGuard via wg-quick(8) for wg0... Jul 05 09:59:37 wg-quick[4673]: [#] ip link add wg0 type wireguard Jul 05 09:59:37 wg-quick[4673]: [#] wg setconf wg0 /dev/fd/63 Jul 05 09:59:37 wg-quick[4673]: [#] ip -4 address add 10.10.10.0/24 dev wg0 Jul 05 09:59:37 wg-quick[4673]: [#] ip -6 address add fd42::/112 dev wg0 Jul 05 09:59:37 wg-quick[4673]: RTNETLINK answers: Permission denied Jul 05 09:59:37 wg-quick[4673]: [#] ip link delete dev wg0 Jul 05 09:59:37 systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jul 05 09:59:37 systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'. Jul 05 09:59:37 systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0

Thank you for your help

tituspijean commented 2 years ago

Please use the "Share with YunoPaste" green button from the service log menu. This is unreadable. :/

image


Can you also share the output of sudo cat /etc/sysctl.conf | grep ipv6 ?

chjohn22 commented 2 years ago

@tituspijean Same error here. Everything worked fine, today I did reboot the server for the first time since April. All apps have been updated before. The wireguard handshake fails since, logs here: https://paste.yunohost.org/enevebezux

tituspijean commented 2 years ago
Jul 23 20:57:58 wg-quick[1362]: RTNETLINK answers: Operation not supported
Jul 23 20:57:58 wg-quick[1362]: Unable to access interface: Protocol not supported

These mean somehow WireGuard is not loaded in the kernel. :(

Can you share the output of sudo dkms status ?

chjohn22 commented 2 years ago

wireguard, 1.0.20210219, 4.19.0-20-amd64, x86_64: installed

The output of sudo modprobe wireguard : modprobe: FATAL: Module wireguard not found in directory /lib/modules/4.19.0-21-amd64

tituspijean commented 2 years ago

Weird. Can you try force-upgrading the app? sudo yunohost app upgrade wireguard -F

chjohn22 commented 2 years ago

Weird. Can you try force-upgrading the app? sudo yunohost app upgrade wireguard -F

Thanks, the forced upgrade followed by a reboot solved the problem. Everything is working fine again!