Error with latest version of Java driver (from HEAD)

19 views
Skip to first unread message

Swen Thuemmler

unread,
Dec 2, 2010, 11:25:26 AM12/2/10
to mongodb-user
Hi all,

today, I tried the latest version of mongo-java-driver. Unfortunately, I
got some errors querying a collection:
java.lang.UnsupportedOperationException: BSONDecoder doesn't understand type : 100 name:
at org.bson.BSONDecoder.decodeElement(BSONDecoder.java:210)
at org.bson.BSONDecoder._decode(BSONDecoder.java:63)
at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
at com.mongodb.Response.<init>(Response.java:63)
at com.mongodb.DBPort.go(DBPort.java:101)
at com.mongodb.DBPort.go(DBPort.java:66)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:211)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:284)
at com.mongodb.DBCursor._check(DBCursor.java:309)
at com.mongodb.DBCursor._hasNext(DBCursor.java:431)
at com.mongodb.DBCursor.hasNext(DBCursor.java:456)

This error does not occur with version 2.3.

My query is as follows (groovy):
[...]
db.slaveOk()
def coll = db.getCollection('badlist')
int count = 0
def query = new BasicDBObject()
def sort = new BasicDBObject('_id', 1)
DBCursor cur = coll.find(query).sort(sort).batchSize(10).limit(10)
while (cur.hasNext()) {
count++
def o = cur.next()
println o.getString('_id')
}
[...]

My mongodb server is a replica set. The primary runs 1.6.3, the
secondary 1.7.3. Same error with both versions. I have used
mongodump/mongorestore to put the collection into another mongo server
on my local machine, but the error does not occur on the local
machine.

Another strange thing is, that sometimes, the query succeeds. I have now
run the query 8 times, and success/failure was 0 0 0 1 0 1 1 0

I have created a pcap-file of the network packets, which I could provide
for diagnosis. Is there anything else I could do to support diagnosis of
this problem?

Greetings, Swen

Swen Thuemmler

unread,
Dec 2, 2010, 11:38:54 AM12/2/10
to mongod...@googlegroups.com
On Thu, Dec 02, 2010 at 05:25:26PM +0100, Swen Thuemmler wrote:
[...]

>
> My query is as follows (groovy):
> [...]
> db.slaveOk()
> def coll = db.getCollection('badlist')
> int count = 0
> def query = new BasicDBObject()
> def sort = new BasicDBObject('_id', 1)
> DBCursor cur = coll.find(query).sort(sort).batchSize(10).limit(10)
> while (cur.hasNext()) {
> count++
> def o = cur.next()
> println o.getString('_id')
> }
> [...]

Another data point: if I lower the batchSize to 2, the query always
works. If I increase the limit to 100 (with batchSize > 2), the query
always fails.

--Swen

Eliot Horowitz

unread,
Dec 2, 2010, 2:18:04 PM12/2/10
to mongod...@googlegroups.com
Yes - this is a known issue with master.
Fix should be going in today.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> 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.
>
>

Swen Thuemmler

unread,
Dec 3, 2010, 4:09:25 AM12/3/10
to mongod...@googlegroups.com
On Thu, Dec 02, 2010 at 02:18:04PM -0500, Eliot Horowitz wrote:
> Yes - this is a known issue with master.
> Fix should be going in today.

Great, this does work. But there seems to remain another issue (with
2.3, too): I'm using requestStart() and requestDone(), and with the
latest driver versions, this leads to a NullPointerException:
java.lang.NullPointerException
at com.mongodb.DBTCPConnector$MyPort.requestDone(DBTCPConnector.java:334)
at com.mongodb.DBTCPConnector.requestDone(DBTCPConnector.java:106)
at com.mongodb.DBApiLayer.requestDone(DBApiLayer.java:75)

I had to remove all calls to requestStart() and requestDone().
Unfortunately, I have no simple test case.

--Swen

Reply all
Reply to author
Forward
0 new messages