-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
Service fails to start first time on Windows Server 2016 #318
Comments
First, consult the wiki: https://github.com/coreybutler/node-windows/wiki#my-script-installs-but-wont-start-with-no-error If that doesn't help, there are a few places to look for additional logs. First, check the daemon directory where node-windows creates the exe file. There will likely be an error log there with further detail. Alternatively, the Windows Event Viewer may have additional information. Aside from the path issues described in the wiki, permissions are often a culprit. Sometimes the account used to install the service has different permissions than the account used to run the service. Sometimes accounts don't have access to read/write to a specific directory. Sometimes it's a Node version issue (i.e. stricter security restrictions in a minor release). It's unclear whether any of these permission pitfalls fit this situation, but I'd guess the |
Thanks so much for the fast reply! So In Event Viewer I get (in reverse order):
This is all my logging. Nothing is logged by winsw or the wrapper (as would normally happen on install). So it looks like I'm suspecting some account or permissions problem. I'll add some more logging to see exactly what account the installer is running my service start script under. Update: The installer is definitely running the startup script under an admin account ( |
So I have got to the bottom of the problem. The Windows Server 2016 instance is running as a VM on a fairly slow private cloud - the issue is that the delay here just isn't long enough. If I sleep for 20 seconds rather than 2 then the service starts normally. I'm guessing that we probably need to increase that value, or find a way of detecting that the service install process has really finished? |
For anyone else that has the same problem, this is what I did to work around it:
|
Since this has been resolved, I'm closing. If anyone else runs into this issue, feel free to open a PR. It would make sense to have a configurable sleep time defaulting to 2 seconds. |
Issue:
We have a weird problem. Our service is installed using an Innosetup installer which installs all the files and then starts the service. On Windows 10 and Windows 11 this works flawlessly - when the installer exits the service is installed and started.
On Windows Server 2016 (unfortunately our target OS), the service is installed, but isn't started. The thing is,
node-windows
thinks it is started. This is our install code:When this is run by the installer we get the following logged in Event Viewer:
However the service is not started, it is in the stopped state. If the service is started from the "Services" snap-in, it starts fine.
This isn't a disaster for us, it's just an irritation. If there is a simple explanation it would be good to fix it though.
Expected Behavior:
The service is started after install.
Desktop:
Windows Server 2016
The text was updated successfully, but these errors were encountered: