OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 19.1 Legacy Series »
  • OpenVPN strange issue (Service not running according to messages, but it works)
« previous next »
  • Print
Pages: [1]

Author Topic: OpenVPN strange issue (Service not running according to messages, but it works)  (Read 11023 times)

Mks

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: 19
    • View Profile
OpenVPN strange issue (Service not running according to messages, but it works)
« on: February 10, 2019, 09:57:56 pm »
Hi,

I've an issue with my OpenVPN configuration.
I'm getting the following errors:
Real/virtual IP: unable to contact damon Service nut running?

In the services tab, OpenVPN services are not running (see screenshot).

Log
openvpn[783]: Exiting due to fatal error
openvpn[783]: Cannot open TUN/TAP dev /dev/tun1: Device busy (errno=16)
openvpn[783]: TUN/TAP device ovpns1 exists previously, keep at program end

Nontheless I could establish a connection and everything works fine, strange isn't it?

Any idea, may an issue with the GUI?

OPNsense 19.1-amd64
FreeBSD 11.2-RELEASE-p8-HBSD
OpenSSL 1.0.2q 20 Nov 2018

Thanks
br
Logged

newsense

  • Hero Member
  • *****
  • Posts: 1038
  • Karma: 77
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #1 on: February 10, 2019, 11:15:26 pm »
Likely unrelated but please make sure you're on the latest version as issues might be already fixed. Should be 19.1.1 now.
Logged

agh1701

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 2
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #2 on: February 10, 2019, 11:57:32 pm »
it is pid file corruption.
Logged

Mks

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: 19
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #3 on: February 11, 2019, 05:55:55 am »
Hi,

I've updated to the latest version incl. reboot, issue still exists.

openvpn[76270]: Exiting due to fatal error
openvpn[76270]: Cannot open TUN/TAP dev /dev/tun1: Device busy (errno=16)
openvpn[76270]: TUN/TAP device ovpns1 exists previously, keep at program end


Quote
it is pid file corruption.
Thanks, any hints for solving the issue?

I can still establish a VPN connection.

br


br
Logged

Reiter der OPNsense

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #4 on: February 11, 2019, 10:54:10 am »
Hi,
after updating to Version 19.1 I have exactly the same issue. Same GUI message, same log entries, but tunnel still works.

OPNsense 19.1.1-amd64
FreeBSD 11.2-RELEASE-p8-HBSD
LibreSSL 2.7.5

Stefan
Logged

max

  • Newbie
  • *
  • Posts: 7
  • Karma: 3
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #5 on: February 11, 2019, 12:18:32 pm »
Same issue here on: 19.1.1
Code: [Select]
FreeBSD 11.2-RELEASE-p8-HBSD  31af16db12b(stable/19.1)  amd64 1102000

The OpenVPN deamon is running, but the GUI shows the following error in /status_openvpn.php :
Code: [Select]
Common Name Real Address Virtual Address Connected Since
[error] Unable to contact daemon Service not running?

When checking for the PID of my first OpenVPN server I get: 25894
Code: [Select]
# ps awx | egrep "openvpn.*server1\.conf"
25894  -  Ss       0:10.37 /usr/local/sbin/openvpn --config /var/etc/openvpn/server1.conf

When checking, which PID is recorded for my first OpenVPN server I find it to be: 42752
Code: [Select]
# cat /var/run/openvpn_server1.pid
42752

So it seems that the PID doesn't get recorded in the PID file correctly under:
Code: [Select]
/var/run/openvpn_server1.pid

Also, when checking the OpenVPN log file (/var/log/openvpn.log), I see that the OpenVPN daemon exits frequently.
Code: [Select]
Feb 11 11:59:51 openvpn[42752]: Exiting due to fatal error
Feb 11 11:59:51 openvpn[42752]: Cannot open TUN/TAP dev /dev/tun1: Device busy (errno=16)
Feb 11 11:59:51 openvpn[42752]: TUN/TAP device ovpns1 exists previously, keep at program end
...
Feb 11 11:59:51 openvpn[99057]: library versions: LibreSSL 2.7.5, LZO 2.10
Feb 11 11:59:51 openvpn[99057]: OpenVPN 2.4.6 amd64-portbld-freebsd11.2 [SSL (OpenSSL)] [LZO] [LZ4] [MH/RECVDA] [AEAD] built on Jan 28 2019



EDIT:
Removed the counting of openvpn crashes, as it was wrongly counted since last reboot.
« Last Edit: February 11, 2019, 08:32:19 pm by max »
Logged

NilsS

  • Full Member
  • ***
  • Posts: 176
  • Karma: 19
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #6 on: February 11, 2019, 12:27:06 pm »
Similiar problem over here, after update to 19.1.1 OpenVPN goes up and down multiple times over the day and pulls down all connections, not only the ones over vpn but all WAN traffic.

Two openVPN client connections (not set as default gw - traffic only for selected host with rules)

opnsense: /usr/local/etc/rc.openvpn: OpenVPN: One or more OpenVPN tunnel endpoints may have changed its IP. Reloading endpoints that may use AIRVPN_1_VPNV4.


EDIT:
Feb 11 12:41:09 sense openvpn[3038]: event_wait : Interrupted system call (code=4)
Feb 11 12:41:09 sense openvpn[3038]: SIGTERM received, sending exit notification to peer
Feb 11 12:41:13 sense openvpn[3038]: Closing TUN/TAP interface
Feb 11 12:41:13 sense openvpn[3038]: /usr/local/etc/inc/plugins.inc.d/openvpn/ovpn-linkdown ovpnc1 1                                                                                                                                         500 1553 10.xx.xx.xxx 255.255.255.0 init
Feb 11 12:41:16 sense openvpn[3038]: SIGTERM[soft,exit-with-notification] received, process exiting

EDIT2:
https://forum.opnsense.org/index.php?topic=11573.msg52453#msg52453 ok this seems to be the problem for me
« Last Edit: February 11, 2019, 02:34:11 pm by NilsS »
Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #7 on: February 11, 2019, 11:37:47 pm »

Issue raised

https://github.com/opnsense/core/issues/3223


Testing a solution.
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #8 on: February 11, 2019, 11:39:31 pm »
Quote from: NilsS on February 11, 2019, 12:27:06 pm
Similiar problem over here, after update to 19.1.1 OpenVPN goes up and down multiple times over the day and pulls down all connections, not only the ones over vpn but all WAN traffic.

Two openVPN client connections (not set as default gw - traffic only for selected host with rules)

opnsense: /usr/local/etc/rc.openvpn: OpenVPN: One or more OpenVPN tunnel endpoints may have changed its IP. Reloading endpoints that may use AIRVPN_1_VPNV4.


EDIT:
Feb 11 12:41:09 sense openvpn[3038]: event_wait : Interrupted system call (code=4)
Feb 11 12:41:09 sense openvpn[3038]: SIGTERM received, sending exit notification to peer
Feb 11 12:41:13 sense openvpn[3038]: Closing TUN/TAP interface
Feb 11 12:41:13 sense openvpn[3038]: /usr/local/etc/inc/plugins.inc.d/openvpn/ovpn-linkdown ovpnc1 1                                                                                                                                         500 1553 10.xx.xx.xxx 255.255.255.0 init
Feb 11 12:41:16 sense openvpn[3038]: SIGTERM[soft,exit-with-notification] received, process exiting

EDIT2:
https://forum.opnsense.org/index.php?topic=11573.msg52453#msg52453 ok this seems to be the problem for me


This is a different issue, OpenVPN doesn't go down, it just says its not running when it is.
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

Mks

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: 19
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #9 on: February 12, 2019, 09:02:11 am »
Quote from: marjohn56 on February 11, 2019, 11:37:47 pm

Issue raised
https://github.com/opnsense/core/issues/3223

Thanks, had planned it for today, but you've been faster.

br
Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #10 on: February 13, 2019, 01:04:56 pm »
Try this patch and let me know what happens, feedback on Github please. https://github.com/opnsense/core/issues/3223


Patch ID: da9fcdb


Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

Mks

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: 19
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #11 on: February 13, 2019, 06:54:42 pm »
Hi,

Thanks.

Feedback sent, I got an error after applying the patch.

br
Logged

kkoh

  • Newbie
  • *
  • Posts: 42
  • Karma: 0
  • ))) in stereo (((
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #12 on: February 21, 2019, 03:27:06 pm »
Just throwing my hat in as well... Same problem.
Logged

Mks

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: 19
    • View Profile
Re: OpenVPN strange issue (Service not running according to messages, but it works)
« Reply #13 on: February 21, 2019, 03:32:48 pm »
Hi,

Details are here https://github.com/opnsense/core/issues/3223#issuecomment-465714685

kr
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 19.1 Legacy Series »
  • OpenVPN strange issue (Service not running according to messages, but it works)
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2