Note that there are some explanatory texts on larger screens.

plurals
  1. POMorphia/MongoDB: can't do getmore
    primarykey
    data
    text
    <p>I'm trying to iterate over all rows ("documents"?) in my MongoDB database using Morphia. Occasionally I get the following stacktrace:</p> <pre><code>com.mongodb.MongoInternalException: can't do getmore at com.mongodb.DBApiLayer$Result._advance(DBApiLayer.java:378) at com.mongodb.DBApiLayer$Result.hasNext(DBApiLayer.java:356) at com.mongodb.DBCursor._hasNext(DBCursor.java:436) at com.mongodb.DBCursor.hasNext(DBCursor.java:456) at com.google.code.morphia.query.MorphiaIterator.hasNext(MorphiaIterator.java:40) at </code></pre> <p>In the MongoDB log file I see the following:</p> <pre><code>$ grep "cursorid not found" output.log Sun Feb 6 12:14:35 [conn13] getMore: cursorid not found App 2079575931792020691 Sun Feb 6 12:44:17 [conn19] getMore: cursorid not found App 8364953818630631317 Sun Feb 6 13:08:42 [conn20] getMore: cursorid not found App 7142256996888968009 </code></pre> <p>My code for iterating is pretty straightforward:</p> <pre><code> for (App app : datastore.createQuery(App.class).fetch()) { log.info("app: " + app.getId()); // do stuff with app } </code></pre> <p>Morphia bug? MongoDB bug? My bug?</p> <p><strong>Update:</strong></p> <p>I'm also seeing this in my glassfish logs:</p> <pre><code>[#|2011-02-16T15:39:58.029+0000|WARNING|glassfish3.0.1|com.mongodb.TRACE|_ThreadID=28;_ThreadName=Thread-1;|The log message is null. java.lang.NullPointerException at com.mongodb.DBApiLayer._cleanCursors(DBApiLayer.java:113) at com.mongodb.DBApiLayer$DBCleanerThread.run(DBApiLayer.java:494) at java.lang.Thread.run(Thread.java:662) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload