PM2项目启动成功但pm2 list显示errored,如何解决?

问题描述:
项目代码更新之后去接口访问出现了502的错误;
一开始以为是nginx配置出错了,但一想没有改动里面的配置;
然后敲了一下pm2 list命令,看看启动的情况,发现在status那一栏是errored;
image.png
pm2 logs www日志
image.png
Nginx error.log

2024/05/28 02:00:38 [error] 15003#0: *3531770 connect() failed (111: Connection refused) while connecting to upstream, client: 125.111.47.152, server: _, request: "GET /mgzapi/userOOTD/all HTTP/1.1", upstream: "http://127.0.0.1:5050/mgzapi/userOOTD/all", host: "biguden.cn:5000", referrer: "https://servicewechat.com/wxc47531ec5d63e70/devtools/page-frame.html"
2024/05/28 02:00:38 [error] 15003#0: *3531770 connect() failed (111: Connection refused) while connecting to upstream, client: 125.111.47.152, server: _, request: "POST /mgzapi/userOOTD/month HTTP/1.1", upstream: "http://127.0.0.1:5050/mgzapi/userOOTD/month", host: "biguden.cn:5000", referrer: "https://servicewechat.com/wxc47531ec5d63e70/devtools/page-frame.html"
2024/05/28 02:00:38 [error] 15003#0: *3531770 connect() failed (111: Connection refused) while connecting to upstream, client: 125.111.47.152, server: _, request: "GET /mgzapi/banner/opening/1/1 HTTP/1.1", upstream: "http://127.0.0.1:5050/mgzapi/banner/opening/1/1", host: "biguden.cn:5000", referrer: "https://servicewechat.com/wxc47531ec5d64e70/devtools/page-frame.html"
2024/05/28 02:00:39 [error] 15003#0: *3531770 connect() failed (111: Connection refused) while connecting to upstream, client: 125.111.47.152, server: _, request: "GET /mgzapi/wechat/getOpenid/0d3RL2s6twd4jnl2OHous0RL5l- HTTP/1.1", upstream: "http://127.0.0.1:5050/mgzapi/wechat/getOpenid/0d3RL2s6twdjiynl2OHous0RL5l-", host: "biguden.cn:5000", referrer: "https://servicewechat.com/wxc47531ec5d6370/devtools/page-frame.html"

pm2 show www

image.png

求解,万谢

阅读 1.1k
1 个回答

image.png

是不是你的 node 代码报错了,导致 pm2 进程出错

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏