Hi all, my MongoDB service went down due to an error: BSONObjectTooLarge. This error occurred because a single document exceeded the 16MB size limit

My MongoDB service went down due to an error - BSONObjectTooLarge, which occurs when a single document exceeds the 16MB limit. Has anyone else encountered this error, or is it a bug? Does anyone know a solution for it?

MongoDB version: 6.0.15
Operating system: Ubuntu 22.04.4, arm64


{“t”:{“$date”:“2025-02-15T15:01:12.082+00:00”},“s”:“E”, “c”:“ASSERT”, “id”:23077, “ctx”:“ftdc”,“msg”:“Assertion”,“attr”:{“error”:“BSONObjectTooLarge: BSONObj size: 17041110 (0x10406D6) is invalid. Size must be between 0 and 16793600(16MB) First element: start: new Date(1739631671000)”,“file”:“src/mongo/bson/bsonobj.cpp”,“line”:101}}
{“t”:{“$date”:“2025-02-15T15:01:12.084+00:00”},“s”:“F”, “c”:“CONTROL”, “id”:6384300, “ctx”:“ftdc”,“msg”:“Writing fatal message”,“attr”:{“message”:“terminate() called. An exception is active; attempting to gather more information\n”}}

Perhaps you should file an issue.

1 Like

Hi @Bharath_R_M1 and welcome to the MongoDB forums!

I was wondering:

  • do you think you actually have an object that’s larger than 16MB?
  • where is your DB hosted? (local docker, on-prem, hosting company, othe?)
  • Do you still get this message if you restart the MongoDB service/database

Context is FTDC this is server generated.

I second @Jack_Woehr’s reply. Create an issue on the MongoDB JIRA.

First upgrade to the latest 6.0 release 6.0.25 and if the error is encountered again, then log the issue.

If this continues to occur as a workaround disable FTDC:
https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.diagnosticDataCollectionEnabled

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.