Unitech / Unitech/pm2

PM2 `Starts` and then immediately `Errors`

Open
#5,975 0 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

PM2 is managing http-server on port 8080. PM2 is starting up with an online status and then erroring out soon after in my AWS Amplify build pipeline. Below is the PM2 report:

2025-04-18T19:08:39.650Z [INFO]: # Executing command: npx pm2 start http-server -- './dist' -p 8080

2025-04-18T19:08:42.928Z [WARNING]: npx: installed 134 in 3.229s

2025-04-18T19:08:43.089Z [INFO]: [PM2] Starting /codebuild/output/src4123211847/src/websites-datadogon/node_modules/.bin/http-server in fork_mode (1 instance)

2025-04-18T19:08:43.103Z [INFO]: [PM2] Done.

2025-04-18T19:08:43.118Z [INFO]: ┌────┬────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
                                 │ id │ name           │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
                                 ├────┼────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
                                 │ 0  │ http-server    │ default     │ 1.0.0   │ fork    │ 1623     │ 0s     │ 0    │ online    │ 0%       │ 27.8mb   │ root     │ disabled │
                                 └────┴────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘

2025-04-18T19:08:43.636Z [INFO]: # Executing command: echo "report status"

                                 report status

                                 # Executing command: npx pm2 report

2025-04-18T19:08:47.268Z [WARNING]: npx: installed 134 in 3.59s

2025-04-18T19:08:47.437Z [INFO]:

 
2025-04-18T19:08:47.437Z [INFO]: --- PM2 report ----------------------------------------------------------------
                                 Date                 : Fri Apr 18 2025 19:08:47 GMT+0000 (Coordinated Universal Time)
                                 ===============================================================================
                                 --- Daemon --------------------------------------------------------------------
                                 pm2d version         : 6.0.5
                                 node version         : 14.21.3
                                 node path            : /root/.nvm/versions/node/v14.21.3/bin/npx
                                 argv                 : /root/.nvm/versions/node/v14.21.3/bin/node,/root/.npm/_npx/1544/lib/node_modules/pm2/lib/Daemon.js

2025-04-18T19:08:47.437Z [INFO]: argv0                : /root/.nvm/versions/node/v14.21.3/bin/node
                                 user                 : undefined
                                 uid                  : 0
                                 gid                  : 0

2025-04-18T19:08:47.437Z [INFO]: uptime               : 0min

2025-04-18T19:08:47.438Z [INFO]: ===============================================================================
                                 --- CLI -----------------------------------------------------------------------
                                 local pm2            : 6.0.5
                                 node version         : 14.21.3
                                 node path            : /root/.nvm/versions/node/v14.21.3/bin/npx
                                 argv                 : /root/.nvm/versions/node/v14.21.3/bin/node,/root/.npm/_npx/1697/bin/pm2,report

2025-04-18T19:08:47.438Z [INFO]: argv0                : node
                                 user                 : undefined
                                 uid                  : 0
                                 gid                  : 0
                                 ===============================================================================
                                 --- System info ---------------------------------------------------------------

2025-04-18T19:08:47.438Z [INFO]: arch                 : x64
                                 platform             : linux
                                 type                 : Linux

2025-04-18T19:08:47.455Z [INFO]: cpus                 : Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz

2025-04-18T19:08:47.455Z [INFO]: cpus nb              : 4
                                 freemem              : 841699328
                                 totalmem             : 7981080576
                                 home                 : /root
2025-04-18T19:08:47.457Z [INFO]: ===============================================================================
2025-04-18T19:08:47.457Z [INFO]: --- PM2 list ------------------------------------------------------------------
2025-04-18T19:08:47.459Z [INFO]: ┌────┬────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
                                 │ id │ name           │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
                                 ├────┼────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
                                 │ 0  │ http-server    │ default     │ 1.0.0   │ fork    │ 0        │ 0      │ 15   │ errored   │ 0%       │ 0b       │ root     │ disabled │
                                 └────┴────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
2025-04-18T19:08:47.459Z [INFO]: ===============================================================================
                                 --- Daemon logs ---------------------------------------------------------------
2025-04-18T19:08:47.461Z [INFO]: /root/.pm2/pm2.log last 20 lines:
2025-04-18T19:08:47.461Z [INFO]: PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] exited with code [1] via signal [SIGINT]
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] starting in -fork mode-
2025-04-18T19:08:47.461Z [INFO]: PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] online
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] exited with code [1] via signal [SIGINT]
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] starting in -fork mode-
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] online
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] exited with code [1] via signal [SIGINT]
2025-04-18T19:08:47.461Z [INFO]: PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] starting in -fork mode-
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] online
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] exited with code [1] via signal [SIGINT]
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] starting in -fork mode-
2025-04-18T19:08:47.461Z [INFO]: PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] online
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] exited with code [1] via signal [SIGINT]
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] starting in -fork mode-
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] online
2025-04-18T19:08:47.461Z [INFO]: PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] exited with code [1] via signal [SIGINT]
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] starting in -fork mode-
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] online
                                 PM2        | 2025-04-18T19:08:43: PM2 log: App [http-server:0] exited with code [1] via signal [SIGINT]
                                 PM2        |
2025-04-18T19:08:47.462Z [INFO]: 2025-04-18T19:08:43: PM2 log: Script /codebuild/output/src4123211847/src/websites-datadogon/node_modules/.bin/http-server had too many unstable restarts (16). Stopped. "errored"


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 npx pm2 start http-server -- './dist' -p 8080 in the reported AWS Amplify environment and inspect the PM2 daemon logs and pm2 report output. The issue names no source file, test, expected behavior, or proposed change, so the work is complete only after the failure cause and an actionable fix or reproduction are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, nodejs
Domain
cli, cloud, 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.