[SERVER-5125] Returning excessive results 64MB+ from aggregation gives a confusing error message Created: 28/Feb/12  Updated: 11/Jul/16  Resolved: 22/Mar/12

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 2.1.1

Type: Improvement Priority: Trivial - P5
Reporter: Ross Lawley Assignee: Chris Westin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

The error message doesn't tell the user what they need to do to remedy the situation.

> db.tweets.aggregate({$match: {}});
{
	"errmsg" : "exception: BufBuilder attempted to grow() to 134217728 bytes, past the 64MB limit.",
	"code" : 13548,
	"ok" : 0
}



 Comments   
Comment by ??ng Anh Toàn [ 10/Sep/14 ]

Hi ross@10gen.com,
Thank you very much and sorry for this inconvenience.

Comment by Ross Lawley [ 09/Sep/14 ]

Hi dang.toan,

Just to let you know this ticket has been closed, also this Jira project is for MongoDB bugs and feature requests. The best place for questions regarding MongoDB usage is the mongodb-user mailinglist or stackoverflow as you will reach a boarder audience there.

In regards to returning results larger than 64MB from the aggregation framework please see the $out operator which was introduced in 2.6

Regards,

Ross

Comment by ??ng Anh Toàn [ 09/Sep/14 ]

Hi Mr. cwestin,
How to fix this issue? Could you share me or any advice to improve?

Comment by auto [ 22/Mar/12 ]

Author:

{u'login': u'cwestin', u'name': u'U-tellus\\cwestin', u'email': u'cwestin@10gen.com'}

Message: SERVER-5125 minor tweaks per code review
Branch: master
https://github.com/mongodb/mongo/commit/08589bfccd2a6be6552aebad215c5dc0746a9b1b

Comment by auto [ 22/Mar/12 ]

Author:

{u'login': u'cwestin', u'name': u'U-tellus\\cwestin', u'email': u'cwestin@10gen.com'}

Message: SERVER-5125 beautify oversized BSON error for aggregation results
Branch: master
https://github.com/mongodb/mongo/commit/c286a150ff6341faf0c97976748b186ea50b3575

Comment by Chris Westin [ 07/Mar/12 ]

This generic message comes from class _BufBuilder in bson/util/builder.h. This is probably being called from the network layer, in preparation for sending a larger document across. Unfortunately, the BSON spec requires the document to be prefixed by its length, so we must serialize the whole thing to a buffer before being able to transmit it.

This generic message occurs after the result document has been handed out to the command framework as a response; the aggregation code is not in control when this error is thrown. The same message would result if the user created a large document through the use of something like $push, and tried to retrieve the document.

@Eliot, do you have any suggestions on how to improve this for the varied situations that could cause it to arise?

Generated at Thu Feb 08 03:07:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.