pm2-logrotate
pm2-logrotate copied to clipboard
SyntaxError: Unexpected end of JSON input
pm2-logrotate:v2.6.0
I ran "pm2 set pm2-logrotate:max_size 1K" and I got an error.
I am getting the same error, any updates?
Checking this file: ~/.pm2/module_conf.json, open it. Then write in '{}', 'pm2 set' working.
I had fixed the problem by manually deleting the huge log files previously created, then deleting the entire .pm2
directory and restarting the whole process together with pm2-logrotate
.
for those who are interested in how this is done, specifically, when you're having to do this on a running system and people are breathing down your neck:
-
mv ~/.pm2 ~/.pm2_BAK
-
pm2 restart
(sometimes, justpm2 restart pm2-logrotate
will work as well)
you may want to also try copying the /root/.pm2
folder to the user folder:
-
sudo cp /root/.pm2 /home/user/.pm2
-
sudo chown user:user /home/user/.pm2
<-- this is very important -
pm2 restart
to check that all is well, run pm2 list
and you should see your running modules listed without errors.
hope this is helpful to those of us in the field trying to fix stuff on shaky SIM connexions. :) good luck!