error after installation, Event ID:0 ovpn_admin_group

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
HouseOfTheRisingSun
OpenVpn Newbie
Posts: 3
Joined: Wed Apr 12, 2017 1:34 pm

error after installation, Event ID:0 ovpn_admin_group

Post by HouseOfTheRisingSun » Wed Apr 12, 2017 1:49 pm

Hi,
The Event Viewer shows the following error:

The description for Event ID 0 from source openvpnserv cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

openvpnserv error: The system cannot find the file specified. (0x2) Error querying registry value: HKLM\SOFTWARE\OpenVPN\ovpn_admin_group

Re-installing does not solve the problem. Thanks

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

Re: error after installation, Event ID:0 ovpn_admin_group

Post by TinCanTech » Wed Apr 12, 2017 4:33 pm


HouseOfTheRisingSun
OpenVpn Newbie
Posts: 3
Joined: Wed Apr 12, 2017 1:34 pm

Re: error after installation, Event ID:0 ovpn_admin_group

Post by HouseOfTheRisingSun » Sun Apr 23, 2017 1:26 pm

You guys don't make it easy to get any kind of meaningful help and it's a little confusing which board is the proper board. I can tell you I was using the client version and to solve the problem, I rolled back to "openvpn-install-2.3.14-I601-x86_64". The event id went away. I was using "openvpn-install-2.4.1-I601.exe". I have the hassle of typing my log-in information again but I can live with that over the event error.

HouseOfTheRisingSun
OpenVpn Newbie
Posts: 3
Joined: Wed Apr 12, 2017 1:34 pm

Re: error after installation, Event ID:0 ovpn_admin_group

Post by HouseOfTheRisingSun » Sun Apr 23, 2017 1:29 pm

You guys don't make it easy to get any kind of meaningful help and it's a little confusing which board is the proper board. I can tell you I was using the client version and to solve the problem, I rolled back to "openvpn-install-2.3.14-I601-x86_64" . The event id went away and I'm using Windows 7 64-bit. I was using "openvpn-install-2.4.1-I601.exe". I have the hassle of typing my log-in information again but I can live with that over the event error. I'll try updating with the next version that comes out.

Sorry for the double post. I'm not sure how to delete the above one.

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

Re: error after installation, Event ID:0 ovpn_admin_group

Post by TinCanTech » Sun Apr 23, 2017 6:49 pm

HouseOfTheRisingSun wrote:You guys don't make it easy to get any kind of meaningful help
You don't make it easy for us to help you ..... :o

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: error after installation, Event ID:0 ovpn_admin_group

Post by 300000 » Mon Apr 24, 2017 11:05 am

free software mean dont need to make it as easy as it is . up to people use it if they like . somehow if you need quick. there are on the internet you can contact to ask someone help you

hvergelmir
OpenVpn Newbie
Posts: 2
Joined: Thu Apr 27, 2017 8:16 am

Re: error after installation, Event ID:0 ovpn_admin_group

Post by hvergelmir » Thu Apr 27, 2017 8:36 am

The beauty of open source is, well, its open source. So after also seeing this in the event log and seeing your thread here, I decided to peek into the source.

Turns out the culprit is the GetRegString() function in common.c which logs any non-success return code immediately to the event log. So this is simply noise in the event log that can be disregarded. There is nothing wrong with your setup if you're seeing this.

Code: Select all

    if (status != ERROR_SUCCESS)
    {
        SetLastError(status);
        return MsgToEventLog(M_SYSERR, TEXT("Error querying registry value: HKLM\\%s\\%s"), REG_KEY, value);
    }
Looking at the location its called from, I'd say it'd make sense to introduce a parameter to the GetRegString() function which governs if non-success return codes get logged to the event log or not. Perhaps by default they should be, but having a non-fatal error culminate in an error event being logged seems at least slightly odd.

Code: Select all

    /* read if present, else use default */
    error = GetRegString(key, TEXT("ovpn_admin_group"), s->ovpn_admin_group, sizeof(s->ovpn_admin_group));
    if (error != ERROR_SUCCESS)
    {
        openvpn_sntprintf(s->ovpn_admin_group, _countof(s->ovpn_admin_group), OVPN_ADMIN_GROUP);
        error = 0; /* this error is not fatal */
    }
Anyway, if I were an OpenVPN contributor, I'd probably rename GetRegString() into GetRegStringEx(), then create a very shallow wrapper around that by the old name GetRegString():

Code: Select all

static DWORD
GetRegStringEx(HKEY key, LPCTSTR value, LPTSTR data, DWORD size, BOOL bLogToEventLog)
{
    DWORD type;
    LONG status = RegQueryValueEx(key, value, NULL, &type, (LPBYTE) data, &size);

    if (status == ERROR_SUCCESS && type != REG_SZ)
    {
        status = ERROR_DATATYPE_MISMATCH;
    }

    if (status != ERROR_SUCCESS && bLogToEventLog)
    {
        SetLastError(status);
        return MsgToEventLog(M_SYSERR, TEXT("Error querying registry value: HKLM\\%s\\%s"), REG_KEY, value);
    }

    return ERROR_SUCCESS;
}

static DWORD
GetRegString(HKEY key, LPCTSTR value, LPTSTR data, DWORD size)
{
	return GetRegStringEx(key, value, data, size, TRUE);
}
This way only the single instance (and possibly other non-fatal instances of calling GetRegString() to override a default) could be replaced by a call to GetRegStringEx(), passing FALSE as the last parameter:

Code: Select all

 
     /* read if present, else use default */
    error = GetRegStringEx(key, TEXT("ovpn_admin_group"), s->ovpn_admin_group, sizeof(s->ovpn_admin_group), FALSE);
    if (error != ERROR_SUCCESS)
    {
        openvpn_sntprintf(s->ovpn_admin_group, _countof(s->ovpn_admin_group), OVPN_ADMIN_GROUP);
        error = 0; /* this error is not fatal */
    }
Alternatively it could be logged as a warning instead of an error in a similar fashion.

Btw: in case someone wants to pick this up, feel free to. I hereby put it into the public domain where applicable and under CC0 in jurisdictions that don't know public domain. Feel free to use, I don't care about attribution :mrgreen:

TL;DR: the non-fatal error in accessing this value should be logged as a warning or not logged altogether. From reading the code it's clear that there is nothing wrong with the configuration if you get to see this "error" as of version 2.4.1.

hvergelmir
OpenVpn Newbie
Posts: 2
Joined: Thu Apr 27, 2017 8:16 am

Re: error after installation, Event ID:0 ovpn_admin_group

Post by hvergelmir » Thu Apr 27, 2017 8:47 am

If you wanted to shut the code up without changing the default behavior, you could simply import the following .reg file:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\OpenVPN]
"ovpn_admin_group"="OpenVPN Administrators"
Please note that, if the default name ever changes your setup will suddenly use the (then) non-default group name "OpenVPN Administrators".

Post Reply