tumobi / nideshop

NideShop 开源微信小程序商城服务端 API(Node.js + ThinkJS)

Home Page:https://www.nideshop.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

为什么出现500错误

samwang2017 opened this issue · comments

### `[root@hZ ~]# curl -I http://127.0.0.1:8360/

HTTP/1.1 500 Internal Server Error
Vary: Origin
X-Powered-By: thinkjs-3.2.8
Content-Type: text/html; charset=utf-8
Content-Length: 87146
Date: Wed, 15 Aug 2018 07:41:33 GMT
Connection: keep-alive
`

先使用 npm start 启动程序,查看控制台报错信息

`[root@iZ nideshop]# npm start

nideshop@1.0.0 start /var/www/nideshop
node development.js

[2018-08-17T14:20:05.514] [21837] [INFO] - Server running at http://127.0.0.1:83 60
[2018-08-17T14:20:05.517] [21837] [INFO] - ThinkJS version: 3.2.8
[2018-08-17T14:20:05.518] [21837] [INFO] - Environment: development
[2018-08-17T14:20:05.518] [21837] [INFO] - Workers: 1
[2018-08-17T14:20:06.664] [21843] [ERROR] - uncaughtException, times: 1, pid: 21 843
[2018-08-17T14:20:06.665] [21843] [ERROR] - { Error: bind EADDRINUSE null:8360
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at listenOnMasterHandle (net.js:1415:16)
at rr (internal/cluster/child.js:121:12)
at Worker.send (internal/cluster/child.js:88:7)
at process.onInternalMessage (internal/cluster/utils.js:42:8)
at emitTwo (events.js:131:20)
at process.emit (events.js:214:7)
at process.emit (/var/www/nideshop/node_modules/source-map-support/source-ma p-support.js:439:21)
at emit (internal/child_process.js:772:12)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'bind',
address: null,
port: 8360 }
[2018-08-17T14:20:06.665] [21843] [ERROR] - { Error: bind EADDRINUSE null:8360
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at listenOnMasterHandle (net.js:1415:16)
at rr (internal/cluster/child.js:121:12)
at Worker.send (internal/cluster/child.js:88:7)
at process.onInternalMessage (internal/cluster/utils.js:42:8)
at emitTwo (events.js:131:20)
at process.emit (events.js:214:7)
at process.emit (/var/www/nideshop/node_modules/source-map-support/source-ma p-support.js:439:21)
at emit (internal/child_process.js:772:12)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'bind',
address: null,
port: 8360 }

`

[root@iZZ init.d]# curl -I http://127.0.0.1:8360/ HTTP/1.1 200 OK Vary: Origin X-Powered-By: thinkjs-3.2.8 Content-Type: application/json; charset=utf-8 X-Response-Time: 37ms Content-Length: 18622 Date: Fri, 17 Aug 2018 07:59:08 GMT Connection: keep-alive 现在正常了 可以正常获取数据,问题出在mysql的免密登陆上面