PM2 global error caught
Open
Nobody has claimed this yet.
Inspecting
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
Stop all pm2 apps. (Restarted)
How could we reproduce this issue?
Checking from logs?
Supporting information
PM2 version : 4.2.0
Node.js version : 12.13.1
Debian 10 x64
Log details
2020-03-09T18:43:42: PM2 log: ===============================================================================
2020-03-09T18:43:42: PM2 log: --- PM2 global error caught ---------------------------------------------------
2020-03-09T18:43:42: PM2 log: Time : Mon Mar 09 2020 18:43:42 GMT+0700 (Western Indonesia Time)
2020-03-09T18:43:42: PM2 error: Cannot read property 'writable' of undefined
2020-03-09T18:43:42: PM2 error: TypeError: Cannot read property 'writable' of undefined
at PubSocket.send (/usr/lib/node_modules/pm2/node_modules/pm2-axon/lib/sockets/pub.js:47:14)
at EventEmitter.<anonymous> (/usr/lib/node_modules/pm2/lib/Daemon.js:445:14)
at EventEmitter.emit (/usr/lib/node_modules/pm2/node_modules/eventemitter2/lib/eventemitter2.js:330:22)
at Socket.forkOutData (/usr/lib/node_modules/pm2/lib/God/ForkMode.js:193:17)
at Socket.emit (events.js:210:5)
at Socket.EventEmitter.emit (domain.js:498:23)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)
2020-03-09T18:43:42: PM2 log: ===============================================================================
2020-03-09T18:43:42: PM2 error: [PM2] Resurrecting PM2
internal/modules/cjs/loader.js:800
throw err;
^
Error: Cannot find module '/undefined'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
2020-03-09T18:43:42: PM2 log: PM2 successfully forked
2020-03-09T18:43:44: PM2 log: ===============================================================================
2020-03-09T18:43:44: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
2020-03-09T18:43:44: PM2 log: Time : Mon Mar 09 2020 18:43:44 GMT+0700 (Western Indonesia Time)
2020-03-09T18:43:44: PM2 log: PM2 version : 4.2.0
2020-03-09T18:43:44: PM2 log: Node.js version : 12.13.1
2020-03-09T18:43:44: PM2 log: Current arch : x64
2020-03-09T18:43:44: PM2 log: PM2 home : /root/.pm2
2020-03-09T18:43:44: PM2 log: PM2 PID file : /root/.pm2/pm2.pid
2020-03-09T18:43:44: PM2 log: RPC socket file : /root/.pm2/rpc.sock
2020-03-09T18:43:44: PM2 log: BUS socket file : /root/.pm2/pub.sock
2020-03-09T18:43:44: PM2 log: Application log path : /root/.pm2/logs
2020-03-09T18:43:44: PM2 log: Worker Interval : 30000
2020-03-09T18:43:44: PM2 log: Process dump file : /root/.pm2/dump.pm2
2020-03-09T18:43:44: PM2 log: Concurrent actions : 2
2020-03-09T18:43:44: PM2 log: SIGTERM timeout : 1600
2020-03-09T18:43:44: PM2 log: ===============================================================================
2020-03-09T18:43:44: PM2 log: App [pm2-logrotate:0] starting in -fork mode-
2020-03-09T18:43:44: PM2 log: App [pm2-logrotate:0] online
2020-03-09T18:43:45: PM2 log: Stopping app:pm2-logrotate id:0
2020-03-09T18:43:45: PM2 error: Cancelling versioning data parsing
2020-03-09T18:43:45: PM2 log: App [pm2-logrotate:0] exited with code [0] via signal [SIGINT]
2020-03-09T18:43:45: PM2 log: pid=23598 msg=process killed
2020-03-09T18:43:45: PM2 log: PM2 successfully stopped
2020-03-09T18:46:45: PM2 log: ===============================================================================
2020-03-09T18:46:45: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
2020-03-09T18:46:45: PM2 log: Time : Mon Mar 09 2020 18:46:45 GMT+0700 (Western Indonesia Time)
2020-03-09T18:46:45: PM2 log: PM2 version : 4.2.0
2020-03-09T18:46:45: PM2 log: Node.js version : 12.13.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the restart or stop-all sequence described in the issue and inspect the stack trace locations in pm2-axon/lib/sockets/pub.js, lib/Daemon.js, and lib/God/ForkMode.js. Trace why the socket state becomes undefined and why resurrection attempts to load /undefined; done means the sequence completes without the global error or module-not-found failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100