PM2项目启动成功但pm2 list显示errored,如何解决?-灵析社区

时光旅人

**问题描述:** 项目代码更新之后去接口访问出现了502的错误; 一开始以为是nginx配置出错了,但一想没有改动里面的配置; 然后敲了一下pm2 list命令,看看启动的情况,发现在status那一栏是errored; ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240927/98da1db1205eb89f6ccab339aec57e33.png) **pm2 logs www日志** ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240927/9fd0a9471634374762853386a55c83f4.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](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240927/d6de921a3d0b2be9a0d7521e00780b35.png) 求解,万谢

阅读量:160

点赞量:0

问AI
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240927/37a619dc3cddd99fbcda70b603897087.png) 是不是你的 node 代码报错了,导致 pm2 进程出错