Unitech / Unitech/pm2

incorrect implementation of the increment_var

Open
#4,965 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?

The increment_var is implemented incorrectly.

How could we reproduce this issue?

  1. create an HTTP server
  2. make the server listen to port, which will be read from an environment variable
  3. define the said environment variable to be a string in the ecosystem.config.js. E.g.: SERVER_PORT: "9090"
  4. set the increment_var to 'SERVER_PORT' in the ecosystem.config.js
  5. run pm2 start ecosystem.config.js
  6. look at logs to see the SERVER_PORT being set to values like 90901, 909011, 9090111, etc.

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

Reproduce the issue with an HTTP server and the described ecosystem.config.js settings, focusing on increment_var and SERVER_PORT. Trace where PM2 applies increment_var, then verify that repeated starts produce numerically incremented port values rather than concatenated strings.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.