hello , i have problem that pm2 kill a specific app process ( nest.js node.js. api ) at random time either weekly or daily with no reason and even if no errors in app logs , and tries to restart the process by itself , sometimes it success to restart it ,it-self after a while and some time it can’t
here is a sample of pm2 logs of killing the app at 8:13 am and tries to restart it every 100ms but failed at the end
2022-07-28T08:13:34: PM2 log: Stopping app:sal-api id:0
2022-07-28T08:13:34: PM2 log: Stopping app:sal-user id:1
2022-07-28T08:13:34: PM2 log: pid=229164 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:34: PM2 log: App [sal-api:0] exited with code [0] via signal [SIGINT]
2022-07-28T08:13:34: PM2 log: App [sal-user:1] exited with code [0] via signal [SIGINT]
2022-07-28T08:13:34: PM2 log: pid=229154 msg=process killed
2022-07-28T08:13:34: PM2 log: App [sal-api:0] starting in -fork mode-
2022-07-28T08:13:34: PM2 log: App [sal-api:0] online
2022-07-28T08:13:34: PM2 log: Stopping app:sal-admin id:2
2022-07-28T08:13:34: PM2 log: pid=229164 msg=process killed
2022-07-28T08:13:34: PM2 log: App [sal-user:1] starting in -fork mode-
2022-07-28T08:13:34: PM2 log: App [sal-user:1] online
2022-07-28T08:13:34: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:34: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:34: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:34: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:34: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:34: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: pid=229206 msg=failed to kill - retrying in 100ms
2022-07-28T08:13:35: PM2 log: Process with pid 229206 still alive after 1600ms, sending it SIGKILL now…
2022-07-28T08:13:35: PM2 log: App [sal-admin:2] exited with code [0] via signal [SIGKILL]
2022-07-28T08:13:36: PM2 log: pid=229206 msg=process killed
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @smartsway,
Check your other logs, I’ll assume PM2 might be killing the process due to another reason like high load/ your server being out of memory. Check the logs in /var/log, they might give you another hint.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.