2

I have mongoose throwing this error from time to time, it's not stopping the node application from running but I can't find any information about whats causing the error and I would like to fix it.

The link to the repo is here https://github.com/bkawk/divergence2

I have found I can stop the error by adding a limit to the records here https://github.com/bkawk/divergence2/blob/master/src/db.js#L94

{ MongoError: cursor id 31871209567 not found
at /Users/bkawk/Documents/divergence2/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:598:61
at authenticateStragglers (/Users/bkawk/Documents/divergence2/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:516:16)
at Connection.messageHandler (/Users/bkawk/Documents/divergence2/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:552:5)
at emitMessageHandler (/Users/bkawk/Documents/divergence2/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:309:10)
at Socket.<anonymous> (/Users/bkawk/Documents/divergence2/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:488:15)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:607:20)
  name: 'MongoError',
  message: 'cursor id 31871209567 not found',
  ok: 0,
  errmsg: 'cursor id 31871209567 not found',
  code: 43,
  codeName: 'CursorNotFound' }
Bill
  • 4,614
  • 13
  • 77
  • 132
  • [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). We cannot tell you how to "fix" something without seeing what reliably reproduces it. You need to give us "something" and that something cannot be your whole program. Show the necessary parts in order to reproduce. – Neil Lunn May 18 '18 at 05:34
  • @NeilLunn I have found I can stop the error by adding a limit to the records here, it was always the 257th record that created the error https://github.com/bkawk/divergence2/blob/master/src/db.js#L94 – Bill May 18 '18 at 08:28
  • The error happens on cursor timeout. The question should have a code to reproduce the problem in the question itself, which means not only you should be able to reproduce the problem, but anyone who reads the question. Just posting a link to a repo is not enough. There must be some actions apart from cloning the repo to get the error that you didn't mention. – Alex Blex May 18 '18 at 08:29
  • It's a mongoDB server bug. Look at this: https://stackoverflow.com/a/50748162/533976 – vovchisko Jun 07 '18 at 19:00
  • 2
    Possible duplicate of [MongoDB - Error: getMore command failed: Cursor not found](https://stackoverflow.com/questions/44248108/mongodb-error-getmore-command-failed-cursor-not-found) – vovchisko Jun 07 '18 at 19:00

0 Answers0