Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cron resurrect #4733

Closed
zored opened this issue Jun 4, 2020 · 1 comment
Closed

cron resurrect #4733

zored opened this issue Jun 4, 2020 · 1 comment

Comments

@zored
Copy link

zored commented Jun 4, 2020

What's going wrong?

Cron doesn't start on resurrect.

How could we reproduce this issue?

Start app that logs ok every minute.

echo "console.log('ok')" > ~/sample.js
pm2 start ~/sample.js  \
    --name="example" \
    --cron "*/1 * * * *" \
    --time \
    --no-autorestart

pm2 logs # - ok!

Save it.

pm2 save

Reboot computer. Resurrect:

pm2 resurrect

No logs:

pm2 logs # - not ok!

Supporting information

--- PM2 report ----------------------------------------------------------------
Date                 : Fri Jun 05 2020 01:14:23 GMT+0300 (Moscow Standard Time)
===============================================================================
--- Daemon --------------------------------------------------------------------
pm2d version         : 4.4.0
node version         : 14.3.0
node path            : /usr/local/lib/node_modules/pm2/bin/pm2
argv                 : /usr/local/Cellar/node/14.3.0_1/bin/node,/usr/local/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : r.akhmerov
uid                  : 502
gid                  : 20
uptime               : 11min
===============================================================================
--- CLI -----------------------------------------------------------------------
local pm2            : 4.4.0
node version         : 14.3.0
node path            : /usr/local/bin/pm2
argv                 : /usr/local/Cellar/node/14.3.0_1/bin/node,/usr/local/bin/pm2,report
argv0                : node
user                 : r.akhmerov
uid                  : 502
gid                  : 20
===============================================================================
--- System info ---------------------------------------------------------------
arch                 : x64
platform             : darwin
type                 : Darwin
cpus                 : Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
cpus nb              : 16
freemem              : 5899280384
totalmem             : 17179869184
home                 : /Users/r.akhmerov
===============================================================================
--- PM2 list ------------------------------------------------------------------
┌─────┬──────────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name                 │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼──────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 2   │ example              │ default     │ N/A     │ fork    │ N/A      │ 0      │ 0    │ stopped   │ 0%       │ 0b       │ r.akhme… │ disabled │
└─────┴──────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs ---------------------------------------------------------------
/Users/r.akhmerov/.pm2/pm2.log last 20 lines:
PM2        | 2020-06-05T01:00:24: PM2 log: Deleting process 1
PM2        | 2020-06-05T01:00:24: PM2 log: Deleting process 2
PM2        | 2020-06-05T01:00:24: PM2 log: [PM2] Deregistering a cron job on: 2
PM2        | 2020-06-05T01:00:24: PM2 log: Exited peacefully
PM2        | 2020-06-05T01:03:08: PM2 log: ===============================================================================
PM2        | 2020-06-05T01:03:08: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
PM2        | 2020-06-05T01:03:08: PM2 log: Time                 : Fri Jun 05 2020 01:03:08 GMT+0300 (Moscow Standard Time)
PM2        | 2020-06-05T01:03:08: PM2 log: PM2 version          : 4.4.0
PM2        | 2020-06-05T01:03:08: PM2 log: Node.js version      : 14.3.0
PM2        | 2020-06-05T01:03:08: PM2 log: Current arch         : x64
PM2        | 2020-06-05T01:03:08: PM2 log: PM2 home             : /Users/r.akhmerov/.pm2
PM2        | 2020-06-05T01:03:08: PM2 log: PM2 PID file         : /Users/r.akhmerov/.pm2/pm2.pid
PM2        | 2020-06-05T01:03:08: PM2 log: RPC socket file      : /Users/r.akhmerov/.pm2/rpc.sock
PM2        | 2020-06-05T01:03:08: PM2 log: BUS socket file      : /Users/r.akhmerov/.pm2/pub.sock
PM2        | 2020-06-05T01:03:08: PM2 log: Application log path : /Users/r.akhmerov/.pm2/logs
PM2        | 2020-06-05T01:03:08: PM2 log: Worker Interval      : 30000
PM2        | 2020-06-05T01:03:08: PM2 log: Process dump file    : /Users/r.akhmerov/.pm2/dump.pm2
PM2        | 2020-06-05T01:03:08: PM2 log: Concurrent actions   : 2
PM2        | 2020-06-05T01:03:08: PM2 log: SIGTERM timeout      : 1600
PM2        | 2020-06-05T01:03:08: PM2 log: ===============================================================================

  • I rebooted and resurrected at 01:10.
@Unitech
Copy link
Owner

Unitech commented Dec 16, 2020

fixed in pm2@4.5.1:

npm install pm2@latest -g
pm2 update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants