Unitech / Unitech/pm2

spawn node ENOENT when starting a node app

Open
#4,936 0 comments 1 reaction 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

What's going wrong?

How could we reproduce this issue?

sudo /afc/bin/node /usr/local/bin/pm2 start index.js

Supporting information

I tried killing the pm2 process

--- PM2 report ----------------------------------------------------------------
Date                 : Fri Dec 11 2020 15:39:46 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 4.5.0
node version         : 15.4.0
node path            : not found
argv                 : /home/ubuntu/.nvm/versions/node/v15.4.0/bin/node,/usr/local/lib/node_modules/pm2/lib/Daemon.js
argv0                : /home/ubuntu/.nvm/versions/node/v15.4.0/bin/node
user                 : root
uid                  : 0
gid                  : 0
uptime               : 5min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 4.5.0
node version         : 15.4.0
node path            : not found
argv                 : /home/ubuntu/.nvm/versions/node/v15.4.0/bin/node,/usr/local/bin/pm2,report
argv0                : /afc/bin/node
user                 : root
uid                  : 0
gid                  : 0
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
cpus nb              : 2
freemem              : 1239556096
totalmem             : 2057633792
home                 : /home/ubuntu
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬──────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name     │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼──────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ index    │ default     │ 1.0.0   │ fork    │ N/A      │ 0      │ 0    │ errored   │ 0%       │ 0b       │ root     │ disabled │
└─────┴──────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/ubuntu/.pm2/pm2.log last 20 lines:
PM2        | 2020-12-11T15:34:11: PM2 log: PM2 version          : 4.5.0
PM2        | 2020-12-11T15:34:11: PM2 log: Node.js version      : 15.4.0
PM2        | 2020-12-11T15:34:11: PM2 log: Current arch         : x64
PM2        | 2020-12-11T15:34:11: PM2 log: PM2 home             : /home/ubuntu/.pm2
PM2        | 2020-12-11T15:34:11: PM2 log: PM2 PID file         : /home/ubuntu/.pm2/pm2.pid
PM2        | 2020-12-11T15:34:11: PM2 log: RPC socket file      : /home/ubuntu/.pm2/rpc.sock
PM2        | 2020-12-11T15:34:11: PM2 log: BUS socket file      : /home/ubuntu/.pm2/pub.sock
PM2        | 2020-12-11T15:34:11: PM2 log: Application log path : /home/ubuntu/.pm2/logs
PM2        | 2020-12-11T15:34:11: PM2 log: Worker Interval      : 30000
PM2        | 2020-12-11T15:34:11: PM2 log: Process dump file    : /home/ubuntu/.pm2/dump.pm2
PM2        | 2020-12-11T15:34:11: PM2 log: Concurrent actions   : 2
PM2        | 2020-12-11T15:34:11: PM2 log: SIGTERM timeout      : 1600
PM2        | 2020-12-11T15:34:11: PM2 log: ===============================================================================
PM2        | 2020-12-11T15:34:11: PM2 log: App [index:0] starting in -fork mode-
PM2        | 2020-12-11T15:34:11: PM2 log: App [index:0] online
PM2        | 2020-12-11T15:34:11: PM2 error: Error: spawn node ENOENT
PM2        |     at Process.ChildProcess._handle.onexit (node:internal/child_process:276:19)
PM2        |     at onErrorNT (node:internal/child_process:476:16)
PM2        |     at processTicksAndRejections (node:internal/process/task_queues:80:21)
PM2        | 2020-12-11T15:34:11: PM2 error: Cancelling versioning data parsing

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 reproduction command and PM2 daemon log, comparing the reported node paths and the child_process stack trace. Trace the app-start path that invokes the node executable. Done means the command starts index.js without spawn node ENOENT and PM2 reports the application online.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
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.