Debian: getting an error on boot but server starts fine

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
JordanThompson
OpenVpn Newbie
Posts: 15
Joined: Wed Mar 11, 2020 10:10 pm

Debian: getting an error on boot but server starts fine

Post by JordanThompson » Fri Aug 26, 2022 7:54 pm

I am on a Raspberry Pi.
This is a new installation of OpenVPN.
I am only running a server for remote clients to access my home network
home network is 10.13.0.0/24
server's IP is 10.13.0.102
client OpenVPN network is 10.8.0.0/24
Clients are connecting just fine and I am able to access local hosts and the IP on the remote client changes as expected.

when the host starts, I get the following errors in my syslog:

Code: Select all

Aug 26 15:40:31 megabyte systemd[1]: openvpn@server.service: Service RestartSec=5s expired, scheduling restart.
Aug 26 15:40:31 megabyte systemd[1]: openvpn@server.service: Scheduled restart job, restart counter is at 80.
Aug 26 15:40:31 megabyte systemd[1]: Stopped OpenVPN connection to server.
Aug 26 15:40:31 megabyte systemd[1]: Starting OpenVPN connection to server...
Aug 26 15:40:31 megabyte ovpn-server[1627]: Options error: --dh fails with 'dh.pem': No such file or directory (errno=2)
Aug 26 15:40:31 megabyte ovpn-server[1627]: Options error: --ca fails with 'ca.crt': No such file or directory (errno=2)
Aug 26 15:40:31 megabyte ovpn-server[1627]: Options error: --cert fails with 'server.crt': No such file or directory (errno=2)
Aug 26 15:40:31 megabyte ovpn-server[1627]: WARNING: cannot stat file 'server.key': No such file or directory (errno=2)
Aug 26 15:40:31 megabyte ovpn-server[1627]: Options error: --key fails with 'server.key': No such file or directory (errno=2)
Aug 26 15:40:31 megabyte systemd[1]: openvpn@server.service: Main process exited, code=exited, status=1/FAILURE
Aug 26 15:40:31 megabyte ovpn-server[1627]: Options error: --crl-verify fails with 'crl.pem': No such file or directory (errno=2)
Aug 26 15:40:31 megabyte systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Aug 26 15:40:31 megabyte ovpn-server[1627]: WARNING: cannot stat file 'tc.key': No such file or directory (errno=2)
Aug 26 15:40:31 megabyte systemd[1]: Failed to start OpenVPN connection to server.
Aug 26 15:40:31 megabyte ovpn-server[1627]: Options error: --tls-crypt fails with 'tc.key': No such file or directory (errno=2)
Aug 26 15:40:31 megabyte ovpn-server[1627]: Options error: Please correct these errors.
Aug 26 15:40:31 megabyte ovpn-server[1627]: Use --help for more information.
and on the boot screen, I get (more or less - I copied it from the boot screen):

Code: Select all

[FAILED] Failed to start OpenVPN connection to server.
See 'systemctrl status openvpn@server.service' for details
My directory structure looks like this:

Code: Select all

/etc/openvpn
            |
            |--- server.conf (points to the one in server, below)
            |--- client (empty)
            |--- server
                     |--- server.conf


my server.conf looks like this:
Server Config

local 10.13.0.102
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 10.13.0.1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 1.1.1.1"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
verb 3
crl-verify crl.pem
explicit-exit-notify


Funny thing is that the server runs just fine after booting. I am just trying to eliminate any errors on the boot screen.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Debian: getting an error on boot but server starts fine

Post by TinCanTech » Fri Aug 26, 2022 8:34 pm

That looks like an angristan script problem.

JordanThompson
OpenVpn Newbie
Posts: 15
Joined: Wed Mar 11, 2020 10:10 pm

Re: Debian: getting an error on boot but server starts fine

Post by JordanThompson » Sat Aug 27, 2022 1:50 am

@TinCanTech do you have any suggestions on how to fix it?


JordanThompson
OpenVpn Newbie
Posts: 15
Joined: Wed Mar 11, 2020 10:10 pm

Re: Debian: getting an error on boot but server starts fine

Post by JordanThompson » Sat Aug 27, 2022 1:40 pm

@TinCanTech as I read them, these are installation issues that lead to a non-functional installation. My installation is working fine: The ONLY problem is that it just complains on boot (it is up and running after boot)

Post Reply