DBObject of size (smaller than 16 mb) is over Max BSON size 16777216

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • 3.0.0
    • Affects Version/s: 2.11.0, 3.0.0
    • Component/s: Connection Management
    • None
    • Environment:
      Java Driver on linux, osx with mongo 2.4.2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Exception in thread "main" com.mongodb.MongoInternalException: DBObject of size 5242897 is over Max BSON size 16777216

      Perhaps it IS the intended behaviour to not allow queries or remove operation's query parameters to exceed 4mb - the limit in Bytes.MAX_OBJECT_SIZE, but this message is very strange, and can easily throw off a developer.

      Note that in OutMessage.java we check max on one thing _mongo.getConnector().getMaxBsonObjectSize()

      ...but report it on something else - which incidentally initializes it correctly.
      _mongo.getMaxBsonObjectSize()

      if (objectSize > Math.max(_mongo.getConnector().getMaxBsonObjectSize(), Bytes.MAX_OBJECT_SIZE))

      { throw new MongoInternalException("DBObject of size " + objectSize + " is over Max BSON size " + _mongo.getMaxBsonObjectSize()); }

            Assignee:
            Unassigned
            Reporter:
            rohit.nijhawan@10gen.com
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: