Error: "Size [X] is larger than MaxDocumentSize 16793600" in ProfileUnity Console
ProfileUnity Console — MongoDB Document Size Limit Exceeded When Clicking Update
ℹ️ About This Article This article covers the cause and resolution for the ProfileUnity Console error 'Size [X] is larger than MaxDocumentSize 16793600' that appears when clicking Update. This error means the ProfileUnity configuration document stored in MongoDB has reached MongoDB's 16 MB document size limit. The article covers the immediate workaround, steps to permanently resolve the issue by reducing configuration size, and how to check current document size. |
Overview
| Error Message | Size [X] is larger than MaxDocumentSize 16793600 |
| Applies To | ProfileUnity Management Console — all versions |
| Trigger | Clicking Update in the ProfileUnity Console fails with this error |
| Root Cause | The configuration document has reached MongoDB's 16 MB BSON document size limit, a platform-level constraint that applies to all MongoDB-based applications |
| Quick Fix | Log out of the console completely, close the browser, log back in, then click Update again |
| Permanent Fix | Reduce configuration size by removing unused rules, trimming portability path lists, externalizing large scripts, or splitting the configuration |
Symptom
When clicking the Update button in the ProfileUnity Management Console, the following error is displayed and the configuration change is not saved:
| Size 1788427 is larger than MaxDocumentSize 16793600 |
| -- or -- |
| Size 1692384 is larger than MaxDocumentSize 16793600 |
The number before "is larger than" varies and represents the actual byte size of the ProfileUnity configuration document at the time of the failed write. The number 16793600 is a fixed MongoDB limit (16 MB). The error may also appear as:
- "Size is larger than MaxDocumentSize" (without the specific byte count)
- A generic console save error referencing MongoDB in the server logs
Immediate Resolution
If the error appears when attempting to save, the following steps reset the browser session state and typically allow the current save to succeed:
- Click Cancel or navigate away without saving.
- Log out of the ProfileUnity Management Console completely.
- Close the browser tab or window.
- Log back in to the ProfileUnity Management Console.
- Navigate back to the section you were editing and click Update.
Why This Works Each browser session accumulates pending changes in memory before writing to MongoDB. Logging out resets this in-memory state. When you log back in and click Update, only the current set of changes is written, which may fall under the document size threshold. |
If the Error Persists After Re-Login If the error continues after logging out and back in, the configuration document has already reached the MongoDB 16 MB hard limit. No further saves are possible until the configuration size is reduced. See the Reducing Configuration Size section below. |
Root Cause
MongoDB enforces a maximum BSON document size of 16 MB (16,793,600 bytes). This is a platform-level constraint that applies to any application using MongoDB, regardless of the data being stored. When any single document in the database reaches this threshold, further writes to that document are rejected until its size is reduced.
In large or long-established ProfileUnity environments, configurations naturally grow over time as rules are added across modules, portability paths are expanded, and new features are adopted. Environments most likely to encounter this limit are those with rich, complex configurations that have evolved over several years. Common contributing factors include:
- A large number of portability rules with detailed file and registry path lists
- User Defined Script rules with substantial inline script content
- Extensive FlexApp package assignments or multi-layered filter conditions
- Configurations that have been in active use for many years with accumulated rules across multiple modules
Reducing Configuration Size
To permanently resolve this error, the ProfileUnity configuration document must be reduced below the 16 MB limit. The following actions have the most impact:
- Remove unused or legacy rules across all modules. Delete rules that apply to users, groups, or applications that are no longer active, and consolidate any duplicate rules.
- Trim portability path lists. Remove paths that are no longer needed and use folder-level or wildcard paths where possible rather than enumerating individual files.
- Externalize large script content. Move inline script bodies in User Defined Script rules to external files on a network share and call them via powershell.exe or cmd.exe with the file path as an argument.
- Split the configuration. If the document cannot be reduced enough, split it into two or more separate ProfileUnity configurations scoped to different user groups using filter conditions and the Secondary Path (ADM/ADMX GPO).
Backup Before Making Changes Export a backup of the current configuration from the ProfileUnity Console under Administration before making large-scale changes. |
| Product | Liquidware ProfileUnity |
| Component | ProfileUnity Management Console / MongoDB |
| Applies To | ProfileUnity 6.x (all versions) |