[SERVER-83742] Unable to start a mongod process using mongod –fork as mongo is trying to collectSystemInfo which is very large in size in my system Created: 30/Nov/23  Updated: 05/Feb/24

Status: Open
Project: Core Server
Component/s: Admin
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Nidhi Kumari Assignee: Brad Moore
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Security
Operating System: ALL
Sprint: Security 2024-01-08, Security 2024-02-05, Security 2024-02-19
Participants:

 Description   

I tried to launch mongoDB server using mongod --fork and I encountered with the below error message:
_

{“t”:\{“$date”:“2023-11-28T17:49:33.089Z”}

,“s”:“E”, “c”:“-”, “id”:23077, “ctx”:“main”,“msg”:“Assertion”,“attr”:{“error”:“BSONObjectTooLarge: BSONObj size: 17067964 (0x1046FBC) is invalid. Size must be between 0 and 16793600(16MB) First element: versionString: "Linux version 4.12.14-122.144-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) ) #1 SMP Mon Dec 12 09:21:50 UTC 2022 (bccc371)"”,“file”:“src/mongo/bson/bsonobj.cpp”,“line”:101}}_

I tried to explore more about this issue and got to know that mongo is internally trying to collect system information through the function “ProcessInfo::SystemInfo::collectSystemInfo()” and then saves it into a BSON object and then tries to write it in the DB. Some of the system informations which mongo tries to get is : /proc/version/proc/cpuinfo/proc/self/mouninfo/proc/meminfoetc

I checked the wordcount of these files in the host machine on which we were trying to launch DB. I got the below result :
wc -c /proc/version /proc/cpuinfo /proc/self/mountinfo /proc/meminfo
136 /proc/version
64018 /proc/cpuinfo
11518468 /proc/self/mountinfo
1286 /proc/meminfo
11583908 total

Then, I understood that the issue is due to the large size of “mountinfo”. But now, the issue is how to launch mongoDB without encountering this issue?

So, my questions are :

  1. Is there any way to disable mongod from collecting system info, i.e., is there any possible way to disable calling “ProcessInfo::SystemInfo::collectSystemInfo()” function? If yes, please ellaborate the ways I can do so…
  2. How to launch mongoDB without doing any changes in “/proc/” directory?


 Comments   
Comment by Brad Moore [ 02/Jan/24 ]

nidhi03october@gmail.com I will look into the feasibility of disabling collecting this info altogether if desired.

 

However, in the interest of solving the underlying problem: would you be able to share (redacted if necessary) the contents of /proc/self/mountinfo so that I can understand what would cause such a large file?

Comment by Alison Rhea Thorne [ 13/Dec/23 ]

Hello nidhi03october@gmail.com,

Thank you for your detailed report. I haven't found a way within MongoDB to disable that functionality specifically, nor have I found a way to control the maximum size of a BSON object easily. For now, Im going to assign this to a team that would better be able to determine how to increase the maximum size of a BSON object, which should resolve your issue if one is available.

I see you made a post on our community forum. As mentioned there, it might be worth pursuing alternative means of running MongoDB in your environment as was noted by the community.

Generated at Thu Feb 08 06:53:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.