org.bson.BSONException: bad string size: 1701707776

JIRA | Šimon Demočko | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

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

    Stack Overflow | 2 years ago
    org.bson.BSONException: bad string size: 1701707776
  2. 0

    (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)

    JIRA | 2 years ago | Šimon Demočko
    org.bson.BSONException: bad string size: 1701707776
  3. 0

    (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)

    JIRA | 2 years ago | Šimon Demočko
    org.bson.BSONException: bad string size: 1701707776
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.bson.BSONException

      bad string size: 1701707776

      at org.bson.BasicBSONDecoder$BSONInput.readUTF8String()
    2. MongoDB Java Driver
      DBCursor.next
      1. org.bson.BasicBSONDecoder$BSONInput.readUTF8String(BasicBSONDecoder.java:447)
      2. org.bson.BasicBSONDecoder.decodeElement(BasicBSONDecoder.java:155)
      3. org.bson.BasicBSONDecoder.decodeElement(BasicBSONDecoder.java:196)
      4. org.bson.BasicBSONDecoder._decode(BasicBSONDecoder.java:79)
      5. org.bson.BasicBSONDecoder.decode(BasicBSONDecoder.java:57)
      6. com.mongodb.DefaultDBDecoder.decode(DefaultDBDecoder.java:61)
      7. com.mongodb.Response.<init>(Response.java:83)
      8. com.mongodb.DBPort.go(DBPort.java:142)
      9. com.mongodb.DBPort.call(DBPort.java:92)
      10. com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
      11. com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
      12. com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
      13. com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
      14. com.mongodb.DBCursor._check(DBCursor.java:368)
      15. com.mongodb.DBCursor._next(DBCursor.java:419)
      16. com.mongodb.DBCursor.next(DBCursor.java:494)
      16 frames