Discussion:
Java exception (this should be impossible)
(too old to reply)
Dustin Norlander
2010-08-20 18:24:11 UTC
Permalink
upgraded to mongo2.1 jar and now I get:

WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCursor._check(DBCursor.java:252)
at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)


the calling code is very straight forward:

DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
DBObject query = new BasicDBObject();
query.put("dataset_id", DBHelper.objectId(datasetId));
query.put("te", timeframe.toTrendrrEpoch(date));
log.info(query);
DBCursor cur = col.find(query);
cur.skip(start);
cur.batchSize(limit);
cur.limit(limit);
cur.sort(new BasicDBObject("val", -1));
for (DBObject dsv : cur.toArray()) { // <-- ERROR HERE
DBObject dsv = cur.next();
...
}
Scott Hernandez
2010-08-20 18:31:22 UTC
Permalink
Does this happen all the time, or just randomly?
Post by Dustin Norlander
WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCursor._check(DBCursor.java:252)
at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)
DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
DBObject query = new BasicDBObject();
query.put("dataset_id", DBHelper.objectId(datasetId));
query.put("te", timeframe.toTrendrrEpoch(date));
log.info(query);
DBCursor cur = col.find(query);
cur.skip(start);
cur.batchSize(limit);
cur.limit(limit);
cur.sort(new BasicDBObject("val", -1));
for (DBObject dsv : cur.toArray()) { // <-- ERROR HERE
DBObject dsv = cur.next();
...
}
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
.
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
Dustin Norlander
2010-08-20 18:39:56 UTC
Permalink
Happens every time.

Found the issue though, I had been holding a DB object as a member
variable. That's bad form I guess :)

I'll get the latest and try that if it helps catch a bug in the
driver, otherwise the problem is fixed from my side.



On Fri, Aug 20, 2010 at 11:31 AM, Scott Hernandez
Post by Scott Hernandez
Does this happen all the time, or just randomly?
Post by Dustin Norlander
WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
       at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)
DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
               DBObject query = new BasicDBObject();
               query.put("dataset_id", DBHelper.objectId(datasetId));
               query.put("te", timeframe.toTrendrrEpoch(date));
               log.info(query);
               DBCursor cur = col.find(query);
               cur.skip(start);
               cur.batchSize(limit);
               cur.limit(limit);
               cur.sort(new BasicDBObject("val", -1));
               for (DBObject dsv : cur.toArray()) {   // <-- ERROR HERE
                       DBObject dsv = cur.next();
                       ...
               }
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
Eliot Horowitz
2010-08-20 18:45:48 UTC
Permalink
Holding a DB should be totally ok - so definitely seems like a driver bug.
Would be great if you could try the master and see what happens.
Post by Dustin Norlander
Happens every time.
Found the issue though, I had been holding a DB object as a member
variable.  That's bad form I guess :)
I'll get the latest and try that if it helps catch a bug in the
driver, otherwise the problem is fixed from my side.
On Fri, Aug 20, 2010 at 11:31 AM, Scott Hernandez
Post by Scott Hernandez
Does this happen all the time, or just randomly?
Post by Dustin Norlander
WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
       at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)
DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
               DBObject query = new BasicDBObject();
               query.put("dataset_id", DBHelper.objectId(datasetId));
               query.put("te", timeframe.toTrendrrEpoch(date));
               log.info(query);
               DBCursor cur = col.find(query);
               cur.skip(start);
               cur.batchSize(limit);
               cur.limit(limit);
               cur.sort(new BasicDBObject("val", -1));
               for (DBObject dsv : cur.toArray()) {   // <-- ERROR HERE
                       DBObject dsv = cur.next();
                       ...
               }
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
Dustin Norlander
2010-08-20 18:54:54 UTC
Permalink
Hope this helps

SEVERE: MyPort.error called but _last is null called b/c of
java.lang.IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(Response.java:39)
at com.mongodb.DBPort.go(DBPort.java:85)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCollection.findOne(DBCollection.java:486)
at com.mongodb.DBCollection.findOne(DBCollection.java:475)
at com.mongodb.DB.command(DB.java:137)
at com.mongodb.DB.getLastError(DB.java:283)
at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.mongodb.DBCallback._create(DBCallback.java:86)
at com.mongodb.DBCallback.create(DBCallback.java:61)
at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
at com.mongodb.Response.<init>(Response.java:63)
at com.mongodb.DBPort.go(DBPort.java:85)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCursor._check(DBCursor.java:252)
at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
at com.mongodb.DBCursor._fill(DBCursor.java:440)
at com.mongodb.DBCursor.toArray(DBCursor.java:470)
at com.mongodb.DBCursor.toArray(DBCursor.java:459)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)
Exception in thread "main" java.lang.IllegalArgumentException:
response too long: 1684627207
at com.mongodb.Response.<init>(Response.java:39)
at com.mongodb.DBPort.go(DBPort.java:85)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCollection.findOne(DBCollection.java:486)
at com.mongodb.DBCollection.findOne(DBCollection.java:475)
at com.mongodb.DB.command(DB.java:137)
at com.mongodb.DB.getLastError(DB.java:283)
at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.mongodb.DBCallback._create(DBCallback.java:86)
at com.mongodb.DBCallback.create(DBCallback.java:61)
at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
at com.mongodb.Response.<init>(Response.java:63)
at com.mongodb.DBPort.go(DBPort.java:85)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCursor._check(DBCursor.java:252)
at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
at com.mongodb.DBCursor._fill(DBCursor.java:440)
at com.mongodb.DBCursor.toArray(DBCursor.java:470)
at com.mongodb.DBCursor.toArray(DBCursor.java:459)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)


On Fri, Aug 20, 2010 at 11:45 AM, Eliot Horowitz
Post by Eliot Horowitz
Holding a DB should be totally ok - so definitely seems like a driver bug.
Would be great if you could try the master and see what happens.
Post by Dustin Norlander
Happens every time.
Found the issue though, I had been holding a DB object as a member
variable.  That's bad form I guess :)
I'll get the latest and try that if it helps catch a bug in the
driver, otherwise the problem is fixed from my side.
On Fri, Aug 20, 2010 at 11:31 AM, Scott Hernandez
Post by Scott Hernandez
Does this happen all the time, or just randomly?
Post by Dustin Norlander
WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
       at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)
DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
               DBObject query = new BasicDBObject();
               query.put("dataset_id", DBHelper.objectId(datasetId));
               query.put("te", timeframe.toTrendrrEpoch(date));
               log.info(query);
               DBCursor cur = col.find(query);
               cur.skip(start);
               cur.batchSize(limit);
               cur.limit(limit);
               cur.sort(new BasicDBObject("val", -1));
               for (DBObject dsv : cur.toArray()) {   // <-- ERROR HERE
                       DBObject dsv = cur.next();
                       ...
               }
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
Eliot Horowitz
2010-08-20 19:03:42 UTC
Permalink
Can you tell me a little more about what you're doing?

It looks like this is what is happening:
- do a find
- iterating results
- creating a new object with a custom type
- that creation triggers a getLastError
- which uses the same connection
- which is bad since its in the middle of streaming results.
Post by Dustin Norlander
Hope this helps
SEVERE: MyPort.error called but _last is null  called b/c of
java.lang.IllegalArgumentException: response too long: 1684627207
       at com.mongodb.Response.<init>(Response.java:39)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCollection.findOne(DBCollection.java:486)
       at com.mongodb.DBCollection.findOne(DBCollection.java:475)
       at com.mongodb.DB.command(DB.java:137)
       at com.mongodb.DB.getLastError(DB.java:283)
       at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
       at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
       at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at java.lang.Class.newInstance0(Class.java:355)
       at java.lang.Class.newInstance(Class.java:308)
       at com.mongodb.DBCallback._create(DBCallback.java:86)
       at com.mongodb.DBCallback.create(DBCallback.java:61)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
       at com.mongodb.Response.<init>(Response.java:63)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor._fill(DBCursor.java:440)
       at com.mongodb.DBCursor.toArray(DBCursor.java:470)
       at com.mongodb.DBCursor.toArray(DBCursor.java:459)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)
response too long: 1684627207
       at com.mongodb.Response.<init>(Response.java:39)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCollection.findOne(DBCollection.java:486)
       at com.mongodb.DBCollection.findOne(DBCollection.java:475)
       at com.mongodb.DB.command(DB.java:137)
       at com.mongodb.DB.getLastError(DB.java:283)
       at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
       at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
       at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at java.lang.Class.newInstance0(Class.java:355)
       at java.lang.Class.newInstance(Class.java:308)
       at com.mongodb.DBCallback._create(DBCallback.java:86)
       at com.mongodb.DBCallback.create(DBCallback.java:61)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
       at com.mongodb.Response.<init>(Response.java:63)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor._fill(DBCursor.java:440)
       at com.mongodb.DBCursor.toArray(DBCursor.java:470)
       at com.mongodb.DBCursor.toArray(DBCursor.java:459)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)
On Fri, Aug 20, 2010 at 11:45 AM, Eliot Horowitz
Post by Eliot Horowitz
Holding a DB should be totally ok - so definitely seems like a driver bug.
Would be great if you could try the master and see what happens.
Post by Dustin Norlander
Happens every time.
Found the issue though, I had been holding a DB object as a member
variable.  That's bad form I guess :)
I'll get the latest and try that if it helps catch a bug in the
driver, otherwise the problem is fixed from my side.
On Fri, Aug 20, 2010 at 11:31 AM, Scott Hernandez
Post by Scott Hernandez
Does this happen all the time, or just randomly?
Post by Dustin Norlander
WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
       at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)
DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
               DBObject query = new BasicDBObject();
               query.put("dataset_id", DBHelper.objectId(datasetId));
               query.put("te", timeframe.toTrendrrEpoch(date));
               log.info(query);
               DBCursor cur = col.find(query);
               cur.skip(start);
               cur.batchSize(limit);
               cur.limit(limit);
               cur.sort(new BasicDBObject("val", -1));
               for (DBObject dsv : cur.toArray()) {   // <-- ERROR HERE
                       DBObject dsv = cur.next();
                       ...
               }
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
Eliot Horowitz
2010-08-20 19:08:59 UTC
Permalink
Added some more code to check for that.
Can you try master once again?

Thanks for the help,
-Eliot
Post by Eliot Horowitz
Can you tell me a little more about what you're doing?
 - do a find
 - iterating results
 - creating a new object with a custom type
 - that creation triggers a getLastError
 - which uses the same connection
 - which is bad since its in the middle of streaming results.
Post by Dustin Norlander
Hope this helps
SEVERE: MyPort.error called but _last is null  called b/c of
java.lang.IllegalArgumentException: response too long: 1684627207
       at com.mongodb.Response.<init>(Response.java:39)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCollection.findOne(DBCollection.java:486)
       at com.mongodb.DBCollection.findOne(DBCollection.java:475)
       at com.mongodb.DB.command(DB.java:137)
       at com.mongodb.DB.getLastError(DB.java:283)
       at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
       at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
       at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at java.lang.Class.newInstance0(Class.java:355)
       at java.lang.Class.newInstance(Class.java:308)
       at com.mongodb.DBCallback._create(DBCallback.java:86)
       at com.mongodb.DBCallback.create(DBCallback.java:61)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
       at com.mongodb.Response.<init>(Response.java:63)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor._fill(DBCursor.java:440)
       at com.mongodb.DBCursor.toArray(DBCursor.java:470)
       at com.mongodb.DBCursor.toArray(DBCursor.java:459)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)
response too long: 1684627207
       at com.mongodb.Response.<init>(Response.java:39)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCollection.findOne(DBCollection.java:486)
       at com.mongodb.DBCollection.findOne(DBCollection.java:475)
       at com.mongodb.DB.command(DB.java:137)
       at com.mongodb.DB.getLastError(DB.java:283)
       at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
       at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
       at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at java.lang.Class.newInstance0(Class.java:355)
       at java.lang.Class.newInstance(Class.java:308)
       at com.mongodb.DBCallback._create(DBCallback.java:86)
       at com.mongodb.DBCallback.create(DBCallback.java:61)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
       at com.mongodb.Response.<init>(Response.java:63)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor._fill(DBCursor.java:440)
       at com.mongodb.DBCursor.toArray(DBCursor.java:470)
       at com.mongodb.DBCursor.toArray(DBCursor.java:459)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)
On Fri, Aug 20, 2010 at 11:45 AM, Eliot Horowitz
Post by Eliot Horowitz
Holding a DB should be totally ok - so definitely seems like a driver bug.
Would be great if you could try the master and see what happens.
Post by Dustin Norlander
Happens every time.
Found the issue though, I had been holding a DB object as a member
variable.  That's bad form I guess :)
I'll get the latest and try that if it helps catch a bug in the
driver, otherwise the problem is fixed from my side.
On Fri, Aug 20, 2010 at 11:31 AM, Scott Hernandez
Post by Scott Hernandez
Does this happen all the time, or just randomly?
Post by Dustin Norlander
WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
       at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)
DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
               DBObject query = new BasicDBObject();
               query.put("dataset_id", DBHelper.objectId(datasetId));
               query.put("te", timeframe.toTrendrrEpoch(date));
               log.info(query);
               DBCursor cur = col.find(query);
               cur.skip(start);
               cur.batchSize(limit);
               cur.limit(limit);
               cur.sort(new BasicDBObject("val", -1));
               for (DBObject dsv : cur.toArray()) {   // <-- ERROR HERE
                       DBObject dsv = cur.next();
                       ...
               }
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
Dustin Norlander
2010-08-20 19:46:19 UTC
Permalink
Yeah, now that you mention it, thats exactly what was happening. I
was assigning a DB in the constructor of the model (we have lazy
initialization code wrapping the standard mongo driver, which checks
for errors before returning).

Here is the output from the latest jar:


SEVERE: MyPort.error called but _last is null called b/c of
java.lang.IllegalStateException: DBPort.go called and expecting a
response while processing another response
at com.mongodb.DBPort.go(DBPort.java:73)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCollection.findOne(DBCollection.java:486)
at com.mongodb.DBCollection.findOne(DBCollection.java:475)
at com.mongodb.DB.command(DB.java:137)
at com.mongodb.DB.getLastError(DB.java:283)
at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.mongodb.DBCallback._create(DBCallback.java:86)
at com.mongodb.DBCallback.create(DBCallback.java:61)
at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
at com.mongodb.Response.<init>(Response.java:63)
at com.mongodb.DBPort.go(DBPort.java:96)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCursor._check(DBCursor.java:252)
at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
at com.mongodb.DBCursor._fill(DBCursor.java:440)
at com.mongodb.DBCursor.toArray(DBCursor.java:470)
at com.mongodb.DBCursor.toArray(DBCursor.java:459)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)
Exception in thread "main" java.lang.IllegalStateException: DBPort.go
called and expecting a response while processing another response
at com.mongodb.DBPort.go(DBPort.java:73)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCollection.findOne(DBCollection.java:486)
at com.mongodb.DBCollection.findOne(DBCollection.java:475)
at com.mongodb.DB.command(DB.java:137)
at com.mongodb.DB.getLastError(DB.java:283)
at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.mongodb.DBCallback._create(DBCallback.java:86)
at com.mongodb.DBCallback.create(DBCallback.java:61)
at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
at com.mongodb.Response.<init>(Response.java:63)
at com.mongodb.DBPort.go(DBPort.java:96)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DBCursor._check(DBCursor.java:252)
at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
at com.mongodb.DBCursor._fill(DBCursor.java:440)
at com.mongodb.DBCursor.toArray(DBCursor.java:470)
at com.mongodb.DBCursor.toArray(DBCursor.java:459)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)





On Fri, Aug 20, 2010 at 12:08 PM, Eliot Horowitz
Post by Eliot Horowitz
Added some more code to check for that.
Can you try master once again?
Thanks for the help,
-Eliot
Post by Eliot Horowitz
Can you tell me a little more about what you're doing?
 - do a find
 - iterating results
 - creating a new object with a custom type
 - that creation triggers a getLastError
 - which uses the same connection
 - which is bad since its in the middle of streaming results.
Post by Dustin Norlander
Hope this helps
SEVERE: MyPort.error called but _last is null  called b/c of
java.lang.IllegalArgumentException: response too long: 1684627207
       at com.mongodb.Response.<init>(Response.java:39)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCollection.findOne(DBCollection.java:486)
       at com.mongodb.DBCollection.findOne(DBCollection.java:475)
       at com.mongodb.DB.command(DB.java:137)
       at com.mongodb.DB.getLastError(DB.java:283)
       at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
       at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
       at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at java.lang.Class.newInstance0(Class.java:355)
       at java.lang.Class.newInstance(Class.java:308)
       at com.mongodb.DBCallback._create(DBCallback.java:86)
       at com.mongodb.DBCallback.create(DBCallback.java:61)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
       at com.mongodb.Response.<init>(Response.java:63)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor._fill(DBCursor.java:440)
       at com.mongodb.DBCursor.toArray(DBCursor.java:470)
       at com.mongodb.DBCursor.toArray(DBCursor.java:459)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)
response too long: 1684627207
       at com.mongodb.Response.<init>(Response.java:39)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCollection.findOne(DBCollection.java:486)
       at com.mongodb.DBCollection.findOne(DBCollection.java:475)
       at com.mongodb.DB.command(DB.java:137)
       at com.mongodb.DB.getLastError(DB.java:283)
       at com.trendrr.shared.db.helpers.DBHelper.checkForError(DBHelper.java:65)
       at com.trendrr.shared.db.MongoWrapper.getAuthenticatedDB(MongoWrapper.java:101)
       at com.trendrr.shared.db.TrendrrDB.getFoursquareDB(TrendrrDB.java:62)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:57)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.<init>(FoursquareDatasetVenue.java:64)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at java.lang.Class.newInstance0(Class.java:355)
       at java.lang.Class.newInstance(Class.java:308)
       at com.mongodb.DBCallback._create(DBCallback.java:86)
       at com.mongodb.DBCallback.create(DBCallback.java:61)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:38)
       at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:34)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:70)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
       at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
       at com.mongodb.Response.<init>(Response.java:63)
       at com.mongodb.DBPort.go(DBPort.java:85)
       at com.mongodb.DBPort.call(DBPort.java:56)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor._fill(DBCursor.java:440)
       at com.mongodb.DBCursor.toArray(DBCursor.java:470)
       at com.mongodb.DBCursor.toArray(DBCursor.java:459)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:170)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:52)
On Fri, Aug 20, 2010 at 11:45 AM, Eliot Horowitz
Post by Eliot Horowitz
Holding a DB should be totally ok - so definitely seems like a driver bug.
Would be great if you could try the master and see what happens.
Post by Dustin Norlander
Happens every time.
Found the issue though, I had been holding a DB object as a member
variable.  That's bad form I guess :)
I'll get the latest and try that if it helps catch a bug in the
driver, otherwise the problem is fixed from my side.
On Fri, Aug 20, 2010 at 11:31 AM, Scott Hernandez
Post by Scott Hernandez
Does this happen all the time, or just randomly?
Post by Dustin Norlander
WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
       at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
       at
com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)
DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
               DBObject query = new BasicDBObject();
               query.put("dataset_id", DBHelper.objectId(datasetId));
               query.put("te", timeframe.toTrendrrEpoch(date));
               log.info(query);
               DBCursor cur = col.find(query);
               cur.skip(start);
               cur.batchSize(limit);
               cur.limit(limit);
               cur.sort(new BasicDBObject("val", -1));
               for (DBObject dsv : cur.toArray()) {   // <-- ERROR HERE
                       DBObject dsv = cur.next();
                       ...
               }
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
jm.nissel-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2010-08-31 18:58:38 UTC
Permalink
I also get a similar exception on a save with 2.1 and morphia.

I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.

java.lang.IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
com.mongodb.DBTCPConnector.say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:256)
com.mongodb.DBCollection.save(DBCollection.java:556)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:638)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:685)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:679)
com.google.code.morphia.DAO.save(DAO.java:84)
Eliot Horowitz
2010-08-31 20:31:15 UTC
Permalink
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
com.mongodb.DBTCPConnector.say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:256)
com.mongodb.DBCollection.save(DBCollection.java:556)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:638)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:685)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:679)
com.google.code.morphia.DAO.save(DAO.java:84)
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group, send email to
.
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
Ben McCann
2013-05-02 22:17:45 UTC
Permalink
We're getting this quite a bit, which is causing us lots of difficulty in
our production environment. I don't have a simple reproduceable test case
yet. It's happened for us using both Morphia and MongoJack. We recently
migrated from Morphia to MongoJack because we found a memory leak in
Morphia and were hoping it would fix this issue for us as well, but I guess
it must be in either the Java driver or server since it's happening with
both libraries.

java.lang.IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:124)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:74)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
com.mongodb.DBTCPConnector.say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:256)
com.mongodb.DBCollection.save(DBCollection.java:556)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:638)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:685)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:679)
com.google.code.morphia.DAO.save(DAO.java:84)
--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Ben McCann
2013-05-02 22:59:05 UTC
Permalink
Btw, I'm using MongoDB 2.4.3.

Here's another thread I found on the issue as well:
https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of difficulty in
our production environment. I don't have a simple reproduceable test case
yet. It's happened for us using both Morphia and MongoJack. We recently
migrated from Morphia to MongoJack because we found a memory leak in
Morphia and were hoping it would fix this issue for us as well, but I guess
it must be in either the Java driver or server since it's happening with
both libraries.
java.lang.IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:124)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:74)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
com.mongodb.DBTCPConnector.say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:256)
com.mongodb.DBCollection.save(DBCollection.java:556)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:638)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:685)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:679)
com.google.code.morphia.DAO.save(DAO.java:84)
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Ben McCann
2013-05-02 23:05:47 UTC
Permalink
And here's someone reporting the same error from Casbah
http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of difficulty in
our production environment. I don't have a simple reproduceable test case
yet. It's happened for us using both Morphia and MongoJack. We recently
migrated from Morphia to MongoJack because we found a memory leak in
Morphia and were hoping it would fix this issue for us as well, but I guess
it must be in either the Java driver or server since it's happening with
both libraries.
java.lang.IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:124)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:74)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
com.mongodb.DBTCPConnector.say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:256)
com.mongodb.DBCollection.save(DBCollection.java:556)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:638)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:685)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:679)
com.google.code.morphia.DAO.save(DAO.java:84)
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Ben McCann
2013-05-02 23:09:47 UTC
Permalink
"response too long: 1684627207" is the most common error, but I've also
seen this with other numbers there in place of the 1684627207. Here's a log
file with a bunch of them.
Post by Ben McCann
And here's someone reporting the same error from Casbah
http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of difficulty
in our production environment. I don't have a simple reproduceable test
case yet. It's happened for us using both Morphia and MongoJack. We
recently migrated from Morphia to MongoJack because we found a memory leak
in Morphia and were hoping it would fix this issue for us as well, but I
guess it must be in either the Java driver or server since it's happening
with both libraries.
java.lang.IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:124)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:74)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.10.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
com.mongodb.DBTCPConnector.say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:256)
com.mongodb.DBCollection.save(DBCollection.java:556)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:638)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:685)
com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:679)
com.google.code.morphia.DAO.save(DAO.java:84)
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Ben McCann
2013-05-02 23:12:26 UTC
Permalink
I just upgraded to the 2.11.1 driver and it's still happening:

java.lang.IllegalArgumentException: response too long: 419442946
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:142)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:92)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
"response too long: 1684627207" is the most common error, but I've also
seen this with other numbers there in place of the 1684627207. Here's a log
file with a bunch of them.
Post by Ben McCann
And here's someone reporting the same error from Casbah
http://stackoverflow.com/**questions/5798073/casbahs-**
problem-with-large-number-of-**returned-objects<http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects>
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/**msg/mongodb-user/wlcQE0Ydo9g/**
xp8IzBpIlFEJ<https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ>
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of difficulty
in our production environment. I don't have a simple reproduceable test
case yet. It's happened for us using both Morphia and MongoJack. We
recently migrated from Morphia to MongoJack because we found a memory leak
in Morphia and were hoping it would fix this issue for us as well, but I
guess it must be in either the Java driver or server since it's happening
with both libraries.
java.lang.**IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(**Response.java:47)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.**java:124) ~[org.mongodb.mongo-java-**
driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(**DBPort.java:74) ~[org.mongodb.mongo-java-*
*driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**innerCall(DBTCPConnector.java:**286)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:310)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:295)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(**DBCursor.java:368)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(**DBCursor.java:459)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(**DBCursor.java:518)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(**DBCursor.java:553)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.**IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$**MyPort.error(DBTCPConnector.**
java:287)
com.mongodb.DBTCPConnector.**say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$**MyCollection.update(**
DBApiLayer.java:256)
com.mongodb.DBCollection.**save(DBCollection.java:556)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:638)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:685)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:679)
com.google.code.morphia.DAO.**save(DAO.java:84)
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at http://groups.google.com/**
group/mongodb-user?hl=en<http://groups.google.com/group/mongodb-user?hl=en>
.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Ben McCann
2013-05-03 06:19:33 UTC
Permalink
I've noticed some other fun errors in my logs like this one:

java.lang.IllegalStateException: _out shouldn't be null
at com.mongodb.DBPort.go(DBPort.java:128)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:106)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.findOne(DBPort.java:162)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.runCommand(DBPort.java:170)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:544)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.authenticate(DBPort.java:322)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.checkAuth(DBPort.java:333)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:243)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
java.lang.IllegalArgumentException: response too long: 419442946
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:142)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:92)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
"response too long: 1684627207" is the most common error, but I've also
seen this with other numbers there in place of the 1684627207. Here's a log
file with a bunch of them.
Post by Ben McCann
And here's someone reporting the same error from Casbah
http://stackoverflow.com/**questions/5798073/casbahs-**
problem-with-large-number-of-**returned-objects<http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects>
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/**msg/mongodb-user/wlcQE0Ydo9g/**
xp8IzBpIlFEJ<https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ>
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of difficulty
in our production environment. I don't have a simple reproduceable test
case yet. It's happened for us using both Morphia and MongoJack. We
recently migrated from Morphia to MongoJack because we found a memory leak
in Morphia and were hoping it would fix this issue for us as well, but I
guess it must be in either the Java driver or server since it's happening
with both libraries.
java.lang.**IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(**Response.java:47)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.**java:124) ~[org.mongodb.mongo-java-
**driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(**DBPort.java:74) ~[org.mongodb.mongo-java-
**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**innerCall(DBTCPConnector.java:**286)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:310)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:295)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(**DBCursor.java:368)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(**DBCursor.java:459)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(**DBCursor.java:518)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(**DBCursor.java:553)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.**IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$**MyPort.error(DBTCPConnector.**
java:287)
com.mongodb.DBTCPConnector.**say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$**MyCollection.update(**
DBApiLayer.java:256)
com.mongodb.DBCollection.**save(DBCollection.java:556)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:638)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:685)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:679)
com.google.code.morphia.DAO.**save(DAO.java:84)
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at http://groups.google.com/**
group/mongodb-user?hl=en<http://groups.google.com/group/mongodb-user?hl=en>
.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Ben McCann
2013-05-03 09:52:12 UTC
Permalink
Okay, think I got it figured out. It seems like the bug's not in mongodb or
the java driver, but in some other stuff we were using. I fixed a library
we were using to make threadsafe calls to MongoDB and it looks much better.
We'll see if any more errors pop up in our logs overnight. In the meantime I
submitted a pull request to MongoJack to clarify in their docs which
classes are threadsafe and which are
not<https://github.com/devbliss/mongojack/pull/10> because
I think some confusion there was also part of the problem.
Post by Ben McCann
java.lang.IllegalStateException: _out shouldn't be null
at com.mongodb.DBPort.go(DBPort.java:128)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:106)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.findOne(DBPort.java:162)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.runCommand(DBPort.java:170)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:544)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.authenticate(DBPort.java:322)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.checkAuth(DBPort.java:333)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:243)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
java.lang.IllegalArgumentException: response too long: 419442946
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:142)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:92)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
"response too long: 1684627207" is the most common error, but I've also
seen this with other numbers there in place of the 1684627207. Here's a log
file with a bunch of them.
Post by Ben McCann
And here's someone reporting the same error from Casbah
http://stackoverflow.com/**questions/5798073/casbahs-**
problem-with-large-number-of-**returned-objects<http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects>
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/**msg/mongodb-user/wlcQE0Ydo9g/**
xp8IzBpIlFEJ<https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ>
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of
difficulty in our production environment. I don't have a simple
reproduceable test case yet. It's happened for us using both Morphia and
MongoJack. We recently migrated from Morphia to MongoJack because we found
a memory leak in Morphia and were hoping it would fix this issue for us as
well, but I guess it must be in either the Java driver or server since it's
happening with both libraries.
java.lang.**IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(**Response.java:47)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.**java:124)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(**DBPort.java:74)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**innerCall(DBTCPConnector.java:**286)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:310)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:295)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(**DBCursor.java:368)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(**DBCursor.java:459)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(**DBCursor.java:518)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(**DBCursor.java:553)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.**IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$**MyPort.error(DBTCPConnector.**
java:287)
com.mongodb.DBTCPConnector.**say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$**MyCollection.update(**
DBApiLayer.java:256)
com.mongodb.DBCollection.**save(DBCollection.java:556)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:638)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:685)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:679)
com.google.code.morphia.DAO.**save(DAO.java:84)
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at http://groups.google.com/**
group/mongodb-user?hl=en<http://groups.google.com/group/mongodb-user?hl=en>
.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
about.me/benmccann
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Jeff Yemin
2013-05-03 19:19:17 UTC
Permalink
So essentially your code was accessing the same instance of
com.mongo.DBCursor from multiple threads?


Regards,
Jeff
Post by Ben McCann
Okay, think I got it figured out. It seems like the bug's not in mongodb
or the java driver, but in some other stuff we were using. I fixed a
library we were using to make threadsafe calls to MongoDB and it looks much
better. We'll see if any more errors pop up in our logs overnight. In the
meantime I submitted a pull request to MongoJack to clarify in their docs
which classes are threadsafe and which are not<https://github.com/devbliss/mongojack/pull/10> because
I think some confusion there was also part of the problem.
Post by Ben McCann
java.lang.IllegalStateException: _out shouldn't be null
at com.mongodb.DBPort.go(DBPort.java:128)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:106)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.findOne(DBPort.java:162)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.runCommand(DBPort.java:170)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:544)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.authenticate(DBPort.java:322)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.checkAuth(DBPort.java:333)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:243)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
java.lang.IllegalArgumentException: response too long: 419442946
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:142)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:92)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
"response too long: 1684627207" is the most common error, but I've also
seen this with other numbers there in place of the 1684627207. Here's a log
file with a bunch of them.
Post by Ben McCann
And here's someone reporting the same error from Casbah
http://stackoverflow.com/**questions/5798073/casbahs-**
problem-with-large-number-of-**returned-objects<http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects>
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/**msg/mongodb-user/wlcQE0Ydo9g/**
xp8IzBpIlFEJ<https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ>
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of
difficulty in our production environment. I don't have a simple
reproduceable test case yet. It's happened for us using both Morphia and
MongoJack. We recently migrated from Morphia to MongoJack because we found
a memory leak in Morphia and were hoping it would fix this issue for us as
well, but I guess it must be in either the Java driver or server since it's
happening with both libraries.
java.lang.**IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(**Response.java:47)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.**java:124)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(**DBPort.java:74)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**innerCall(DBTCPConnector.java:**286)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:310)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:295)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(**DBCursor.java:368)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(**DBCursor.java:459)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(**DBCursor.java:518)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(**DBCursor.java:553)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.**IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$**MyPort.error(DBTCPConnector.**
java:287)
com.mongodb.DBTCPConnector.**say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$**MyCollection.update(**
DBApiLayer.java:256)
com.mongodb.DBCollection.**save(DBCollection.java:556)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:638)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:685)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:679)
com.google.code.morphia.DAO.**save(DAO.java:84)
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at http://groups.google.com/**
group/mongodb-user?hl=en<http://groups.google.com/group/mongodb-user?hl=en>
.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
about.me/benmccann
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Ben McCann
2013-05-03 19:24:40 UTC
Permalink
Yep. It wasn't immediately obvious to me that that wasn't allowed. It would
be good to add a note in the
JavaDoc<http://api.mongodb.org/java/2.11.1/com/mongodb/DBCursor.html>stating
whether the class is meant to be thread-safe or not. If it is meant
to be thread-safe then there might be a bug in it. Otherwise I could submit
a pull request stating that it is not thread-safe.
Post by Jeff Yemin
So essentially your code was accessing the same instance of
com.mongo.DBCursor from multiple threads?
Regards,
Jeff
Post by Ben McCann
Okay, think I got it figured out. It seems like the bug's not in mongodb
or the java driver, but in some other stuff we were using. I fixed a
library we were using to make threadsafe calls to MongoDB and it looks much
better. We'll see if any more errors pop up in our logs overnight. In the
meantime I submitted a pull request to MongoJack to clarify in their
docs which classes are threadsafe and which are not<https://github.com/devbliss/mongojack/pull/10> because
I think some confusion there was also part of the problem.
Post by Ben McCann
java.lang.IllegalStateException: _out shouldn't be null
at com.mongodb.DBPort.go(DBPort.java:128)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:106)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.findOne(DBPort.java:162)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.runCommand(DBPort.java:170)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:544)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.authenticate(DBPort.java:322)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.checkAuth(DBPort.java:333)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:243)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
java.lang.IllegalArgumentException: response too long: 419442946
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:142)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:92)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
"response too long: 1684627207" is the most common error, but I've
also seen this with other numbers there in place of the 1684627207. Here's
a log file with a bunch of them.
Post by Ben McCann
And here's someone reporting the same error from Casbah
http://stackoverflow.com/**questions/5798073/casbahs-**
problem-with-large-number-of-**returned-objects<http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects>
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/**msg/mongodb-user/wlcQE0Ydo9g/**
xp8IzBpIlFEJ<https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ>
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of
difficulty in our production environment. I don't have a simple
reproduceable test case yet. It's happened for us using both Morphia and
MongoJack. We recently migrated from Morphia to MongoJack because we found
a memory leak in Morphia and were hoping it would fix this issue for us as
well, but I guess it must be in either the Java driver or server since it's
happening with both libraries.
java.lang.**IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(**Response.java:47)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.**java:124)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(**DBPort.java:74)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**innerCall(DBTCPConnector.java:**286)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:310)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:295)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(**DBCursor.java:368)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(**DBCursor.java:459)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(**DBCursor.java:518)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(**DBCursor.java:553)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.**IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$**MyPort.error(DBTCPConnector.**
java:287)
com.mongodb.DBTCPConnector.**say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$**MyCollection.update(**
DBApiLayer.java:256)
com.mongodb.DBCollection.**save(DBCollection.java:556)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:638)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:685)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:679)
com.google.code.morphia.DAO.**save(DAO.java:84)
--
You received this message because you are subscribed to the
Google Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at http://groups.google.com/**
group/mongodb-user?hl=en<http://groups.google.com/group/mongodb-user?hl=en>
.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
about.me/benmccann
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Jeff Yemin
2013-05-03 19:39:58 UTC
Permalink
We have an annotation to indicate that, so I just added it and pushed:
https://github.com/mongodb/mongo-java-driver/commit/da03eef35bb5db6a0dcadac2ad7dbcc1a8047772

Thanks for the suggestion.


Jeff
Post by Ben McCann
Yep. It wasn't immediately obvious to me that that wasn't allowed. It
would be good to add a note in the JavaDoc<http://api.mongodb.org/java/2.11.1/com/mongodb/DBCursor.html>stating whether the class is meant to be thread-safe or not. If it is meant
to be thread-safe then there might be a bug in it. Otherwise I could submit
a pull request stating that it is not thread-safe.
Post by Jeff Yemin
So essentially your code was accessing the same instance of
com.mongo.DBCursor from multiple threads?
Regards,
Jeff
Post by Ben McCann
Okay, think I got it figured out. It seems like the bug's not in mongodb
or the java driver, but in some other stuff we were using. I fixed a
library we were using to make threadsafe calls to MongoDB and it looks much
better. We'll see if any more errors pop up in our logs overnight. In the
meantime I submitted a pull request to MongoJack to clarify in their
docs which classes are threadsafe and which are not<https://github.com/devbliss/mongojack/pull/10> because
I think some confusion there was also part of the problem.
Post by Ben McCann
java.lang.IllegalStateException: _out shouldn't be null
at com.mongodb.DBPort.go(DBPort.java:128)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:106)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.findOne(DBPort.java:162)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.runCommand(DBPort.java:170)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:544)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.authenticate(DBPort.java:322)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.checkAuth(DBPort.java:333)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:243)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
java.lang.IllegalArgumentException: response too long: 419442946
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:142)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:92)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
On Thu, May 2, 2013 at 4:09 PM, Ben McCann <
Post by Ben McCann
"response too long: 1684627207" is the most common error, but I've
also seen this with other numbers there in place of the 1684627207. Here's
a log file with a bunch of them.
Post by Ben McCann
And here's someone reporting the same error from Casbah
http://stackoverflow.com/**questions/5798073/casbahs-**
problem-with-large-number-of-**returned-objects<http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects>
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/**msg/mongodb-user/wlcQE0Ydo9g/**
xp8IzBpIlFEJ<https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ>
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of
difficulty in our production environment. I don't have a simple
reproduceable test case yet. It's happened for us using both Morphia and
MongoJack. We recently migrated from Morphia to MongoJack because we found
a memory leak in Morphia and were hoping it would fix this issue for us as
well, but I guess it must be in either the Java driver or server since it's
happening with both libraries.
java.lang.**IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(**Response.java:47)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.**java:124)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(**DBPort.java:74)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**innerCall(DBTCPConnector.java:**286)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:310)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:295)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(**DBCursor.java:368)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(**DBCursor.java:459)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(**DBCursor.java:518)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(**DBCursor.java:553)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine. If I try
the same with a load it works fine straight after a restart.
java.lang.**IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$**MyPort.error(DBTCPConnector.**
java:287)
com.mongodb.DBTCPConnector.**say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$**MyCollection.update(**
DBApiLayer.java:256)
com.mongodb.DBCollection.**save(DBCollection.java:556)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:638)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:685)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:679)
com.google.code.morphia.DAO.**save(DAO.java:84)
--
You received this message because you are subscribed to the
Google Groups "mongodb-user" group.
To unsubscribe from this group, send email to
For more options, visit this group at http://groups.google.com/*
*group/mongodb-user?hl=en<http://groups.google.com/group/mongodb-user?hl=en>
.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in
the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
about.me/benmccann
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Ben McCann
2013-05-03 19:45:17 UTC
Permalink
awesome. thanks! hopefully it'll save others from trouble down the road =)
Post by Jeff Yemin
https://github.com/mongodb/mongo-java-driver/commit/da03eef35bb5db6a0dcadac2ad7dbcc1a8047772
Thanks for the suggestion.
Jeff
Post by Ben McCann
Yep. It wasn't immediately obvious to me that that wasn't allowed. It
would be good to add a note in the JavaDoc<http://api.mongodb.org/java/2.11.1/com/mongodb/DBCursor.html>stating whether the class is meant to be thread-safe or not. If it is meant
to be thread-safe then there might be a bug in it. Otherwise I could submit
a pull request stating that it is not thread-safe.
Post by Jeff Yemin
So essentially your code was accessing the same instance of
com.mongo.DBCursor from multiple threads?
Regards,
Jeff
Post by Ben McCann
Okay, think I got it figured out. It seems like the bug's not in
mongodb or the java driver, but in some other stuff we were using. I fixed
a library we were using to make threadsafe calls to MongoDB and it looks
much better. We'll see if any more errors pop up in our logs overnight. In
the meantime I submitted a pull request to MongoJack to clarify in
their docs which classes are threadsafe and which are not<https://github.com/devbliss/mongojack/pull/10> because
I think some confusion there was also part of the problem.
Post by Ben McCann
java.lang.IllegalStateException: _out shouldn't be null
at com.mongodb.DBPort.go(DBPort.java:128)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:106)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.findOne(DBPort.java:162)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.runCommand(DBPort.java:170)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at
com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:544)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.authenticate(DBPort.java:322)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.checkAuth(DBPort.java:333)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:243)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
Post by Ben McCann
java.lang.IllegalArgumentException: response too long: 419442946
at com.mongodb.Response.<init>(Response.java:47)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.go(DBPort.java:142)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBPort.call(DBPort.java:92)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._check(DBCursor.java:368)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor._fill(DBCursor.java:518)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at com.mongodb.DBCursor.toArray(DBCursor.java:553)
~[org.mongodb.mongo-java-driver-2.11.1.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
at org.mongojack.DBCursor.toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.0-RC5.jar:na]
On Thu, May 2, 2013 at 4:09 PM, Ben McCann <
Post by Ben McCann
"response too long: 1684627207" is the most common error, but I've
also seen this with other numbers there in place of the 1684627207. Here's
a log file with a bunch of them.
Post by Ben McCann
And here's someone reporting the same error from Casbah
http://stackoverflow.com/**questions/5798073/casbahs-**
problem-with-large-number-of-**returned-objects<http://stackoverflow.com/questions/5798073/casbahs-problem-with-large-number-of-returned-objects>
Post by Ben McCann
Btw, I'm using MongoDB 2.4.3.
https://groups.google.com/d/**msg/mongodb-user/wlcQE0Ydo9g/**
xp8IzBpIlFEJ<https://groups.google.com/d/msg/mongodb-user/wlcQE0Ydo9g/xp8IzBpIlFEJ>
Post by Ben McCann
We're getting this quite a bit, which is causing us lots of
difficulty in our production environment. I don't have a simple
reproduceable test case yet. It's happened for us using both Morphia and
MongoJack. We recently migrated from Morphia to MongoJack because we found
a memory leak in Morphia and were hoping it would fix this issue for us as
well, but I guess it must be in either the Java driver or server since it's
happening with both libraries.
java.lang.**IllegalArgumentException: response too long: 1684627207
at com.mongodb.Response.<init>(**Response.java:47)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.go(DBPort.**java:124)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBPort.call(**DBPort.java:74)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**innerCall(DBTCPConnector.java:**286)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBTCPConnector.**call(DBTCPConnector.java:257)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:310)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBApiLayer$**MyCollection.__find(**DBApiLayer.java:295)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._check(**DBCursor.java:368)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._hasNext(**DBCursor.java:459)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor._fill(**DBCursor.java:518)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at com.mongodb.DBCursor.toArray(**DBCursor.java:553)
~[org.mongodb.mongo-java-**driver-2.10.1.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:385)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na]
at org.mongojack.DBCursor.**toArray(DBCursor.java:372)
~[org.mongojack.mongojack-2.0.**0-RC5.jar:na
Post by Eliot Horowitz
Do you have a stack from the first failure?
Post by jm.nissel-gM/Ye1E23mwN+***@public.gmane.org
I also get a similar exception on a save with 2.1 and morphia.
I can cause it by restarting mongod whilst my application is running
but after my application has connected to mongo. The first save after
the restart raises the exception, subsequent saves work fine.
If I try
the same with a load it works fine straight after a restart.
java.lang.**IllegalStateException: this should be impossible
com.mongodb.DBTCPConnector$**MyPort.error(DBTCPConnector.**
java:287)
com.mongodb.DBTCPConnector.**say(DBTCPConnector.java:165)
com.mongodb.DBApiLayer$**MyCollection.update(**
DBApiLayer.java:256)
com.mongodb.DBCollection.**save(DBCollection.java:556)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:638)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:685)
com.google.code.morphia.**DatastoreImpl.save(**
DatastoreImpl.java:679)
com.google.code.morphia.DAO.**save(DAO.java:84)
--
You received this message because you are subscribed to the
Google Groups "mongodb-user" group.
.
To unsubscribe from this group, send email to
For more options, visit this group at http://groups.google.com/
**group/mongodb-user?hl=en<http://groups.google.com/group/mongodb-user?hl=en>
.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in
the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
about.me/benmccann
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/DgDG_tpMGtc/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/groups/opt_out.
--
about.me/benmccann
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Eliot Horowitz
2010-08-20 18:35:02 UTC
Permalink
Just pushed some better logging - can you give it a try?
Post by Dustin Norlander
WARNING: Caught
Exception in thread "main" java.lang.IllegalStateException: this
should be impossible
       at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:287)
       at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:197)
       at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
       at com.mongodb.DBCursor._check(DBCursor.java:252)
       at com.mongodb.DBCursor._hasNext(DBCursor.java:372)
       at com.mongodb.DBCursor.hasNext(DBCursor.java:397)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.loadTop(FoursquareDatasetVenue.java:161)
       at com.trendrr.shared.model.foursquare.FoursquareDatasetVenue.main(FoursquareDatasetVenue.java:50)
DBCollection col = new FoursquareDatasetVenue(timeframe).dBCollection();
               DBObject query = new BasicDBObject();
               query.put("dataset_id", DBHelper.objectId(datasetId));
               query.put("te", timeframe.toTrendrrEpoch(date));
               log.info(query);
               DBCursor cur = col.find(query);
               cur.skip(start);
               cur.batchSize(limit);
               cur.limit(limit);
               cur.sort(new BasicDBObject("val", -1));
               for (DBObject dsv : cur.toArray()) {   // <-- ERROR HERE
                       DBObject dsv = cur.next();
                       ...
               }
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to mongodb-user+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
Continue reading on narkive:
Loading...