kylemanna / docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
https://hub.docker.com/r/kylemanna/openvpn/
MIT License
8.62k stars 2.37k forks source link

my GCP VM will die, and then I get this error when I start the VM back up and start the vpn server again #628

Open ORESoftware opened 3 years ago

ORESoftware commented 3 years ago

My VM reboots, and then SSH in and run:

$ docker run -v $OVPN_DATA:/etc/openvpn  -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn

and I get this logged:

/usr/local/bin/ovpn_run: line 55: /etc/openvpn/ovpn_env.sh: No such file or directory

I can confirm that OVPN_DATA is set to the original value, so not sure what's going on, but I get this error consistently so have to start from beginning each time when my VM stops and restarts. The docker volume that was originally created also exists always, so that volume is not MIA, so not sure what's goin on. Also note that I do not automatically restart the vpn server, I manually run the first line above.

kylemanna commented 3 years ago

Is your docker image update to date? PR #620 fixed this.

docker pull kylemanna/openvpn

And retry.

anortef commented 3 years ago

Same here, and the pull is from a couple of hours ago

kylemanna commented 3 years ago

Oh, re-reading the error it seems that the volume container (or mount) isn't initialized. See the README.

Can verify this with something simple as:

docker run -v $OVPN_DATA:/etc/openvpn  --rm -it kylemanna/openvpn ls /etc/openvpn