yapi icon indicating copy to clipboard operation
yapi copied to clipboard

server instance pool was destroyed AND Server selection timed out after 30000 ms

Open mmyhs opened this issue 4 years ago • 2 comments

版本号

~ 1.9.2

什么问题

~ 老是报错,错误原因是mongodb连接超时 error: MongoTimeoutError: Server selection timed out after 30000 ms at selectServers (D:\yapi\vendors\node_modules\mongoose\node_modules\mongodb\lib\core\sdam\topology.js:771:21) at NativeTopology.descriptionChangedHandler (D:\yapi\vendors\node_modules\mongoose\node_modules\mongodb\lib\core\sdam\topology.js:845:7) at Object.onceWrapper (events.js:300:26) at NativeTopology.emit (events.js:215:7) at NativeTopology.serverUpdateHandler (D:\yapi\vendors\node_modules\mongoose\node_modules\mongodb\lib\core\sdam\topology.js:499:10) at Server.emit (events.js:210:5) at successHandler (D:\yapi\vendors\node_modules\mongoose\node_modules\mongodb\lib\core\sdam\monitoring.js:178:12) at D:\yapi\vendors\node_modules\mongoose\node_modules\mongodb\lib\core\sdam\monitoring.js:211:9 at D:\yapi\vendors\node_modules\mongoose\node_modules\mongodb\lib\core\sdam\monitoring.js:169:16 at D:\yapi\vendors\node_modules\mongoose\node_modules\mongodb\lib\core\sdam\server.js:253:7 at D:\yapi\vendors\node_modules\mongoose\node_modules\mongodb\lib\core\connection\pool.js:420:18 at processTicksAndRejections (internal/process/task_queues.js:75:11) { name: 'MongoTimeoutError', [Symbol(mongoErrorContextSymbol)]: {} }

还有这个错误 [ 2020-7-1 14:02:49 ] [ log ] -------------------------------------swaggerSyncUtils constructor----------------------------------------------- [ 2020-7-1 14:02:49 ] [ log ] 服务已启动,请打开下面链接访问: http://127.0.0.1:9090/ [ 2020-7-1 14:02:49 ] [ log ] mongodb load success... [ 2020-7-1 14:18:29 ] [ error ] server instance pool was destroyed [ 2020-7-1 14:20:54 ] [ error ] server instance pool was destroyed [ 2020-7-1 14:20:59 ] [ error ] server instance pool was destroyed [ 2020-7-1 15:48:41 ] [ error ] server instance pool was destroyed [ 2020-7-1 15:48:51 ] [ error ] server instance pool was destroyed [ 2020-7-1 16:32:53 ] [ log ] -------------------------------------swaggerSyncUtils constructor----------------------------------------------- [ 2020-7-1 16:32:56 ] [ log ] 服务已启动,请打开下面链接访问: http://127.0.0.1:9090/ [ 2020-7-1 16:32:56 ] [ log ] mongodb load success... [ 2020-7-1 17:37:34 ] [ error ] Server selection timed out after 30000 ms

如何复现此问题

~ 正常使用一段时间后,会莫名的出现这个bug,频率在18min-35min

什么浏览器

~ 我这边使用的是谷歌

什么系统(Linux, Windows, macOS)

Windows

mmyhs avatar Jul 02 '20 01:07 mmyhs