Hi,
DOCN rebooted by droplet and now I am getting a 502 Bad Gateway error (nginx/1.18.0 (Ubuntu)). Please could someone assist what I need to do. I tried running “pm2 restart app.js” in console but getting [PM2][ERROR] Process or Namespace app.js not found.
This is really frustrating as my service is down because of Digital Ocean issue - have raised a support ticket.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Heya @yuriwhale,
When you do
Do you see your application? Try to start that one, otherwise go to yur App’s folder where the
app.js
is and try to start the pm2 process from there.Addtionally, check pm2 error log, you can either do
or go to pm2 logs and check the error log for more detailed response.
Hey @yuriwhale,
First you can check that pm2 is running. Run
pm2 status
to see if your application is listed there. If it’s not listed, you’ll need to start it again.If your application is not listed in the PM2 status, you can start it by running
pm2 start app.js
. Make sure you navigate to the directory where yourapp.js
file is located before running this command.After starting your application, monitor the logs to see if there are any errors. You can do this by running
pm2 logs
.Another thing is to check if NGINX is running and if not to restart it.
If NGINX is down, then you can restart it.
Hope that helps!