Content Fragment Model fails to save or load due to Sling request limits
Content Fragment Models fail to save, fail to display all fields, or revert changes when Sling request-processing limits are set too low. Two settings are commonly involved: sling.max.calls, which controls how many backend calls the editor makes, and request.max.file.count, which controls multipart save requests. Upgrades reset these limits or custom OSGi configurations overwrite them, which triggers errors such as TooManyCallsException and FileCountLimitExceededException. To fix this, raise the affected Sling limit, remove conflicting configuration overrides, and confirm the editor loads and saves correctly.
Description description
Environment
- Adobe Experience Manager as a Cloud Service
- AEM Managed Services
- AEM 6.5 On-Prem
Issue/Symptoms
- Error logs show
TooManyCallsException. - Error logs show
FileCountLimitExceededException: attachment. - Content Fragment Model fields do not save.
- New fields disappear after you reopen the model.
- The editor does not display all tabs or fields when the model contains many fields.
- The Add button is missing in dialogs with nested multi-lists.
Cause
AEM uses Sling request-processing limits to protect against excessive request execution and oversized multipart form submissions. If sling.max.calls is too low, the Content Fragment Model editor exceeds the allowed number of backend calls when loading or saving complex models, which causes TooManyCallsException. If request.max.file.count is too low, multipart save requests fail with FileCountLimitExceededException, even when no files are being uploaded. Upgrades or custom OSGi configurations reset or override these values and cause the problem to return.
Resolution resolution
To address Content Fragment Model save or load failures caused by Sling request limits, follow these steps:
-
Identify which error is occurring by reviewing the
error.log. -
If the log shows
TooManyCallsException, increasesling.max.callsin Apache Sling Main Servlet.- For AEM 6.5 On-Prem or AEM Managed Services, open
/system/console/configMgr, locateApache Sling Main Servlet, and increaseNumber of Calls per Requestincrementally to a higher value such as2000or3000. - For AEM as a Cloud Service, update
org.apache.sling.engine.impl.SlingMainServlet.cfg.jsonin yourui.configproject and setsling.max.callsto a higher value such as2000or3000.
- For AEM 6.5 On-Prem or AEM Managed Services, open
-
If the log shows
FileCountLimitExceededException: attachment, increaserequest.max.file.countin Apache Sling Request Parameter Handling.- For AEM 6.5 On-Prem or AEM Managed Services, open
/system/console/configMgr, locateApache Sling Request Parameter Handling, and setMaximum File Countto10000. - For AEM as a Cloud Service, update
org.apache.sling.engine.parameters.cfg.jsonin yourui.configproject and setrequest.max.file.countto10000.
- For AEM 6.5 On-Prem or AEM Managed Services, open
-
Check for conflicting custom OSGi configurations that override these values and remove or correct them.
-
Restart AEM where required for your deployment type so the updated values are applied.
-
Test the model again by adding fields, saving, and reopening the model.
-
Confirm that all fields persist and no new errors appear in the
error.log.