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:

  1. Identify which error is occurring by reviewing the error.log.

  2. If the log shows TooManyCallsException, increase sling.max.callsin Apache Sling Main Servlet.

    • For AEM 6.5 On-Prem or AEM Managed Services, open /system/console/configMgr, locate Apache Sling Main Servlet, and increase Number of Calls per Request incrementally to a higher value such as 2000 or 3000.
    • For AEM as a Cloud Service, update org.apache.sling.engine.impl.SlingMainServlet.cfg.json in your ui.config project and set sling.max.calls to a higher value such as 2000 or 3000.
  3. If the log shows FileCountLimitExceededException: attachment, increase request.max.file.countin Apache Sling Request Parameter Handling.

    • For AEM 6.5 On-Prem or AEM Managed Services, open /system/console/configMgr, locate Apache Sling Request Parameter Handling, and set Maximum File Count to 10000.
    • For AEM as a Cloud Service, update org.apache.sling.engine.parameters.cfg.json in your ui.config project and set request.max.file.count to 10000.
  4. Check for conflicting custom OSGi configurations that override these values and remove or correct them.

  5. Restart AEM where required for your deployment type so the updated values are applied.

  6. Test the model again by adding fields, saving, and reopening the model.

  7. Confirm that all fields persist and no new errors appear in the error.log.

recommendation-more-help
experience-cloud-kcs-help-kbarticles