I recently updated my self-hosted linux server on compute engine. Pm2 had been working perfectly along my github actions previously. However after update when i restart a pm2 instance from my ssh terminal it works fine. But when I try to restart pm2 instance from github actions jobs then it throws me this error. I've uninstall and reinstalled pm2 but still the same error. Previously it worked fine but now it shows me this error.
So if i run the github action then this error shows

But when i run the same command from ssh termianl connected to my server then it works fine

Any help would be appreciated
PM2_HOME correctly.PM2_HOME from ChatGPT: PM2_HOME is an environment variable that specifies the directory where PM2 stores its configuration files and data, including log files, process lists, and keys. By default, if PM2_HOME is not set, PM2 uses the .pm2 folder in the user's home directory (e.g., ~/.pm2 on Linux or macOS).PM2_HOME is not set, the CI tool will use its own PM2 process (which is different from the PM2 process in your ssh), so the PM2 of the process cannot find the target service.PM2_HOME: PM2_HOME='<your pm2 home>' pm2 <command>PM2_HOME in .bashrc/.shrc/.zshrcps aux|grep PM2
PM2_HOME as these paths and view the services managed by these pm2 processes.
PM2_HOME='.pm2' pm2 lsFirst, Kill the processes via ssh.
Then, do pm2 restart ecosystem.config.js via Github CI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With