Unitech / Unitech/pm2

pm2 crashes with too many unstable restarts on scripts.sh

Open
#4,545 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

i am writing my scripts in python and run this script using pm2 like we run normally the node.js scripts but some after the error display like this.

I do:

pm2 start script.sh

The app doesn't start and I get this repeated in the logs:

root@ubuntu-s-photomaths:/var/www/html/sym_math# pm2 logs

[TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option)
/root/.pm2/pm2.log last 15 lines:

PM2 | 2019-12-11T04:29:23: PM2 log: App [script:0] online
PM2 | 2019-12-11T04:29:23: PM2 log: App [script:0] exited with code [0] via signal [SIGINT]
PM2 | 2019-12-11T04:29:23: PM2 log: App [script:0] starting in -fork mode-
PM2 | 2019-12-11T04:29:23: PM2 log: App [script:0] online
PM2 | 2019-12-11T04:29:24: PM2 log: App [script:0] exited with code [0] via signal [SIGINT]
PM2 | 2019-12-11T04:29:24: PM2 log: App [script:0] starting in -fork mode-
PM2 | 2019-12-11T04:29:24: PM2 log: App [script:0] online
PM2 | 2019-12-11T04:29:25: PM2 log: App [script:0] exited with code [0] via signal [SIGINT]
PM2 | 2019-12-11T04:29:25: PM2 log: App [script:0] starting in -fork mode-
PM2 | 2019-12-11T04:29:25: PM2 log: App [script:0] online
PM2 | 2019-12-11T04:29:26: PM2 log: App [script:0] exited with code [0] via signal [SIGINT]
PM2 | 2019-12-11T04:29:26: PM2 log: App [script:0] starting in -fork mode-
PM2 | 2019-12-11T04:29:26: PM2 log: App [script:0] online
PM2 | 2019-12-11T04:29:26: PM2 log: App [script:0] exited with code [0] via signal [SIGINT]
PM2 | 2019-12-11T04:29:26: PM2 log: Script /var/www/html/sym_math/script.sh had too many unstable restarts (16). Stopped. "errored"
****]

my error logs can be display like this

/root/.pm2/logs/script-error.log last 15 lines:
0|script |
0|script | Usage:
0|script | kill [options] [...]
0|script |
0|script | Options:
0|script | [...] send signal to every listed
0|script | -, -s, --signal
0|script | specify the to be sent
0|script | -l, --list=[] list all signal names, or convert one to a name
0|script | -L, --table list all signal names in a nice table
0|script |
0|script | -h, --help display this help and exit
0|script | -V, --version output version information and exit
0|script |
0|script | For more details see kill(1).

can anyone please help me about this

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 reviewing the pm2 start script.sh command and the repeated entries in the PM2 log, then compare them with the script-error.log output showing kill usage. The issue is done only when the script can be started through PM2 without repeated exits or an unstable-restarts error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, python, shell, ubuntu
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.