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

PM2 couldn't run the app and the app ends up in "errored" status #19

Open
kondekar opened this issue Mar 23, 2021 · 4 comments
Open

PM2 couldn't run the app and the app ends up in "errored" status #19

kondekar opened this issue Mar 23, 2021 · 4 comments

Comments

@kondekar
Copy link

kondekar commented Mar 23, 2021

Description
PM2 couldn't run the app and the app ends up in "errored" status

Steps to Reproduce

  1. Installed Node.js LTS 64 bit version on Windows Server 2012 R2
  2. Downloaded latest PM2-installer
  3. Ran following in order
    npm run configure
    npm run configure-policy
    npm run setup
  4. Ran server with node index.js Everything runs fine.
  5. Ran server with pm2 start index.js. The server starts in "errored" status. Logfile is empty
  6. however I noticed the following error in service.log in C:\ProgramData\pm2\service
2021-03-23T23:13:56: PM2 log: App [server-plugin:0] starting in -fork mode-
2021-03-23T23:13:56: PM2 log: App [server-plugin:0] online
ERROR: 2021-03-23T23:13:56: PM2 error: Error: spawn node ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
3/23/2021, 11:13:56 PM: default/server-plugin@N/A - start - MANUAL
ERROR: 2021-03-23T23:13:56: PM2 error: Cancelling versioning data parsing

Environment

[email protected] info C:\Users\deeptarget\pm2-installer-main
node ./src/bundle-info/current.js

Running on: 3/23/2021, pm2-installer 3.1.4 with node v14.16.0 and npm 6.14.11 on win32-6.3.9600.

@kondekar kondekar changed the title PM2 runs server in "errored" status PM2 couldn't run the app and ends up in "errored" status Mar 24, 2021
@kondekar kondekar changed the title PM2 couldn't run the app and ends up in "errored" status PM2 couldn't run the app and the app ends up in "errored" status Mar 24, 2021
@jkamleh
Copy link

jkamleh commented Mar 25, 2021

I had a similar issue, not the same error but worth a shot, have you tried giving NT AUTHORITY\Local Service user permissions (in my case I gave it full control, because I needed to modify/write to the directory).

Also, I downloaded PSTools (https://docs.microsoft.com/en-us/sysinternals/downloads/pstools) and run the following to give me a powershell window running as NT AUTHORITY\Local Service:
.\PsExec.exe -i -u 'NT AUTHORITY\Local Service' powershell

If you then navigate to your project root in the new powershell window and run:
pm2 start index.js

It should be listed as the local service user now. Hopefully any of the above helps :)

@kondekar
Copy link
Author

@jkamleh Thanks for giving a good direction to think.
I gave full control to the root folder of App to Local Service. I also launched PowerShell running as NT AUTHORITY\Local Service. That made PM2 launch the app with status as online but the next moment status became "errored". The log file has this error - "Script %s had too many unstable restarts (%d). Stopped." Any idea further?

@tasop-rsconnect
Copy link

Having the same issue.

PM installer 3.1.5
Node v10.18.0
NPM 6.13.4
Windows Server 2012 R2

@kondekar
Copy link
Author

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

3 participants