Resolve SegmentNotFoundException errors in Adobe Experience Manager
This article explains how to address SegmentNotFoundException errors in Adobe Experience Manager (AEM) by restoring from a backup, validating repository health, and performing maintenance.
Description description
SegmentNotFoundException errors in Adobe Experience Manager indicate repository corruption or missing segments, which can render the AEM Author environment inaccessible and disrupt normal operations. These errors are typically seen as repeated log entries and an inability to access the AEM Author instance. Restoring from the last known good backup and validating repository health are critical steps to recover the environment and prevent further issues.
Environment
Adobe Experience Manager (AEM) Managed Services (all versions)
Symptoms
- SegmentNotFoundException errors in AEM logs
- Inability to access or use the AEM Author environment
- Requests to restore the last known working backup
Cause
SegmentNotFoundException errors are usually caused by repository corruption or missing segments, often requiring restoration from backup and repository compaction to resolve and prevent recurrence.
Resolution resolution
Follow the steps below to resolve the issue:
-
Identify the most recent valid backup of your AEM environment, ensuring it includes all necessary files such as the repository, datastore, and indexes.
-
Restore the backup to your AEM environment according to your organization’s backup and restore procedures. Ensure all components (repository, datastore, indexes) are restored to their correct locations.
-
After restoration, run repository, datastore, and index consistency checks to confirm the integrity of the restored environment. For the index consistency check, use the Oak-run tool with the appropriate parameters for your environment. Example command:
java -jar oak-run.jar index --index-consistency-check <datastore-config-path> <segmentstore-path>Replace
<datastore-config-path>and<segmentstore-path>with the correct paths for your environment. -
Review the output of the consistency checks to ensure all indexes are reported as valid.
-
Perform an offline compaction of the repository to optimize storage and prevent further segment issues. Schedule regular offline compaction and disable online compaction to reduce the risk of segment corruption.
-
Monitor the environment for recurrence of SegmentNotFoundException errors. If the issue recurs, review logs for long-running workflows or processes that may contribute to segment corruption.
-
(Optional) To capture heap or thread dumps for further analysis, use standard Java tools such as
jstackorjmapon the AEM process, following your organization’s procedures.