title: CURSOR_NOT_FOUND - my cron jobs started dying in the middle
body: <p>a cron job that was successfully running for years suddenly started dying after about 80% completion. Not sure if it is because the collection with results was steadily growing and reached some critical size (does not seem to be all that big to me) or for any other reason. I am not sure how to debug this, I found the user at whom the job died and tried to run the job for this user, got CURSOR_NOTFOUND message after 2 hours. Yesterday it died after 3 hours of running for all users. I am still using old mongoid (2.0.0.beta) because of multiple dependences and lack of time to change it, but mongo is up to date (I know about the bug in <a href="http://osdir.com/ml/mongodb-user/2010-11/msg00896.html" rel="nofollow noreferrer">versions before 1.1.2</a>). </p>
  
  <p>I found two similar questions but neither of them is applicable. In <a href="https://stackoverflow.com/questions/9963599/mongodb-debug-cursor-refresh-for-cursor-7078636577051629992" title="stack overflow question 9963599">this case</a>, they used Mopped which was not production ready. And <a href="https://stackoverflow.com/questions/7339695/mongoid-is-slow-and-shows-this-in-the-log-mongodb-cursor-refresh-for-cursor-3">here</a> the problem was in pagination. </p>
  
  <p>I am getting this error message</p>
  
  <pre><code>MONGODB cursor.refresh() for cursor xxxxxxxxx
  rake aborted!
  Query response returned CURSOR_NOT_FOUND. Either an invalid cursor was specified, or the cursor may have timed out on the server.
  </code></pre>
  
  <p>Any suggestions?  </p>