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 not working in Windows #4113

Closed
mikebutak opened this issue Jan 11, 2019 · 5 comments
Closed

PM2 not working in Windows #4113

mikebutak opened this issue Jan 11, 2019 · 5 comments

Comments

@mikebutak
Copy link

...

I read the related issues, they are different from this problem.

What's going wrong?

PM2 not working in windows server 2012:

  • I was successful at implementing PM2 in our QA environment.
  • When I go to install it in production, it doesn't work. It successfully installs, but when I run it, the CPU spikes to 100% and the process quits. See messaging below:
$ pm2 start server/index.js
[PM2] Spawning PM2 daemon with pm2_home=C:\Users\chq-mikebu\.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting D:\Program Files\nodeApps\service-management-api\server\index.js in fork_mode (1 instance)
[PM2] Done.

Now it prints a status table indicating that the app is running with status "online". However, if I run pm2 status, it shows no processes running. And No Node instance in the Task Manger is running.

Same happens if I use pm2 start ecosystem.config.js.

Nothing in .pm2/logs/*
But there are logs in .pm2/pm2.log:

2019-01-10T14:36:40: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
2019-01-10T14:36:40: PM2 log: Time                 : Thu Jan 10 2019 14:36:40 GMT-0800 (Pacific Standard Time)
2019-01-10T14:36:40: PM2 log: PM2 version          : 3.2.7
2019-01-10T14:36:40: PM2 log: Node.js version      : 10.15.0
2019-01-10T14:36:40: PM2 log: Current arch         : x64
2019-01-10T14:36:40: PM2 log: PM2 home             : C:\pm2_system\.pm2
2019-01-10T14:36:40: PM2 log: PM2 PID file         : C:\pm2_system\.pm2\pm2.pid
2019-01-10T14:36:40: PM2 log: RPC socket file      : \\.\pipe\rpc.sock
2019-01-10T14:36:40: PM2 log: BUS socket file      : \\.\pipe\pub.sock
2019-01-10T14:36:40: PM2 log: Application log path : C:\pm2_system\.pm2\logs
2019-01-10T14:36:40: PM2 log: Process dump file    : C:\pm2_system\.pm2\dump.pm2
2019-01-10T14:36:40: PM2 log: Concurrent actions   : 2
2019-01-10T14:36:40: PM2 log: SIGTERM timeout      : 1600
2019-01-10T14:36:40: PM2 log: ===============================================================================
2019-01-10T22:36:40.147Z axon:sock accept //./pipe/pub.sock
2019-01-10T22:36:40.147Z axon:sock add socket 0
2019-01-10T22:36:40.147Z axon:sock accept //./pipe/pub.sock
2019-01-10T22:36:40.148Z axon:sock add socket 1
2019-01-10T22:36:40.148Z axon:sock accept //./pipe/rpc.sock
2019-01-10T22:36:40.148Z axon:sock add socket 0
2019-01-10T22:36:40.148Z axon:sock accept //./pipe/rpc.sock
2019-01-10T22:36:40.148Z axon:sock add socket 1
2019-01-10T22:36:40.150Z axon:sock disconnect //./pipe/rpc.sock
2019-01-10T22:36:40.151Z axon:sock remove socket 1
2019-01-10T22:36:40.151Z axon:sock disconnect //./pipe/rpc.sock
2019-01-10T22:36:40.151Z axon:sock remove socket 0
2019-01-10T22:36:40.151Z axon:sock disconnect //./pipe/pub.sock
2019-01-10T22:36:40.151Z axon:sock remove socket 1
2019-01-10T22:36:40.151Z axon:sock disconnect //./pipe/pub.sock
2019-01-10T22:36:40.151Z axon:sock remove socket 0
2019-01-10T22:36:40.156Z axon:sock accept //./pipe/rpc.sock
2019-01-10T22:36:40.156Z axon:sock add socket 0
2019-01-10T22:36:40.179Z axon:sock disconnect //./pipe/rpc.sock
2019-01-10T22:36:40.179Z axon:sock remove socket 0

How could we reproduce this issue?

From a Windows Server 2012 NT6.2 (no service pack) environment, try installing PM2 and starting a node process.

Supporting information

$ pm2 report

This is odd:
If I run pm2 -v I get 3.2.7
but, if I run pm2 report, I get bash: $: command not found

@kepelrs
Copy link

kepelrs commented Jan 13, 2019

I had this same problem when deploying a project on a new windows machine.

My temporary solution was to revert back to the same version that I have on the old machine (3.2.2):
npm uninstall -g pm2
npm install -g pm2@3.2.2

Hope this helps.

@jdalton
Copy link

jdalton commented Jan 14, 2019

This issue on Windows starts with 3.2.5. I've pinned to 3.2.4 until it's resolved.

@mikebutak
Copy link
Author

I had this same problem when deploying a project on a new windows machine.

My temporary solution was to revert back to the same version that I have on the old machine (3.2.2):
npm uninstall -g pm2
npm install -g pm2@3.2.2

Hope this helps.

Thanks much @kepelrs! That solved it!

Thanks @jdalton, it'd be great for this to be fixed. Do you know whether windows is part of the team's test plan when they release updates?

@jessety
Copy link

jessety commented Jan 14, 2019

I just encountered this during QA on a machine running Windows 10 Pro (1803, OS Build 17134.523) with pm2 3.2.8 and Node 10.14.2. Attempting to add any service to pm2 via pm2 start server/index.js or pm2 start ecosystem.config.js failed every time. Curiously enough, it worked on Windows 7 with the same version of pm2.

As per @kepelrs suggestion, I altered the setup process to run npm install -g pm2@3.2.4 (thanks @jdalton!) and it worked perfectly.

@Unitech
Copy link
Owner

Unitech commented Jan 17, 2019

closing in favor of #4128

@Unitech Unitech closed this as completed Jan 17, 2019
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

5 participants