Unitech / Unitech/pm2

startOrRestart not loading new configuration

Open
#5,727 2 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

What's going wrong?

In one of my configurations, I removed the log_type: 'json' parameter. When I ran pm2 startOrRestart {{ pm2_config_file }} --update-env and checked pm2 env {{ process_id }}, I could still see log_type: json was there. My understanding is that startOrRestart should have loaded the changes made to the config file, but none of the logs are reflecting that change. When I run pm2 delete {{ process_id }} && pm2 start {{ pm2_config_file }} I no longer see the log_type parameter in the pm2 env output.

How could we reproduce this issue?

  • Create a PM2 config file with log_type: 'json' present
  • Run pm2 env {{ process_id }} to ensure log-type: json is present
  • Remove log_type: 'json' from the config file
  • Run a pm2 startOrRestart command on the config file
  • Run a pm2 env command to see if the log_type parameter is still visible.

Supporting information

$ pm2 report
--- Daemon -------------------------------------------------
pm2d version         : 5.3.0
node version         : 18.19.0
--- CLI ----------------------------------------------------
local pm2            : 5.3.0
node version         : 18.19.0
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux

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 behavior with the listed pm2 startOrRestart, pm2 env, delete, and start commands using a configuration that removes log_type. Compare the environment after restart with the environment after delete and start; done means the removed log_type setting no longer appears after startOrRestart. The issue names no source files or tests, so the relevant command entry points will need to be located first.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.