Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openvpnserv2 does not start under win10 32bit machine #3

Open
maverick74 opened this issue Jan 29, 2016 · 37 comments
Open

openvpnserv2 does not start under win10 32bit machine #3

maverick74 opened this issue Jan 29, 2016 · 37 comments

Comments

@maverick74
Copy link

Hi,

Following your request from ( https://community.openvpn.net/openvpn/ticket/595 ) here it is:

I've tried manually cleaning the registry and then do a clean install but got no luck either, so it's not an old key for sure.

I've also tried the debug version as asked, but all i get it the event log is that the service was successfully started... i'm out of clues.

@xkjyeah
Copy link
Owner

xkjyeah commented Jan 29, 2016

I'm sorry I don't know of any better way to debug in this case, other than debug by printf

Here's the "extralogs" branch https://github.com/xkjyeah/openvpnserv2/tree/extralogs/bin

If you use the binaries from this branch, you should get more Event Viewer entries. Let me know what you see. Remember to refresh your Event Viewer!

@maverick74
Copy link
Author

Hi, the version i used was the one inside ( https://github.com/xkjyeah/openvpnserv2/tree/extralogs/bin/Debug ). Even with this version i just get the event viewer to say that the service was successfully started...

Should i be looking somewhere else???

I also occasionally, but not always, IF i double click openvpnserv.exe, get a windows message saying that the windows service has to be installed first using installutil.exe and next, started with ServerExplorer (this message: http://thinketg.com/wp-content/uploads/2012/12/windows_service_start_failure.png )

but i'm not sure if i should be manually clicking openvpnserv.exe in the first place :)

@xkjyeah
Copy link
Owner

xkjyeah commented Jan 29, 2016

If you get that message, that's a somewhat good sign.

Perform the following:

  1. Start a command prompt as administrator
  2. C> cd "C:\Program Files\OpenVPN\bin"

(I assume you have downloaded openvpnserv.exe to this directory)

  1. Run the following commands:

C> C:\Windows\Microsoft.NET\Framework\v4.0.XXXX\installutil.exe /uninstall
openvpnserv.exe
C> C:\Windows\Microsoft.NET\Framework\v4.0.XXXX\installutil.exe
openvpnserv.exe
C> net start openvpnservice

On Fri, Jan 29, 2016 at 11:10 PM, maverick74 [email protected]
wrote:

Hi, the version i used was the one inside (
https://github.com/xkjyeah/openvpnserv2/tree/extralogs/bin/Debug ). Even
with this version i just get the event viewer to say that the service was
successfully started...

Should i be looking somewhere else???

I also occasionally, but not always, IF i double click openvpnserv.exe,
get a windows message saying that the windows service has to be installed
first using installutil.exe and next, started with ServerExplorer (this
message:
http://thinketg.com/wp-content/uploads/2012/12/windows_service_start_failure.png
)

but i'm not sure if i should be manually clicking openvpnserv.exe in the
first place :)


Reply to this email directly or view it on GitHub
#3 (comment).

@xkjyeah
Copy link
Owner

xkjyeah commented Jan 29, 2016

Forgot to mention, I'm not sure what 'XXXX' should be, but it should be
some sequence of digits

On Fri, Jan 29, 2016 at 11:24 PM, Daniel Sim [email protected] wrote:

If you get that message, that's a somewhat good sign.

Perform the following:

  1. Start a command prompt as administrator
  2. C> cd "C:\Program Files\OpenVPN\bin"

(I assume you have downloaded openvpnserv.exe to this directory)

  1. Run the following commands:

C> C:\Windows\Microsoft.NET\Framework\v4.0.XXXX\installutil.exe /uninstall
openvpnserv.exe
C> C:\Windows\Microsoft.NET\Framework\v4.0.XXXX\installutil.exe
openvpnserv.exe
C> net start openvpnservice

On Fri, Jan 29, 2016 at 11:10 PM, maverick74 [email protected]
wrote:

Hi, the version i used was the one inside (
https://github.com/xkjyeah/openvpnserv2/tree/extralogs/bin/Debug ). Even
with this version i just get the event viewer to say that the service was
successfully started...

Should i be looking somewhere else???

I also occasionally, but not always, IF i double click openvpnserv.exe,
get a windows message saying that the windows service has to be installed
first using installutil.exe and next, started with ServerExplorer (this
message:
http://thinketg.com/wp-content/uploads/2012/12/windows_service_start_failure.png
)

but i'm not sure if i should be manually clicking openvpnserv.exe in the
first place :)


Reply to this email directly or view it on GitHub
#3 (comment)
.

@maverick74
Copy link
Author

Hi,

Sorry for taking so long but i'm not always able to get on location... (other jobs...)

I've made the procedure as you instructed but it still does not run and the error still appears...

There has to be something that OpenVPN GUI is doing that OpenVPNServ isn't... but i honestelly can't figure out what it is.

Once (whit an older OpenVPN version) a reboot to the OpenVPNServ used to do the job. But now not even that seems to work...

Only the GUI make it work...

@maverick74
Copy link
Author

Maybe this helps: Using the debug version, i get this error on the event viewer everytime i try to start openvpnserv.exe by double-click:

Unable to start the service. The service process could not connect to the service controller

However, this does not happen on windows logon or when starting/restarting it from the taskmanager>servic

@xkjyeah
Copy link
Owner

xkjyeah commented Feb 3, 2016

This is really odd now. Do you have an antivirus and have you temporarily
disabled it during installation?

Maybe this helps: Using the debug version, i get this error on the event
viewer everytime i try to start openvpnserv.exe by double-click:

Unable to start the service. The service process could not connect to the
service controller

However, this does not happen on windows logon or when starting/restarting
it from the taskmanager>servic


Reply to this email directly or view it on GitHub
#3 (comment).

@maverick74
Copy link
Author

Nope... That's not it either :(

@xkjyeah
Copy link
Owner

xkjyeah commented Feb 4, 2016

I just upgraded my development PC to Windows 10. I discovered an issue with
the way the .NET framework reads registry keys (
http://stackoverflow.com/questions/13728491/opensubkey-returns-null-for-a-registry-key-that-i-can-see-in-regedit-exe)
which I previously didn't encounter while developing on Windows 8.

Maybe it's the issue. I've updated the binaries on the repo (
https://github.com/xkjyeah/openvpnserv2/tree/master/bin/Release).

In addition, on the extralogs tree I've created a second project. This is a
command-line equivalent of the service process. Could you run it from the
command line and tell me what the output is?

On Thu, Feb 4, 2016 at 3:44 AM, maverick74 [email protected] wrote:

Nope... That's not it either :(


Reply to this email directly or view it on GitHub
#3 (comment).

@maverick74
Copy link
Author

Hi,

Sorry for taking soo much time.

The last version does not work either. :(

The result of the command-line tool (which i suppose is called StartService.exe) returns the output:

False
False

@xkjyeah
Copy link
Owner

xkjyeah commented Feb 11, 2016

Can you check that the extension of your .ovpn files are in lowercase?
On Feb 11, 2016 03:36, "maverick74" [email protected] wrote:

Hi,

Sorry for taking soo much time.

The last version does not work either. :(

The result of the command-line tool (which i suppose is called
StartService.exe) returns the output:

False
False


Reply to this email directly or view it on GitHub
#3 (comment).

@maverick74
Copy link
Author

Sure i can.
Everything it's in lowercase! Names and extensions.

@maverick74
Copy link
Author

I can't stop thinking about what is the GUI doing that openvpnserv isn't........ The GUI works well openvpnserv doesn't... why?! If the GUI is just a GUI for the same process... it's really weird it doesn't work...

(by the way... i'll only be able get back on monday or later... sorry)

@xkjyeah
Copy link
Owner

xkjyeah commented Feb 14, 2016

The reason why the original openvpnserv doesn't work is because it doesn't
monitor the openvpn.exe processes for unexpected shutdowns, which seem to
occur in Windows 10 installations.

Openvpnserv2.exe is a rewrite of openvpnserv. I have to admit that some of
the C# code I wrote is rough around the edges. My being lazy means that I
hadn't tested it thoroughly before releasing it... to you; and the fact
that testing it properly requires administrator access just makes it more
painful. I just discovered that the service will crash if log files are not
present. So... thanks for helping me debug, even if it's a debug-by-printf.

So, again, I've updated the binaries.

Again, you can use

If you use the command-line version, like before you can send me the output.

Good luck!

On Fri, Feb 12, 2016 at 2:55 AM, maverick74 [email protected]
wrote:

I can't stop thinking about what is the GUI doing that openvpnserv
isn't........ The GUI works well openvpnserv doesn't... why?! If the GUI is
just a GUI for the same process... it's really weird it doesn't work...

(by the way... i'll only be able get back on monday or later... sorry)


Reply to this email directly or view it on GitHub
#3 (comment).

@maverick74
Copy link
Author

Hi. No need to thank me! It's I that needs to thank you.

However we're still out of luck... :(

Output:

False
False

@xkjyeah
Copy link
Owner

xkjyeah commented Feb 20, 2016

Hi,

Could you try this updated version?

https://github.com/xkjyeah/openvpnserv2/tree/extralogs/StartService

Daniel

On Wed, Feb 17, 2016 at 3:51 AM, maverick74 [email protected]
wrote:

Hi. No need to thank me! It's me that needs to thank you.

However we are still out of luck... :(

Output:

False
False


Reply to this email directly or view it on GitHub
#3 (comment).

@maverick74
Copy link
Author

It still does not connect.

However the output is different:

C:\Program Files\OpenVPN\bin>startservice.exe
False
False
EXE Path: C:\Program Files\OpenVPN\bin\openvpn.exe
Config dir: C:\Program Files\OpenVPN\config
Config ext: .ovpn
Log dir: C:\Program Files\OpenVPN\log
Log append: False
Priority class: Normal
Filename ~? C:\Program Files\OpenVPN\config\README.txt .ovpn
EXE Path: C:\Program Files\OpenVPN\bin\openvpn.exe
Config dir: C:\Program Files\OpenVPN\config
Config ext: .ovpn
Log dir: C:\Program Files\OpenVPN\log
Log append: False
Priority class: Normal
Filename ~? C:\Program Files\OpenVPN\config\README.txt .ovpn

@xkjyeah
Copy link
Owner

xkjyeah commented Feb 22, 2016

The program is not able to find your config file in C:\program files\openvpn\config. Are your config files saved there?

@maverick74
Copy link
Author

Hi,

yes, they are in that folder. It is a requirement even for the GUI to work... (i can't recall, however, if the files are inside another folder in the config (config/foldername/) or if the files are in that root directory (config/)

since that didn't matter for the GUI i never imagine that would matter for the service.

I can check how they are and get back to you in a few minutes (i'm not on location but i do have easy access)

@maverick74
Copy link
Author

Ok, i am back.

Apparently moving the config files from /config/connectionfolder/ to /config/ solved the problem :D ( there still remains one machine i need to test more carefully because sh**ty PandaAV keeps deleting the new openvpnserv.exe )

beside that... everything seems to be working OK (sometimes i hate my job, you know... having an enormous problem caused by such tiny details makes me thinking about set some computers on fire and make barbecues out of them..........)

one detail: this is not our case because we only work with one config file, but for others that may use more than one VPN config it should be of tremendous help to be able to have them in separated folders - more organised... So it would be good if openvpnserv.exe would be able to detect config files contained inside folders that exist in the config folder.

Anyway: THANK YOU SO MUCH FOR ALL YOUR HELP ON THIS PROBLEM!!!

Any clue when the correction will be accepted in openvpn upstream???

@xkjyeah
Copy link
Owner

xkjyeah commented Feb 22, 2016

I've pushed a build that should fix the issue. You can move your config back to the subfolder. :)

If you can verify that it works, I'll close the issue.

@maverick74
Copy link
Author

I'm planning to try again in 2h / 2:30h and i'll get back to you then.

@maverick74
Copy link
Author

Hi,

i've had a few minutes in place and was able to bypass PandaAV and substitute openvpnserv.exe which is now working fine, however i was not able to spend much time with the _subfolder detail_... my first impression was that it was still not working - i had to move the files into the root folder (/config/)... but i could be doing something wrong - i was in kind of a hurry... in about an hour i might be able to say something more about this

@maverick74
Copy link
Author

I can confirm now that subfolder detection is not working :(

@maverick74
Copy link
Author

Any improvement in the remaining subdirectory-related bug?

@xkjyeah
Copy link
Owner

xkjyeah commented Mar 4, 2016

can you provide the output of the command-line version when you run it?

@maverick74
Copy link
Author

Hi.

Here's the Output (i've translated some words that were not in english):

After this output StartService.exe stops working and crashes...

C:\Program Files\OpenVPN\bin>startservice.exe
False
False
EXE Path: C:\Program Files\OpenVPN\bin\openvpn.exe
Config dir: C:\Program Files\OpenVPN\config
Config ext: .ovpn
Log dir: C:\Program Files\OpenVPN\log
Log append: False
Priority class: Normal
Processing C:\Program Files\OpenVPN\config\testfolder\config1.ovpn
Opened Log File C:\Program Files\OpenVPN\log\config1.log
Flush timer started
Start C:\Program Files\OpenVPN\config\testfolder\config1.ovpn
Process started
EXE Path: C:\Program Files\OpenVPN\bin\openvpn.exe
Config dir: C:\Program Files\OpenVPN\config
Config ext: .ovpn
Log dir: C:\Program Files\OpenVPN\log
Log append: False
Priority class: Normal
Processing C:\Program Files\OpenVPN\config\testfolder\config1.ovpn
Exception occured during OpenVPN service start:    in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   in System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   in OpenVpn.OpenVpnChild..ctor(OpenVpnServiceConfiguration config, String configFile)
   in OpenVpn.OpenVpnWatchdog.OnStart(String[] args)

Exception not processed: Watchdog C:\Program Files\OpenVPN\config\testfolder\config1.ovpn
Process for C:\Program Files\OpenVPN\config\testfolder\config1.ovpn exited. Restarting in 10 sec.
System.IO.IOException: The process cannot access the file 'C:\Program Files\OpenVPN\log\config1.log' because it's being used by another process.
   in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   in System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   in OpenVpn.OpenVpnChild..ctor(OpenVpnServiceConfiguration config, String configFile)
   in OpenVpn.OpenVpnWatchdog.OnStart(String[] args)
   in OpenVpn.OpenVpnWatchdog.Main(String[] args)

@xkjyeah
Copy link
Owner

xkjyeah commented Mar 9, 2016

This error is becase you didn't run the program as Administrator, or an
openvpn service is already running.

On Tue, Mar 8, 2016 at 4:55 AM, maverick74 [email protected] wrote:

Hi.

Here's the Output (i've translated some words that were not in english):

After this output StartService.exe stops working and crashes...

C:\Program Files\OpenVPN\bin>startservice.exe
False
False
EXE Path: C:\Program Files\OpenVPN\bin\openvpn.exe
Config dir: C:\Program Files\OpenVPN\config
Config ext: .ovpn
Log dir: C:\Program Files\OpenVPN\log
Log append: False
Priority class: Normal
Processing C:\Program Files\OpenVPN\config\testfolder\config1.ovpn
Opened Log File C:\Program Files\OpenVPN\log\config1.log
Flush timer started
Start C:\Program Files\OpenVPN\config\testfolder\config1.ovpn
Process started
EXE Path: C:\Program Files\OpenVPN\bin\openvpn.exe
Config dir: C:\Program Files\OpenVPN\config
Config ext: .ovpn
Log dir: C:\Program Files\OpenVPN\log
Log append: False
Priority class: Normal
Processing C:\Program Files\OpenVPN\config\testfolder\config1.ovpn
Exception occured during OpenVPN service start: in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
in System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
in OpenVpn.OpenVpnChild..ctor(OpenVpnServiceConfiguration config, String configFile)
in OpenVpn.OpenVpnWatchdog.OnStart(String[] args)

Exception not processed: Watchdog C:\Program Files\OpenVPN\config\testfolder\config1.ovpn
Process for C:\Program Files\OpenVPN\config\testfolder\config1.ovpn exited. Restarting in 10 sec.
System.IO.IOException: The process cannot access the file 'C:\Program Files\OpenVPN\log\config1.log' because it's being used by another process.
in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
in System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
in OpenVpn.OpenVpnChild..ctor(OpenVpnServiceConfiguration config, String configFile)
in OpenVpn.OpenVpnWatchdog.OnStart(String[] args)
in OpenVpn.OpenVpnWatchdog.Main(String[] args)


Reply to this email directly or view it on GitHub
#3 (comment).

@maverick74
Copy link
Author

Hi,

I've stopped all openvpn services manually from the taskmanager and set the software (startservice) to run as admin, after that i've started it from the cmd (executed as admin) and got the exact same output as above... :(

Also, since the main issue was solved, i upgraded two crucial machines (the last ones i couldn't until the connection problem was solved) into windows 10 (both 64bit) and... surprise surprise - it apparently worked... the sad thing is that it does not always do. From time to time openvpn service starts but i can't connect (same issue reported previously)!!!

I was apparently wrong and it's not a 32bit-specific problem... now, the thing that makes it worst is that it does not always fail. Sometimes it works fine sometimes it doesn't!!!

(the subfolder issue is still not working)

what can i do to solve the main issue (failing to connect from time to time)?

Thanks

@xkjyeah
Copy link
Owner

xkjyeah commented Mar 11, 2016

Well I'm at a loss here and really don't know how to help you.

When you start the service do you see entries in the Windows event log
this time? Try to kill all Openvpnserv2.exe and startservice.exe and
possibly all OpenVPN.exe processes before starting the service.

Since we've fixed the config file issue the service should be logging to
the event log now.
On 11 Mar 2016 22:43, "maverick74" [email protected] wrote:

Hi,

I've stopped all openvpn services manually from the taskmanager and set
the software (startservice) to run as admin, after that i've started it
from the cmd (executed as admin) and got the exact same output as above...
:(

Also, since the main issue was solved, i upgraded two crucial machines
(the last ones i couldn't until the connection problem was solved) into
windows 10 (both 64bit) and... surprise surprise - it apparently worked...
the sad thing is that it does not always do. From time to time openvpn
service starts but i can't connect (same issue reported previously)!!!

I was apparently wrong and it's not a 32bit-specific problem... now, the
thing that makes it worst is that it does not always fail. Sometimes it
works fine sometimes it doesn't!!!

(the subfolder issue is still not working)

what can i do to solve the main issue (failing to connect from time to
time)?

Thanks


Reply to this email directly or view it on GitHub
#3 (comment).

@maverick74
Copy link
Author

Lets just forget about that subfolder issue, shall we??? (i just noticed how dumb i am for not remember to edit the openvpn config file and set it to get the certificates and key inside the subfolder)... If i put everything in the subfolder (.ovpn file included) it does not work... but i suppose that this is the way it works (and if it is, then this issue is settled - sorry for my stupidity on this)

back to the main issue, Monday i'll try to to see if i get something new. I'll let you know if i get something new.

@maverick74
Copy link
Author

Hi, i can't seem to figure out why it says the service has started but it isn't working.

I've tried everything i can remember but it didn't work... Didn't had time to try startservice... :(

Anyway... sometimes it starts sometimes it doesn't... i don't get why!

@maverick74
Copy link
Author

An update: From what i can say, after all the tests i can do, i can only deduce that this is a local problem (probably in our registry or something since everywhere else it's working) and not a openvpnserv2 problem... so, i believe it would be ok for you to send it upstream and let other benefit from your work.

@maverick74
Copy link
Author

Hi again,

Any idea when openvpn upstream will get this patch? Tks

@xkjyeah xkjyeah closed this as completed Jul 2, 2016
@xkjyeah xkjyeah reopened this Jul 2, 2016
@mattock
Copy link
Collaborator

mattock commented Sep 18, 2016

@maverick74: what patch are you talking about exactly?

@maverick74
Copy link
Author

maverick74 commented Sep 21, 2016

@mattock Well... i suppose openvpn2serv either would replace openvpnserv or that it would use the fixes to the bugs discovered and be "upstreamed" as a patch to the old dying openvpnserv... since the last still doesn't work well under win10 as far as i know... (didn't try it lately, however)

xkjyeah pushed a commit that referenced this issue Nov 21, 2016
several build improvements
@LinuxOnTheDesktop
Copy link

LinuxOnTheDesktop commented Jul 14, 2019

I have the same problem - OpenVPN will not autostart - on a 64-bit version of Windows 10. I did not have the problem - on the same computer - when it ran Windows 8.1. Moreover, my config file is in the root of the config folder. I (try to) launch OpenVPN via a scheduled task that is set to run on logon. If I tell Windows task scheduler (with its nasty, nasty UI) to run the task, manually, it fails silently. When I use a terminal to do what the task scheduler is meant to do, everything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants