Disable cron-restart not working
pm2 v4.5.6 node.js v14.16.1
I'm trying to disable cron-restart using this command (as mentioned here: https://pm2.keymetrics.io/docs/usage/restart-strategies/) but is not working
pm2 restart app --cron-restart 0
I got this error:
Use --update-env to update environment variables
[PM2] cron restart at 0
/home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/lib/API.js:1611
delete appConf.args;
^
TypeError: Cannot convert undefined or null to object
at API._handleAttributeUpdate (/home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/lib/API.js:1611:7)
at API._operate (/home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/lib/API.js:1328:19)
at API.restart (/home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/lib/API.js:521:12)
at /home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/lib/binaries/CLI.js:373:11
at /home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/node_modules/async/internal/withoutIndex.js:8:40
at replenish (/home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/node_modules/async/internal/eachOfLimit.js:81:17)
at /home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/node_modules/async/internal/eachOfLimit.js:86:9
at eachLimit (/home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/node_modules/async/forEachLimit.js:47:43)
at awaitable (/home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/node_modules/async/internal/awaitify.js:13:28)
at Command.<anonymous> (/home/ubuntu/.nvm/versions/node/v14.16.1/lib/node_modules/pm2/lib/binaries/CLI.js:372:5)
Am I doing something wrong? How can I disable con-restart?
Upgrading to pm2 v5.2.2 solved the problem. Still wondering how to disable cron-restart on pm2 v4
+1
I still have this issue in the latest version 5.3.1 I cant set a new cron either.
Running:
pm2 restart 0 --cron "*/3 * * *"
Gives me:
/usr/local/lib/node_modules/pm2/lib/API.js:1608 delete appConf.args; ^
TypeError: Cannot convert undefined or null to object at API._handleAttributeUpdate (/usr/local/lib/node_modules/pm2/lib/API.js:1608:7) at API._operate (/usr/local/lib/node_modules/pm2/lib/API.js:1325:19) at API.restart (/usr/local/lib/node_modules/pm2/lib/API.js:518:12) at /usr/local/lib/node_modules/pm2/lib/binaries/CLI.js:374:11 at /usr/local/lib/node_modules/pm2/node_modules/async/internal/withoutIndex.js:8:40 at replenish (/usr/local/lib/node_modules/pm2/node_modules/async/internal/eachOfLimit.js:81:17) at /usr/local/lib/node_modules/pm2/node_modules/async/internal/eachOfLimit.js:86:9 at eachLimit (/usr/local/lib/node_modules/pm2/node_modules/async/forEachLimit.js:47:45) at awaitable (/usr/local/lib/node_modules/pm2/node_modules/async/internal/awaitify.js:14:28) at Command.
(/usr/local/lib/node_modules/pm2/lib/binaries/CLI.js:373:5) Node.js v21.6.1