Unitech / Unitech/pm2

PM2 error: Trace: Error: spawn E2BIG

Open
#5,377 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

We are facing this issue while deploying our application with node version of 16.14.0. Below are the error details
2022-06-15T07:44:38: PM2 log: Launching in no daemon mode
2022-06-15T07:44:39: PM2 log: App [index:0] starting in -cluster mode-
2022-06-15T07:44:40: PM2 error: Trace: Error: spawn E2BIG
at ChildProcess.spawn (node:internal/child_process:413:11)
at spawn (node:child_process:700:9)
at fork (node:child_process:166:10)
at createWorkerProcess (node:internal/cluster/primary:144:10)
at EventEmitter.cluster.fork (node:internal/cluster/primary:179:25)
at Object.nodeApp (/node_modules/pm2/lib/God/ClusterMode.js:48:21)
at Object.executeApp (/node_modules/pm2/lib/God.js:232:9)
at inject (/node_modules/pm2/lib/God.js:146:18)
at Object.injectVariables (/node_modules/pm2/lib/God.js:573:10)
at /node_modules/pm2/lib/God.js:144:9 {
errno: -7,
code: 'E2BIG',
syscall: 'spawn'
}
at Object.God.logAndGenerateError (/node_modules/pm2/lib/God/Methods.js:34:15)
at Object.nodeApp (/node_modules/pm2/lib/God/ClusterMode.js:50:11)
at Object.executeApp (/node_modules/pm2/lib/God.js:232:9)
at inject (/node_modules/pm2/lib/God.js:146:18)
at Object.injectVariables (/node_modules/pm2/lib/God.js:573:10)
at /node_modules/pm2/lib/God.js:144:9
at /node_modules/async/internal/map.js:22:9
at replenish (/node_modules/async/internal/eachOfLimit.js:81:17)
at /node_modules/async/internal/eachOfLimit.js:86:9
at _asyncMap (/node_modules/async/internal/map.js:20:12)
2022-06-15T07:44:40: PM2 error: spawn E2BIG

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 by reproducing the deployment with Node 16.14.0 in cluster mode and read the stack locations in lib/God/ClusterMode.js and lib/God.js. Trace the spawn E2BIG failure and define a fix that prevents or clearly reports the failure, then verify the same launch path succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.