Configuration file issues
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
Your issue may already be reported!
Please search on the issue tracker before creating one.
What's going wrong?
Printing stack traces when using ecosystem.config.* file
How could we reproduce this issue?
Create ecosystem.config.{json|js} and then run pm2 start ecosystem.config.{json|js}
Supporting information
The problem is in lib/Configuration.js : the following functions are referencing cst.PM2_MODULE_CONF_FILE (where var cst = require('../constants.js');) :
Configuration.set
Configuration.unset
Configuration.setSyncIfNotExist
Configuration.setSync
Configuration.unsetSync
Configuration.getAll
Configuration.getAllSync
There is no PM2_MODULE_CONF_FILE defined in constants.js. The closest is
APP_CONF_DEFAULT_FILE. Replacing PM2_MODULE_CONF_FILE with APP_CONF_DEFAULT_FILE
makes the issue go away. Not sure if that is the correct fix.
Also, APP_CONF_DEFAULT_FILE : 'ecosystem.json'. Is the config word missed on purpose?
It seems to be out of sync with the docs at http://pm2.keymetrics.io/docs/usage/application-declaration/#json-format
Please run the following command (available on PM2 >= 2.6)
C:\Users\Stefan>pm2 report
===============================================================================
--- PM2 REPORT (Mon Mar 12 2018 02:52:48 GMT+0000 (GMT Standard Time)) --------
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 2.10.1
node version : 8.9.3
node path : undefined
argv : c:\program files\nodejs\node.exe,C:\Users\Stefan\AppData\
Roaming\npm\node_modules\pm2\lib\Daemon.js
argv0 : node
user : undefined
uid : N/A
gid : N/A
uptime : 1669min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 2.10.1
node version : 8.9.3
node path : undefined
argv : c:\program files\nodejs\node.exe,C:\Users\Stefan\AppData\
Roaming\npm\node_modules\pm2\bin\pm2,report
argv0 : node
user : Stefan
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : win32
type : Windows_NT
cpus : Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz
cpus nb : 4
freemem : 4973137920
totalmem : 16849186816
home : C:\Users\Stefan
===============================================================================
--- PM2 list -----------------------------------------------
┌──────┬─────────┬─────────┬───┬─────┬────────┐
│ Name │ mode │ status │ ? │ cpu │ memory │
├──────┼─────────┼─────────┼───┼─────┼────────┤
│ API │ cluster │ stopped │ 0 │ 0% │ 0 B │
│ API │ cluster │ stopped │ 0 │ 0% │ 0 B │
│ API │ cluster │ stopped │ 0 │ 0% │ 0 B │
│ API │ cluster │ stopped │ 0 │ 0% │ 0 B │
└──────┴─────────┴─────────┴───┴─────┴────────┘
===============================================================================
--- Daemon logs --------------------------------------------
C:\Users\Stefan\.pm2\pm2.log last 20 lines:
PM2 | [2018-03-12 02:38:39] PM2 log: App name:API id:3 online
PM2 | [2018-03-12 02:38:39] PM2 error: (node:9364) [DEP0007] DeprecationW
arning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
PM2 | [2018-03-12 02:38:39] PM2 log: App name:API id:2 online
PM2 | [2018-03-12 02:38:39] PM2 error: (node:9364) [DEP0007] DeprecationW
arning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
PM2 | [2018-03-12 02:39:22] PM2 log: Stopping app:API id:0
PM2 | [2018-03-12 02:39:22] PM2 log: Stopping app:API id:1
PM2 | [2018-03-12 02:39:22] PM2 log: App name:API id:0 disconnected
PM2 | [2018-03-12 02:39:22] PM2 log: App [API] with id [0] and pid [10800
], exited with code [1] via signal [SIGINT]
PM2 | [2018-03-12 02:39:22] PM2 log: App name:API id:1 disconnected
PM2 | [2018-03-12 02:39:22] PM2 log: App [API] with id [1] and pid [1552]
, exited with code [1] via signal [SIGINT]
PM2 | [2018-03-12 02:39:22] PM2 log: pid=10800 msg=process killed
PM2 | [2018-03-12 02:39:22] PM2 log: Stopping app:API id:2
PM2 | [2018-03-12 02:39:22] PM2 log: pid=1552 msg=process killed
PM2 | [2018-03-12 02:39:22] PM2 log: Stopping app:API id:3
PM2 | [2018-03-12 02:39:23] PM2 log: App name:API id:2 disconnected
PM2 | [2018-03-12 02:39:23] PM2 log: App [API] with id [2] and pid [5864]
, exited with code [1] via signal [SIGINT]
PM2 | [2018-03-12 02:39:23] PM2 log: App name:API id:3 disconnected
PM2 | [2018-03-12 02:39:23] PM2 log: App [API] with id [3] and pid [5832]
, exited with code [1] via signal [SIGINT]
PM2 | [2018-03-12 02:39:23] PM2 log: pid=5864 msg=process killed
PM2 | [2018-03-12 02:39:23] PM2 log: pid=5832 msg=process killed
Please copy/paste the above report in your issue on https://github.com/Unitech/p
m2/issues
C:\Users\Stefan>
Let me know if you require additional info.
Thanks!
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 with lib/Configuration.js and constants.js, then reproduce with ecosystem.config.json or ecosystem.config.js followed by pm2 start ecosystem.config.{json|js}. Trace the listed Configuration methods and verify the configuration constant and documented filename convention. Done means these commands no longer print stack traces and the intended filename behavior is consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100