AEM as a Cloud Service: ‘Invalid content fragment’ error when publishing Content Fragments in new editor
This article explains how to resolve intermittent i nvalid content fragment errors when publishing Content Fragments using the new editor in Adobe Experience Manager as a Cloud Service.
Description description
Environment
Adobe Experience Manager as a Cloud Service (all versions)
Issue/Symptoms
When publishing Content Fragments using the new editor in AEM as a Cloud Service, the following symptoms may occur:
- Intermittent errors appear with the message invalid content fragment.
- Affected Content Fragments appear to publish successfully but remain in the Modified state.
- Logs indicate the publish workflow treats the fragment as invalid and removes it from the publish tree.
- Publishing the same Content Fragments using the old editor works without issue.
Example error message:
Invalid content fragment
Publishing is disrupted for multiple product Content Fragments, impacting product page updates.
Resolution resolution
Follow these steps to resolve the issue:
-
Use the Content Fragment API to check the
validationStatusof the affected Content Fragment (For example: GET /adobe/sites/cf/fragments/<UUID>). -
Review the AEM author logs for details on why the fragment is marked as invalid.
-
Inspect Rich Text fields (such as
mtPrintControllerFonts) within the Content Fragment for invalid HTML, such as:- Incorrect tag structure
- Unescaped special characters
-
Correct any invalid HTML in the affected fields:
- Fix tag nesting and structure.
- Properly escape special characters as needed.
-
Save the Content Fragment and attempt to publish again using the new editor.
-
Confirm that the Content Fragment publishes successfully and no longer remains in the Modified state.
Cause
Invalid HTML in a Rich Text field (For example: mtPrintControllerFonts) causes the Content Fragment to be marked as invalid by the new editor’s validation process, preventing successful publishing.