AEM SegmentNotFoundException
When these occur on tarMK-based AEM instances, shutdown the instance ASAP and run oak-run check to determine if the repository journal must be rolled back. If the journal is rolled back, some amount of data will be lost. Note that one must use the oak-run version matching the version of oak used in the AEM instance. To determine which version is in use, navigate to /system/console and search for the bundle named Oak Core and check the version.
Note that the -Xmx argument used below should be adjusted for the memory available on the system but is a reasonable number for the AEM systems in production.
Note that the -Xmx argument used below should be adjusted for the memory available on the system but is a reasonable number for the AEM systems in production.
- ● One should log all the work done using standard methods such as terminal logging, screen logging, script, etc. in case problems occur.
- ● Shutdown AEM
- ● Ideally make a full backup
- ● cd LOCAL-INSTANCE-DIRECTORY/crx-quickstart/repository
- ● java -Dtar.memoryMapped=true -Xmx 32G -jar
/opt/aem/bin/oak-run-1.4.x.jar check -d1 -p segmentstore - ● At the end, should say:
INFO o.a.j.o.p.s.f.t.ConsistencyChecker – Found latest good revision XXX:YYYY, where
XXX:YYY is a long string. - ● Find XXX in segmentstore/journal.log, if not the last line in the file, must roll back.
- ● To determine the approximate date/time one would be reverting the repository to run the following
command (replace LAST-GOOD-REVISION with the latest good revision found from the oak-run check command just run, ignore the portion at the end in :YYYY):
cd LOCAL-INSTANCE-DIRECTORY/crx-quickstart/repository;
find segmentstore -type f -name "data*.tar" -exec \sh -c "tar -tvf {} |grep LAST-GOOD-REVISION" \; -printNote that once the command outputs lines matching the revision, one can interrupt the command with
ctrl-c. - ● If rolling back, make a backup copy of journal.log: c p segmentstore/journal.log
segmentstore/journal.log.pre-rollback.`date +%m%d-%H%M` - ● Edit segmentstore/journal.log and remove all lines b elow the last good revision determined above
- ● Probably a good time to do an offline compaction as well
- ● Start the AEM instance
Comments
Post a Comment