Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-3590

Mongodump fails with error "BSONObjectTooLarge: BSON size limit hit while building Message. Size: 17365941 (0x108FBB5); maxSize: 16793600(16MB)

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator
    • 68

      Problem Statement/Rationale

      What is going wrong? What action would you like the Engineering team to take?

      Mongodump (v5.0.6) fails with below error: {"t":\{"$date":"2024-06-25T10:20:25.011-04:00"},"s":"E",  "c":"COMMAND",  "id":4879802, "ctx":"conn2048","msg":"Failed to handle request","attr":{"error":"BSONObjectTooLarge: BSON size limit hit while building Message. Size: 17365895 (0x108FB87); maxSize: 16793600(16MB)"}}

      Steps to Reproduce

      How could an engineer replicate the issue you’re reporting?

      ./mongodump  -u<> -p<> --port xxxx --authenticationDatabase admin -o /dump/tmp

      Expected Results

      What do you expect to happen?

      Mongodump fails immediately.

      2024-06-25T23:01:02.348-0400    Failed: error creating intents to dump: error getting collections for database `admin`: connection(localhost:27307[-6]) socket was unexpectedly closed: EOF

      While mongodb.log throws in the above BSONObjectTooLarge error message.

      Actual Results

      What do you observe is happening?

      Additional Notes

      Any additional information that may be useful to include.

      User somehow granted permission to write in admin db where it houses ~180,000 colllections as shown below:

      PRIMARY> show dbs;
      admin     79.389GB
      aud        0.000GB

      --
      us         0.000GB
      usd        0.000GB
      PRIMARY> db.stats();
      {
              "db" : "admin",
              "collections" : 180538,  <<<<<< 180k collections in admin db
              "views" : 0,
              "objects" : 99310174,
              "avgObjSize" : 1627.59989601871,
              "dataSize" : 161637228876,
              "storageSize" : 78278610944,
              "indexes" : 180539,
              "indexSize" : 6964662272,

            Assignee:
            jian.guan@mongodb.com Jian Guan
            Reporter:
            booncheow.lee@mlp.com Boon Cheow Lee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: