Pm2 start erases my app files
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
Running on: Ubuntu 20.04 - Pm2 5.1.1 - node 16.7 - npm 7.20.3
I have an npm global install of PM2, when I change to the app folder and do a pm2 start app ... everything is fine
I tried to make another folder specific for PM2 to save the config file
$ cd
$ mkdir pm2
And then
$ pm2 init simple
When I edit the config file
module.exports = {
apps : [{
name : "app1",
script : "../apps/app1/index.js"
}]
}
$ cd /apps/app1
$ pm2 start index.js
These files replace my app files and everything is erased in the /apps/app1 folder
ecosystem.config.js modules pids pub.sock
logs package.json pm2.log rpc.sock
module_conf.json package-lock.json pm2.pid touch
Is this a bug or I am doing something wrong?
2021-08-19T20:32:27: PM2 log: ===============================================================================
2021-08-19T20:32:27: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
2021-08-19T20:32:27: PM2 log: Time : Thu Aug 19 2021 20:32:27 GMT+0000 (Coordinated Universal Time)
2021-08-19T20:32:27: PM2 log: PM2 version : 5.1.0
2021-08-19T20:32:27: PM2 log: Node.js version : 16.6.2
2021-08-19T20:32:27: PM2 log: Current arch : x64
2021-08-19T20:32:27: PM2 log: PM2 home : /root/.pm2
2021-08-19T20:32:27: PM2 log: PM2 PID file : /root/.pm2/pm2.pid
2021-08-19T20:32:27: PM2 log: RPC socket file : /root/.pm2/rpc.sock
2021-08-19T20:32:27: PM2 log: BUS socket file : /root/.pm2/pub.sock
2021-08-19T20:32:27: PM2 log: Application log path : /root/.pm2/logs
2021-08-19T20:32:27: PM2 log: Worker Interval : 30000
2021-08-19T20:32:27: PM2 log: Process dump file : /root/.pm2/dump.pm2
2021-08-19T20:32:27: PM2 log: Concurrent actions : 2
2021-08-19T20:32:27: PM2 log: SIGTERM timeout : 1600
2021-08-19T20:32:27: PM2 log: ===============================================================================
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported sequence with pm2 init simple, the shown ecosystem.config.js, and pm2 start index.js on Ubuntu 20.04. Start by tracing how PM2 resolves its working directory and generated files; done means starting the app no longer replaces or creates PM2 files inside /apps/app1 unexpectedly.
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