Hi All, thanks for all the inputs but it didn't help me entirely in resolving the issue as the suggested solutions do not work if there are no good revisions available when we do a consistency check.
I did the following to resolve it:
1) Stopped AEM
2) Removed the older index folder
3) Performed a consistency check and found that there were no good revisions to revert to. I however did get the corrupted segment node as part of the output of consistency check as follows:
Error while traversing /home/users/2/2Y8HtRhIxmRRla0aPjHn/.tokens/28caaf0d-8c12-49a8-bb58-92729676b55c: org.apache.jackrabbit.oak.segment.SegmentNotFoundException: Segment 8d66dcf3-cdde-4146-a778-4c40ddc93ee1 not found
4) Added the below groovy script to delete the repo node:
import org.apache.jackrabbit.oak.spi.commit.CommitInfo
import org.apache.jackrabbit.oak.spi.commit.EmptyHook
import org.apache.jackrabbit.oak.spi.state.NodeStore
import org.apache.jackrabbit.oak.commons.PathUtils
def rmNode(def session, String path) {
println "Removing node ${path}"
NodeStore ns = session.store
def nb = ns.root.builder()
def aBuilder = nb
for(p in PathUtils.elements(path)) { aBuilder = aBuilder.getChildNode(p) }
if(aBuilder.exists()) {
rm = aBuilder.remove()
ns.merge(nb, EmptyHook.INSTANCE, CommitInfo.EMPTY)
return rm
} else {
println "Node ${path} doesn't exist"
return false
}
}
5) Entered the oak jackrabbit repo console with the below command:
java -jar oak-run-*.jar console crx-quickstart/repository/segmentstore --read-write
6) In the console, I navigated to the node and loaded the groovy script using :load <Groovy script name>
7) Removed the node in the console, using
rmNode(session, "/home/users/2/2Y8HtRhIxmRRla0aPjHn")
8 ) Performed a consistency check and found a good revision to revert to
9) Reverted the repository to this revision by editing ./crx-quickstart/repository/segmentstore/journal.log and removed all lines after the line containing the latest good revision
10) Deleted the ./crx-quickstart/repository/segmentstore/*.bak files
11) Removed the orphaned checkpoints:
java -Xmx6000m -jar oak-run-*.jar checkpoints crx-quickstart/repository/segmentstore rm-unreferenced
12) Performed the offline tar compaction:
java -Xmx6000m -jar oak-run-*.jar compact crx-quickstart/repository/segmentstore/
13) Started AEM and I could then login!
Please note that the right version of the oak-run-*.jar file needs to be run for the corresponding version of AEM. For AEM 6.5.4, I used oak-run-1.10.8.jar
Hope this answer helps someone as I don't see it documented anywhere.
@Shashi_Mulugu