Resolving SegmentNotFoundException during workflow synchronization in AEM Forms 6.5
This article explains how to address workflow synchronization failures and SegmentNotFoundException errors that can occur in Adobe Experience Manager (AEM) Forms 6.5 after scheduled maintenance, especially when full repository compaction overlaps with heavy write operations.
Description description
Environment
Adobe Experience Manager (AEM) Forms 6.5 (OSGi, Standalone)
Issue/Symptoms
- Workflow synchronization fails or is missing after scheduled maintenance.
- Form submissions and workflows cannot proceed during the affected period.
- The issue resolves automatically after some time.
- The following error appears in logs for affected workflow jobs:
org.apache.jackrabbit.oak.segment.SegmentNotFoundException - The issue is specific to days when a full compaction runs, not during lighter maintenance operations.
Cause
This issue occurs because the full compaction process reclaims old-generation TAR files that are still referenced by active workflow jobs. If heavy write operations (such as a full LDAP synchronization) overlap with full compaction, segments required by ongoing workflows deleted, resulting in SegmentNotFoundException errors.
Resolution resolution
Follow these steps to resolve this issue:
-
Validate the procedure in a lower (non-production) environment to understand the commands, expected output, and overall process.
-
Before making any changes in production, take a complete and consistent backup or snapshot of the repository.
-
Perform a repository consistency check using the oak-run tool:
-
Ensure the AEM instance is offline before running repository-level operations.
-
Run the following command (replace
<path-to-oak-run.jar>and<path-to-repository>with your actual paths):java -jar <path-to-oak-run.jar> check <path-to-repository> -
Run the analysis against a backup copy of the production repository if possible to minimize downtime.
-
-
Review and adjust the scheduling of LDAP synchronization and full compaction tasks to avoid overlap, especially during high-write operations. Consider running full compaction at a different time or ensuring no heavy write operations occur during compaction.
-
After implementing changes, monitor workflow execution and logs for any recurrence of
SegmentNotFoundExceptionerrors: -
Check the AEM error.log and workflow logs for the
SegmentNotFoundExceptionpattern. -
If issues persist, repeat the consistency check and review task scheduling for further adjustments.