jessety / pm2-installer

Install PM2 offline as a service on Windows or Linux. Mostly designed for Windows.
MIT License
495 stars 50 forks source link

Could not start service: Unknown Failure #7

Closed ranielzed closed 4 years ago

ranielzed commented 4 years ago

I'm getting this error when running the setup script:

At <installation directory>\pm2-installer-master\src\windows\setup-service.ps1:182 char:5
+     throw "Could not start service: $message"
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not start service: Unknown Failure:String) [], RuntimeException
    + FullyQualifiedErrorId : Could not start service: Unknown Failure

Need help on how to proceed. Thank you

jessety commented 4 years ago

Hi @ranielzed,

I haven't seen this issue before, thanks for reporting it!

What version of Node and npm do you have installed? Which version of Windows 10 are you running, and what language is it set to use?

ranielzed commented 4 years ago

@jessety

Here are the details:

Windows 10 Pro build 19041.246 node: v12.16.3 npm: v6.14.4 Language: English (United States)

jessety commented 4 years ago

First, I'd suggest updating to Node 12.18.2. I just tried to reproduce this issue on Windows 10 Pro 19041 (English/US) with Node v12.18.2 and npm v6.14.5, but unfortunately it worked.

If updating Node doesn't work, we're going to have to look a little deeper. I pushed version 3.0.2 to add a few commands that should make diagnostics easier. In the new version, try running npm run info-service. Your log excerpt seemed to indicate that the service was installed successfully, but could not be started. Hopefully this may yield a little more information as to why.

ranielzed commented 4 years ago

@jessety

Thank you for those. I removed and then reran the setup. So far, the error is gone but the service isn't starting still. Here are the output from service info:


Found "pm2.exe" service:
  State: Stopped
  Status: OK
  Started: False
  Start Mode: Auto
  Service Type: Own Process
  Start Name: NT AUTHORITY\LocalService

  Display Name: PM2
  Description: Node process manager
  Path Name: "C:\ProgramData\pm2\service\daemon\pm2.exe"
  System Name: <System Name>
  Install Date:
  Check Point: 0
  Service Specific Exit Code: 0
  Exit Code: 1067
jessety commented 4 years ago

Could you paste in the full console output of the npm run setup command?

ranielzed commented 4 years ago

Not sure how, but when I removed and ran setup again, it showed a complete set of logs including output from pm2.

then I restarted and everything worked out great.

I'm closing this now. Thank you for your hardwork on this and your invaluable support. This made pm2 easier to use.