Skip to content

pm2 startOrReload ecosystem.config.js --update-env not working #3587

@cmal

Description

@cmal

Your issue may already be reported!
Please search on the issue tracker before creating one.

What's going wrong?

pm2 startOrReload ecosystem.config.js --update-env not working

How could we reproduce this issue?

  apps : [

    // First application
    {
       exec_mode : 'cluster',
       some_env: 'not working'   // <== this will not apply when running --update-env
    }
   }
  ]

Supporting information

Please run the following command (available on PM2 >= 2.6)

$ pm2 report

===============================================================================
--- PM2 REPORT (Tue Apr 03 2018 19:58:05 GMT+0800 (CST)) ----------------------
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 2.10.2
node version         : 8.9.3
node path            : /home/works/.nvm/versions/node/v8.9.3/bin/pm2
argv                 : /home/works/.nvm/versions/node/v8.9.3/bin/node,/home/works/.nvm/versions/node/v8.9.3/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : works
uid                  : 500
gid                  : 500
uptime               : 1450min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 2.10.2
node version         : 8.9.3
node path            : /home/works/.nvm/versions/node/v8.9.3/bin/pm2
argv                 : /home/works/.nvm/versions/node/v8.9.3/bin/node,/home/works/.nvm/versions/node/v8.9.3/bin/pm2,report
argv0                : node
user                 : works
uid                  : 500
gid                  : 500
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
cpus nb              : 8
freemem              : 1188663296
totalmem             : 16858710016
home                 : /home/works
===============================================================================
--- PM2 list -----------------------------------------------
┌────────────────────┬────┬─────────┬──────┬────────┬─────────┬────────┬─────┬───────────┬───────┬──────────┐
│ App name           │ id │ mode    │ pid  │ status │ restart │ uptime │ cpu │ mem       │ user  │ watching │
├────────────────────┼────┼─────────┼──────┼────────┼─────────┼────────┼─────┼───────────┼───────┼──────────┤
│ log-http           │ 9  │ fork    │ 7877 │ online │ 0       │ 24h    │ 0%  │ 37.2 MB   │ works │ disabled │
│ log-https          │ 10 │ fork    │ 7900 │ online │ 0       │ 24h    │ 0%  │ 38.4 MB   │ works │ disabled │
│ m-https            │ 1  │ cluster │ 6957 │ online │ 109     │ 2m     │ 9%  │ 91.0 MB   │ works │ disabled │
│ m-https            │ 3  │ cluster │ 6962 │ online │ 109     │ 2m     │ 9%  │ 89.2 MB   │ works │ disabled │
│ m-https            │ 4  │ cluster │ 6998 │ online │ 110     │ 2m     │ 11% │ 90.9 MB   │ works │ disabled │
│ pm2-http-interface │ 12 │ fork    │ 4853 │ online │ 0       │ 10m    │ 0%  │ 28.1 MB   │ works │ disabled │
│ pull-app-content   │ 2  │ fork    │ 6631 │ online │ 201     │ 3m     │ 0%  │ 33.4 MB   │ works │ disabled │
│ web-https          │ 11 │ fork    │ 7944 │ online │ 0       │ 24h    │ 1%  │ 45.9 MB   │ works │ disabled │
└────────────────────┴────┴─────────┴──────┴────────┴─────────┴────────┴─────┴───────────┴───────┴──────────┘
 Module activated
┌───────────┬─────────┬────────────┬────────┬─────────┬─────┬──────────────┬───────┐
│ Module    │ version │ target PID │ status │ restart │ cpu │ memory       │ user  │
├───────────┼─────────┼────────────┼────────┼─────────┼─────┼──────────────┼───────┤
│ pm2-redis │ 2.1.0   │ 25216      │ online │ 383     │ 1%  │ 623.199 MB   │ works │
└───────────┴─────────┴────────────┴────────┴─────────┴─────┴──────────────┴───────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/works/.pm2/pm2.log last 20 lines:
PM2        | [2018-04-03 19:55:39] PM2 log: Starting execution sequence in -cluster mode- for app name:m-https id:3
PM2        | [2018-04-03 19:55:39] PM2 log: App name:m-https id:1 online
PM2        | [2018-04-03 19:55:39] PM2 log: App name:m-https id:3 online
PM2        | [2018-04-03 19:55:40] PM2 log: -reload- New worker listening
PM2        | [2018-04-03 19:55:40] PM2 log: Stopping app:m-https id:_old_1
PM2        | [2018-04-03 19:55:40] PM2 log: -reload- New worker listening
PM2        | [2018-04-03 19:55:40] PM2 log: Stopping app:m-https id:_old_3
PM2        | [2018-04-03 19:55:40] PM2 log: App name:m-https id:_old_1 disconnected
PM2        | [2018-04-03 19:55:40] PM2 log: App [m-https] with id [_old_1] and pid [6611], exited with code [0] via signal [SIGINT]
PM2        | [2018-04-03 19:55:40] PM2 log: App name:m-https id:_old_3 disconnected
PM2        | [2018-04-03 19:55:40] PM2 log: App [m-https] with id [_old_3] and pid [6616], exited with code [0] via signal [SIGINT]
PM2        | [2018-04-03 19:55:40] PM2 log: pid=6611 msg=process killed
PM2        | [2018-04-03 19:55:40] PM2 log: Starting execution sequence in -cluster mode- for app name:m-https id:4
PM2        | [2018-04-03 19:55:40] PM2 log: pid=6616 msg=process killed
PM2        | [2018-04-03 19:55:40] PM2 log: App name:m-https id:4 online
PM2        | [2018-04-03 19:55:41] PM2 log: -reload- New worker listening
PM2        | [2018-04-03 19:55:41] PM2 log: Stopping app:m-https id:_old_4
PM2        | [2018-04-03 19:55:41] PM2 log: App name:m-https id:_old_4 disconnected
PM2        | [2018-04-03 19:55:41] PM2 log: App [m-https] with id [_old_4] and pid [6670], exited with code [0] via signal [SIGINT]
PM2        | [2018-04-03 19:55:41] PM2 log: pid=6670 msg=process killed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions