鉴权后台Mongoose 连接超时

鉴权后台Mongoose 连接超时

100%[nodemon] restarting due to changes...

Hash: fe7516bd5ef05faf753b

Version: webpack 4.46.0

Time: 40ms

Built at: 2021-12-15 5:06:13 ├F10: PM┤

           Asset      Size  Chunks             Chunk Names

server.bundle.js  79.8 KiB  server  [emitted]  server

Entrypoint server = server.bundle.js

[nodemon] starting `node --inspect ./dist/server.bundle.js`

Debugger listening on ws://127.0.0.1:9229/08777888-2c78-48a6-bf3e-5dd24edaa125

For help, see: https://nodejs.org/en/docs/inspector

Debugger attached.

(node:25736) [INSPECTOR_ASYNC_STACK_TRACES_NOT_AVAILABLE] Warning: Warning: Async stack traces in debugger are not available on 

32bit platforms. The feature is disabled.

Mongoose connection disconnected

Mongoose connection error: MongooseServerSelectionError: connection timed out

(node:25736) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: connection timed out

    at NativeConnection.Connection.openUri (F:\LILY\mook\大前端手写项目\web-api\node_modules\mongoose\lib\connection.js:847:32) 

    at F:\LILY\mook\大前端手写项目\web-api\node_modules\mongoose\lib\index.js:351:10

    at F:\LILY\mook\大前端手写项目\web-api\node_modules\mongoose\lib\helpers\promiseOrCallback.js:32:5

    at new Promise (<anonymous>)

    at promiseOrCallback (F:\LILY\mook\大前端手写项目\web-api\node_modules\mongoose\lib\helpers\promiseOrCallback.js:31:10)     

    at Mongoose._promiseOrCallback (F:\LILY\mook\大前端手写项目\web-api\node_modules\mongoose\lib\index.js:1149:10)

    at Mongoose.connect (F:\LILY\mook\大前端手写项目\web-api\node_modules\mongoose\lib\index.js:350:20)

    at eval (webpack-internal:///./src/config/DBHelpler.js:8:49)

    at Module../src/config/DBHelpler.js (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:133:1)

    at __webpack_require__ (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:20:30)

    at eval (webpack-internal:///./src/model/user.js:2:75)

    at Module../src/model/user.js (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:193:1)

    at __webpack_require__ (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:20:30)

    at eval (webpack-internal:///./src/api/LoginController.js:11:69)

    at Module../src/api/LoginController.js (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:97:1)

    at __webpack_require__ (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:20:30)

    at eval (webpack-internal:///./src/routes/loginRouter.js:4:78)

    at Module../src/routes/loginRouter.js (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:205:1)

    at __webpack_require__ (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:20:30)

    at eval (webpack-internal:///./src/routes/routes.js:5:70)

    at Module../src/routes/routes.js (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:229:1)

    at __webpack_require__ (F:\LILY\mook\大前端手写项目\web-api\dist\server.bundle.js:20:30)

(node:25736) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

(node:25736) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.  

Debugger listening on ws://127.0.0.1:9229/08777888-2c78-48a6-bf3e-5dd24edaa125

For help, see: https://nodejs.org/en/docs/inspector

Redis Client Error:AbortError: Stream connection ended and command aborted. It might have been processed.


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
Brian 2021-12-16 11:50:00

Mongoose connection disconnected

Mongoose connection error: MongooseServerSelectionError: connection timed out



你可以先使用robo3t来测试一下连通性:

  1. mongo的服务是否正常

  2. 服务端口是否被监听,服务的端口是否在防火墙中放行,或者是否关闭的防火墙;

  3. 然后使用robo3t测试连接信息

  4. 最后使用mongoose连接

  5. 检查连接信息是否配置正确

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师