2

I am building an App on SailsJS and am using MongoDb using sails-mongoose hook. The server automatically crashes and shuts down mentioning the error shown below.

I observe that it mainly happens when my computer goes in sleep mode. I am not sure if that is a cause of the crash.

Is there way to avoid it / debug it?

`initialize` function of Mongoose hook (ORM hook override) was called again,
but that should never happen more than once!
error: Proceeding to crash the server... (this is to avoid creating any weird 
race conditions that could potentially mess up your data)
D:\node\myapp\api\hooks\sails-mongoose\index.js:109

Error: connection timeout
   at null.<anonymous> (D:\node\myapp\node_modules\mongoose\lib\drivers\node-mongodb-   native\connection.js:168:17)
   at emitTwo (events.js:87:13)
   at emit (events.js:172:7)
   at listener (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\lib\db.js:1786:14)
   at emitOne (events.js:77:13)
   at emit (events.js:169:7)
   at null.<anonymous> (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\lib\server.js:267:14)
   at emitOne (events.js:77:13)
   at emit (events.js:169:7)
   at null.<anonymous> (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:318:12)
   at emitOne (events.js:77:13)
   at emit (events.js:169:7)
   at null.<anonymous> (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\connection\pool.js:270:12)
   at g (events.js:260:16)
   at emitTwo (events.js:87:13)
   at emit (events.js:172:7)
   at Socket.<anonymous> (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\connection\connection.js:185:10)
   at Socket.g (events.js:260:16)
   at emitNone (events.js:67:13)
   at Socket.emit (events.js:166:7)
   at Socket._onTimeout (net.js:332:8)
   at _runOnTimeout (timers.js:524:11)
   at _makeTimerTimeout (timers.js:515:3)
   at Timer.unrefTimeout (timers.js:584:5)
Masade
  • 715
  • 1
  • 11
  • 29
  • That's a bump obviously, would like to know how to fix it as well, no friendly error was dropped to I/O – deb0rian Feb 21 '17 at 08:09

0 Answers0