Segment not found Oak error

If it gets corrupted we can following these steps to get this up:

It seems that there is an inconsistency in your segment store. You would need to run below steps to find the last good revision and revert back to it.

1) Using a version of oak-run (oak-run-1.1.7.jar), which has the new check run-mode https://github.com/apache/jackrabbit-oak/blob/trunk/oak-run/README.md#check
This helps checking the segment node store inconsistencies.

2) To revert a corrupt segment store to its latest good state change into CQ’s working directory (the one containing the crx-quickstartfolder) and and backup all files in ./crx-quickstart/repository/segmentstore/.

3) Now run the consistency check,

java -Dtar.memoryMapped=true -Xms8g -Xmx8g -jar <path to oak run>/oak-run-1.1.7.jar  check -d1 -p <path to aem repo>/crx-quickstart/repository/segmentstore

which will search backwards through the revisions until it finds a consistent one:
Look for message like below

Apache Jackrabbit Oak 1.1.7
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Searching for last good revision in journal.log
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Checking revision bd57b402-6579-4f00-a9b7-24b30a954db0:261492
[main] ERROR o.a.j.o.p.segment.SegmentTracker – Segment not found: 00000000-0000-0000-0000-000000000000. Creation date delta is 33 ms.
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Error while traversing bd57b402-6579-4f00-a9b7-24b30a954db0:261492
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Broken revision bd57b402-6579-4f00-a9b7-24b30a954db0:261492
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Checking revision 12b60e9c-ecb9-45ae-a863-2ba1f467bb53:261684
….
….
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Found latest good revision 12b60e9c-ecb9-45ae-a863-2ba1f467bb53:261684

4) Revert the repository to this revision by editing ./crx-quickstart/repository/segmentstore/journal.log and deleting all lines after the line containing the latest good revision.
I.e. after 12b60e9c-ecb9-45ae-a863-2ba1f467bb53:261684 The bad one (which is bd57b402-6579-4f00-a9b7-24b30a954db0:261492)

5)Save journal.log file.
6) Delete the file ‘repo.lock’ and restart server.

Scroll to Top