Restart loop - `Bad argument `eth0'`
-
Suddenly my vpn app is in a unhealthy state with this log gettings spammed:
Error: Could not restart OpenVPN: Command failed: sudo /app/code/src/restart.sh Jul 03 06:49:28 Node.js v22.14.0 Jul 03 06:49:28 Try `ip6tables -h' or 'ip6tables --help' for more information. Jul 03 06:49:28 ^
Jul 03 06:49:33 2025-07-03 04:49:33,710 INFO success: admin entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) Jul 03 06:49:33 ==> Generating CRL Jul 03 06:49:33 ==> Starting VPN server with dataDir: /app/data Jul 03 06:49:33 An updated CRL has been created: Jul 03 06:49:33 Notice Jul 03 06:49:33 Using SSL: Jul 03 06:49:33 gen-crl (stderr): Using configuration from /app/data/pki/openssl-easyrsa.cnf Jul 03 06:49:33 gen-crl (stdout): Jul 03 06:49:33 gen-crl (stdout): Jul 03 06:49:33 gen-crl (stdout): Jul 03 06:49:33 gen-crl (stdout): Using Easy-RSA 'vars' configuration: Jul 03 06:49:33 gen-crl easyrsa: gen-crl Jul 03 06:49:34 2025-07-03T04:49:34Z Jul 03 06:49:34 2025-07-03T04:49:34Z Jul 03 06:49:34 2025-07-03 04:49:34,445 INFO reaped unknown pid 1230 (exit status 1) Jul 03 06:49:34 2025-07-03 04:49:34,460 WARN exited: admin (exit status 1; not expected) Jul 03 06:49:34 ==> Configuring nft nat rules for 10.8.0.0 and Jul 03 06:49:34 ==> Restart OpenVPN after config changes Jul 03 06:49:34 ==> Server has IPv6 connectivity, setting as default route Jul 03 06:49:34 Bad argument `eth0' Jul 03 06:49:34 Error: Could not restart OpenVPN: Command failed: sudo /app/code/src/restart.sh Jul 03 06:49:34 Node.js v22.14.0 Jul 03 06:49:34 Try `ip6tables -h' or 'ip6tables --help' for more information. Jul 03 06:49:34 ^ Jul 03 06:49:34 at async Object.init (file:///app/code/src/vpn.js:735:5) Jul 03 06:49:34 at async main (file:///app/code/server.js:173:5) Jul 03 06:49:34 at async ovInit (file:///app/code/src/vpn.js:689:5) Jul 03 06:49:34 at ovSyncSettings (file:///app/code/src/vpn.js:193:31) Jul 03 06:49:34 file:///app/code/src/vpn.js:193 Jul 03 06:49:34 if (safe.error) throw new Error(`Could not restart OpenVPN: ${safe.error.message}`);
-
With the app in recovery mode and editing the
/app/code/src/restart.sh
adding theset -x
flag I could get this command that is failing:+ ip6tables-nft -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE Bad argument `eth0' Try `ip6tables -h' or 'ip6tables --help' for more information.
-
From that I can tell that
network6=$(cat /app/data/openvpn.conf | sed -ne 's/^server-ipv6 \(.*\)/\1/p')
https://git.cloudron.io/packages/vpn-app/-/blob/master/src/restart.sh?ref_type=heads#L9
Is not returning what is needed for the-s
flag.
So theserver-ipv6
is missing in that config.
I could go and add that myself or. . . I just move/app/data/openvpn.conf
to/app/data/openvpn.conf.org
and restart the app so it will be generated again.That worked, app is now healthy again.
I could bet this issue was ongoing for a while and I just did not notice -
Hello @BrutalBirdie
Nice to read that you were able to figure that out so fast!
Maybe we could improve the vpn app ifnetwork6
is empty that the config needs to be fixed.
Since I believe this is an issue due to a historic installation.
Since when did you have the VPN app installed or can you even recall what version it was first? -
Installed 11/20/2022
So for the version it might was v1.15.0? -
IMO having a backwards compatibility is nice but to what extent?
Just checkingnetwork6
var and if empty return a useful error would suffice for me.