PM2 not reflecting changes after modifying file
Opened this issue ยท 10 comments
PM2 not reflecting changes after modifying file
Steps to reproduce:
I run approx 25 servers running 4 instances/clusters each on Windows running on a 4 core CPU.
After I make any change on any file it restarts the respective server, however it doesn't reflect new changes and continues to show old changes only.
Then I am forced to do the following steps for the changes to reflect.
$ pm2 stop all
$ pm2 kill
$ pm2 start... (one by one)
Supporting information
OS: Windows
Still experiencing this with pm2 4.5.0
Same happened for me today
OS: Windows
Pm2 version: 5.2.0
Tried below steps: File change detection works again like @KnightCoder mentioned
pm2 stop all
pm2 delete all
pm2 start ...
Hi, I have same problem with you.
OS: AlmaLinux 8.5
Node Version: 12.22.10
PM2 Version: 5.2.0
This step is a workaround.
pm2 stop all
pm2 delete all
pm2 start ...
However. It looks like it does not reload change on some lines.
Hi, I have same problem with you.
OS: AlmaLinux 8.5 Node Version: 12.22.10 PM2 Version: 5.2.0
This step is a workaround. pm2 stop all pm2 delete all pm2 start ...
However. It looks like it does not reload change on some lines.
I got it, very useful! Thank you @sgnsys3
Can we find a solution to this? more than 1 year openned
Facing same issue on Ubuntu
This bug is still there (ubuntu). Any updates on how to force PM2 to forget the old version of the code? I've tried to stop/delete the app, then start again - nothing changed. Deleted the compiled dist
folder and tried to start again, PM2 got the dist folder (updated) from somewhere but still running the old code.
This bug is still there (ubuntu). Any updates on how to force PM2 to forget the old version of the code? I've tried to stop/delete the app, then start again - nothing changed. Deleted the compiled
dist
folder and tried to start again, PM2 got the dist folder (updated) from somewhere but still running the old code.
This is happening to me too, I deleted the dist folder too and rebuild the code but pm2 is still running the old code.
This bug is still there (ubuntu). Any updates on how to force PM2 to forget the old version of the code? I've tried to stop/delete the app, then start again - nothing changed. Deleted the compiled
dist
folder and tried to start again, PM2 got the dist folder (updated) from somewhere but still running the old code.This is happening to me too, I deleted the dist folder too and rebuild the code but pm2 is still running the old code.
I had the same issue and made it work that way :
- ps ax | grep pm2
will show you all the god deamons pm2 has running
- kill all the PIDs of the god daemons ( sudo kill -9 PID)
- start pm2 normally. It should work fine
Problem i had was that i started pm2 with different user and it bugged out. but anyways killing the god deamons should do it either way
Hope that helped
I'm not sure if this is related to this bug, but we were running into this same issue and it turned out our server code folder was a symlink that got updated on each code deployment to a new folder with the latest code.
So, whenever we ran the pm2 restart
command, pm2 wasn't looking at the files that we just deployed and re-symlinked, it was using the old folder that got cached somewhere in pm2. So, on code deployments, even though we were technically "in" the current symlinked folder and its code was updated, pm2 was still referencing the older code folder that we were in when we ran the original pm2 start
command.
We verified this theory by copying files from the new build folder back to the folder that was "current" when pm2 start
was run, then we ran a pm2 restart
and the files were all updated correctly.
Maybe not the same issue, but I figured I'd share in case it might help save someone else time in the future.