Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1679

Mongo cursor.next() -> org.bson.BSONException: bad string size upon fetching “hvězdnější”

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 2.12.4
    • BSON
    • None

    Description

      (Copied from stack exchange on suggestion. http://stackoverflow.com/q/28950708/1920149 )

      I get the exception below, when from code I try to cursor.next() and the document response should be:

      {
      "_id" : ObjectId("54fcc2b5664347b9be743599"),
      "content" : "hvězdnější",
      "languages" : {
      "cs" :

      { "lemma" : "hvězdnější" }

      }
      }
      This is the exception.

      WARNING: emptying DBPortPool to localhost/127.0.0.1:27017 b/c of error
      org.bson.BSONException: bad string size: 1701707776
      at org.bson.BasicBSONDecoder$BSONInput.readUTF8String(BasicBSONDecoder.java:447)
      at org.bson.BasicBSONDecoder.decodeElement(BasicBSONDecoder.java:155)
      at org.bson.BasicBSONDecoder.decodeElement(BasicBSONDecoder.java:196)
      at org.bson.BasicBSONDecoder._decode(BasicBSONDecoder.java:79)
      at org.bson.BasicBSONDecoder.decode(BasicBSONDecoder.java:57)
      at com.mongodb.DefaultDBDecoder.decode(DefaultDBDecoder.java:61)
      at com.mongodb.Response.<init>(Response.java:83)
      at com.mongodb.DBPort.go(DBPort.java:142)
      at com.mongodb.DBPort.call(DBPort.java:92)
      at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
      at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
      at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
      at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
      at com.mongodb.DBCursor._check(DBCursor.java:368)
      at com.mongodb.DBCursor._next(DBCursor.java:419)
      at com.mongodb.DBCursor.next(DBCursor.java:494)
      What can be done with this? when I try to fetch the same document with RoboMongo it is received correctly.

      Note: Cursor did not fail with hundreds of thounds of documents, but I presume the problem with this one is in the word hvězdnější, because of its UTF-8 characters (UTF-8 also figures in stack trace)

      Attachments

        Activity

          People

            Unassigned Unassigned
            mimkorn Šimon Demo?ko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: