pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

pm2 module keeps restarting

Open flo-jan opened this issue 11 months ago • 3 comments

I have pm2 managing some nodejs services that I start with the command:

pm2 start /home/myuser/.node-environments/ecosystem.config.js

this works well, a subsecutive pm2 ls command shows

Image

When I come back after some days however, an additional process has started that hogs my server's cpu because it keeps restarting

Image

It is not clear where this process comes from, it might have to do with a server restart. Anyway, I can simply stop and delete the process (that always has id 0). Stopping the process does not affect my running applications.

Can someone explain my what happens here, what could be the cause and how I can fix it.

flo-jan avatar Feb 11 '25 13:02 flo-jan

I have no idea, but a bug in your code cause a server crash, which then triggers a restart over and over ?

GreenFlag31 avatar Feb 17 '25 09:02 GreenFlag31

But in that case, I would expect an attempted restart on the application itself. But as you can see in the output, pm2 lists 0 restarts on any of the running applications.

flo-jan avatar Feb 17 '25 11:02 flo-jan

I noticed that I needed autorestart: false, when I was thinking same thing.

jhalmu avatar Mar 31 '25 12:03 jhalmu