Unitech / Unitech/pm2

wrong data in pm2 jlist property versioning

Open
#3,276 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S: Open for PR SYS: API T: Bug
Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

I called pm2 jlist. In data property pm2_env.versioning I get data to another repository. In our case: our webhook repository which is used to trigger the deployment process and thus restarts the pm2 apps.
For each of our pm2 apps we have this data covered in the above data property which doesn't make a lot sense. The purpose of that object data is imo to cover the versioning data of the app repository itself. I hope I am right here.

Our webhook creates always a new child process and executes the deployment script of the appropriate app. the child process always inherits the environment of the parent process.

===============================================================================
--- PM2 REPORT (Mon Nov 13 2017 12:40:25 GMT+0000 (UTC)) ----------------------
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 2.6.1
node version         : 6.10.2
node path            : /usr/lib/node_modules/pm2/bin/pm2
argv                 : /usr/bin/nodejs,/usr/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : node
uid                  : 1000
gid                  : 1000
uptime               : 36450min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 2.6.1
node version         : 6.11.5
node path            : /usr/bin/pm2
argv                 : /home/node/.nvm/versions/node/v6.11.5/bin/node,/usr/bin/pm2,report
argv0                : node
user                 : node
uid                  : 1000
gid                  : 1000
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : Intel(R) Xeon(R) CPU E3-1271 v3 @ 3.60GHz
cpus nb              : 8
freemem              : 532135936
totalmem             : 33694265344
home                 : /home/node
===============================================================================
--- PM2 list -----------------------------------------------
┌───────────┬────┬─────────┬───────┬────────┬─────────┬────────┬─────┬────────────┬──────┬──────────┐
│ App name  │ id │ mode    │ pid   │ status │ restart │ uptime │ cpu │ mem        │ user │ watching │
├───────────┼────┼─────────┼───────┼────────┼─────────┼────────┼─────┼────────────┼──────┼──────────┤
│ CP3PRD    │ 6  │ cluster │ 26650 │ online │ 68      │ 2D     │ 0%  │ 421.4 MB   │ node │ disabled │
│ CP3PRD    │ 3  │ cluster │ 26161 │ online │ 68      │ 2D     │ 0%  │ 337.4 MB   │ node │ disabled │
│ CP3PRD    │ 4  │ cluster │ 26406 │ online │ 68      │ 2D     │ 0%  │ 407.8 MB   │ node │ disabled │
│ CP3PRD    │ 5  │ cluster │ 26615 │ online │ 68      │ 2D     │ 0%  │ 407.9 MB   │ node │ disabled │
│ CP3PRD    │ 2  │ cluster │ 26371 │ online │ 68      │ 2D     │ 0%  │ 326.8 MB   │ node │ disabled │
│ CP3PRD    │ 7  │ cluster │ 27008 │ online │ 67      │ 2D     │ 0%  │ 392.7 MB   │ node │ disabled │
│ CP3PRD    │ 8  │ cluster │ 27042 │ online │ 66      │ 2D     │ 0%  │ 441.3 MB   │ node │ disabled │
│ CP3PRD    │ 9  │ cluster │ 27076 │ online │ 66      │ 2D     │ 1%  │ 404.1 MB   │ node │ disabled │
│ PORT80APP │ 15 │ cluster │ 29843 │ online │ 0       │ 4h     │ 0%  │ 39.0 MB    │ node │ disabled │
│ TLDINFO   │ 0  │ cluster │ 27407 │ online │ 9       │ 3D     │ 0%  │ 101.4 MB   │ node │ disabled │
│ WEBHOOK   │ 16 │ cluster │ 560   │ online │ 0       │ 3h     │ 0%  │ 36.5 MB    │ node │ disabled │
└───────────┴────┴─────────┴───────┴────────┴─────────┴────────┴─────┴────────────┴──────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/node/.pm2/pm2.log last 20 lines:
PM2        | 2017-11-13 08:37:16: 14
PM2        | 2017-11-13 08:37:16: Stopping app:PORT80APP id:14
PM2        | 2017-11-13 08:37:16: App name:PORT80APP id:14 disconnected
PM2        | 2017-11-13 08:37:16: App [PORT80APP] with id [14] and pid [29094], exited with code [0] via signal [SIGINT]
PM2        | 2017-11-13 08:37:16: pid=29094 msg=process killed
PM2        | 2017-11-13 08:37:16: Starting execution sequence in -cluster mode- for app name:PORT80APP id:15
PM2        | 2017-11-13 08:37:26: App name:PORT80APP id:15 online
PM2        | 2017-11-13 08:39:07: Stopping app:WEBHOOK id:11
PM2        | 2017-11-13 08:39:07: App name:WEBHOOK id:11 disconnected
PM2        | 2017-11-13 08:39:07: App [WEBHOOK] with id [11] and pid [21068], exited with code [0] via signal [SIGINT]
PM2        | 2017-11-13 08:39:07: pid=21068 msg=process killed
PM2        | 2017-11-13 08:39:07: Starting execution sequence in -cluster mode- for app name:WEBHOOK id:11
PM2        | 2017-11-13 08:39:17: App name:WEBHOOK id:11 online
PM2        | 2017-11-13 08:39:49: 11
PM2        | 2017-11-13 08:39:49: Stopping app:WEBHOOK id:11
PM2        | 2017-11-13 08:39:49: App name:WEBHOOK id:11 disconnected
PM2        | 2017-11-13 08:39:49: App [WEBHOOK] with id [11] and pid [31075], exited with code [0] via signal [SIGINT]
PM2        | 2017-11-13 08:39:49: pid=31075 msg=process killed
PM2        | 2017-11-13 08:41:53: Starting execution sequence in -cluster mode- for app name:WEBHOOK id:16
PM2        | 2017-11-13 08:41:53: App name:WEBHOOK id:16 online

Have we to change anything in our process or is this indeed a bug?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pm2 jlist entry point and inspect the pm2_env.versioning data for an app launched by a child process inheriting the webhook environment. Reproduce the reported cross-repository value, then verify whether the output reflects the app repository and determine what behavior should be considered done.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.