pm2-logrotate icon indicating copy to clipboard operation
pm2-logrotate copied to clipboard

SyntaxError: Unexpected end of JSON input

Open ddzyan opened this issue 6 years ago • 4 comments

pm2-logrotate:v2.6.0 I ran "pm2 set pm2-logrotate:max_size 1K" and I got an error. image

ddzyan avatar Aug 16 '18 17:08 ddzyan

I am getting the same error, any updates?

dmitriz avatar Feb 21 '20 17:02 dmitriz

Checking this file: ~/.pm2/module_conf.json, open it. Then write in '{}', 'pm2 set' working.

Nxys avatar Feb 27 '20 13:02 Nxys

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.

dmitriz avatar Feb 27 '20 13:02 dmitriz

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:

  1. mv ~/.pm2 ~/.pm2_BAK
  2. pm2 restart (sometimes, just pm2 restart pm2-logrotate will work as well)

you may want to also try copying the /root/.pm2 folder to the user folder:

  1. sudo cp /root/.pm2 /home/user/.pm2
  2. sudo chown user:user /home/user/.pm2 <-- this is very important
  3. 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!

iansebryk avatar Dec 07 '23 16:12 iansebryk