Open mikegwhit opened 1 year ago
Adding conclusive remarks that, upon trying to run PM2 as multiple different users, this may be related to a file permissions issue on the .logs
folder generated. PM2 should throw this error when calling pm2.start
.
This use case occurred because user (me) tried to start PM2 from different users for security purposes. Without strictly starting PM2 as one user or another, relied on shared access via linux groups and/or ACL's. I forgot to add the default user to the proper group.
Leaving open for someone else to review, but conclusion is to run:
pm2 report
Running pm2 report
generates the debug info with the EACCESS error that resolved this. May consider for DX bubbling error to pm2.start
API.
What's going wrong?
When running PM2 start from the JavaScript API, an empty array is returned with no error. The process does not start, nor is there a record of it using
pm2 list
. Running PM2 as a different user resolves this. Deleting the PM2 cache usingrm -rf ~/.pm2
does not resolve this. Running the PM2 command directly resolves this (instead of via PM2 JS API). Running via CLI resolves this. Killing all processes withpm2
in the name does not resolve this.However, using the CLI, this works:
How could we reproduce this issue?
Hard to repro. I imagine this is a caching issue.
Supporting information
v5.1.2 Node v19.5.0