egg icon indicating copy to clipboard operation
egg copied to clipboard

egg 在生产环境中某些post请求报500

Open rickytang0 opened this issue 7 years ago • 6 comments

使用的是js,没有使用ts。在开发者模式的时候能够正常使用postman发送post请求,但是在生产环境下,所有的请求就返回500.

What happens?

仓库地址

https://gitee.com/rickytang0/cplanet-extend.git

相关环境信息

  • 操作系统:windows10
  • Node 版本:8.10.0
  • Egg 版本:2.24.0

rickytang0 avatar Oct 23 '19 01:10 rickytang0

可以看下 common-error

popomore avatar Oct 23 '19 01:10 popomore

有报错的地方我都改了,现在已经没有任何报错了,但还是报500。我不知道是否是我的配置不对,但查了很多文档也没有发现什么问题。 下面就是我之前的报错,不过已经改好了。

2019-10-22 10:41:21,316 ERROR 34232 [-/192.168.0.28/-/61ms POST /addgold] nodejs.TypeError: ResultModel.createResult is not a function at GoldService.updateGold (E:\resp\cplanet-egg\cplanet-extend\app\service\gold.js:142:28) at at process._tickCallback (internal/process/next_tick.js:188:7)

pid: 34232 hostname: GZXKJYYXGS-001

rickytang0 avatar Oct 23 '19 08:10 rickytang0

自己再确认下吧,500 一般就是报错了,stderr 和 common-error。

popomore avatar Oct 23 '19 12:10 popomore

500 的错误一般就是你自己业务逻辑造成的,按照你自己的错误日志再排查下吧

hyj1991 avatar Oct 25 '19 01:10 hyj1991

没有更多信息先关闭了,有其它问题可以在这边回复再打开

hyj1991 avatar Oct 26 '19 11:10 hyj1991

有报错的地方我都改了,现在已经没有任何报错了,但还是报500。我不知道是否是我的配置不对,但查了很多文档也没有发现什么问题。 下面就是我之前的报错,不过已经改好了。

2019-10-22 10:41:21,316 ERROR 34232 [-/192.168.0.28/-/61ms POST /addgold] nodejs.TypeError: ResultModel.createResult is not a function at GoldService.updateGold (E:\resp\cplanet-egg\cplanet-extend\app\service\gold.js:142:28) at at process._tickCallback (internal/process/next_tick.js:188:7)

pid: 34232 hostname: GZXKJYYXGS-001

求问楼主的问题解决了吗?我的也出现同样的问题。 npm run start能跑起来,但是请求接口没有任何日志,直接显示:Internal Server Error, real status: 500

LeoFengFromChina avatar Jul 14 '23 10:07 LeoFengFromChina