Getting an AuthenticationSupport service missing. Cannot authenticate request.

abn93

08-09-2020

I have AEM 6.5.4 and I am unable to login to the AEM publish instance over the 4503 port. When I try logging into the crx/de page, I am getting the below message :

HTTP ERROR 503

Problem accessing /crx/packmgr/index.jsp. Reason:

    AuthenticationSupport service missing. Cannot authenticate request.

I am also unable to check the bundles state as I keep getting a pop up box to login even after entering the correct credentials. I have also tried the following but to no avail:

 

1) Stopped aem java process.

2) Removed the /crx-quickstart/repository/index folder.
3) Ran a consistency check but could not find any good revisions (Used oak-run-1.10.8.jar) :
java -Xmx6000m -jar oak-run-*.jar check --bin=-1 /path/to/crx-quickstart/repository/segmentstore

4) Removed all ./crx-quickstart/repository/segmentstore/*.bak files.

5) Ran the checkpoint clean-up to remove orphaned checkpoints:

java -Xmx6000m -jar oak-run-*.jar checkpoints /path/to/crx-quickstart/repository/segmentstore rm-unreferenced

6) Finally compacted the repository:

java -Xmx6000m -jar oak-run-*.jar compact /path/to/crx-quickstart/repository/segmentstore/

 

The compaction failed with the below error:

13:38:33.737 [main] ERROR o.a.j.o.s.SegmentNotFoundExceptionListener - Segment not found: 0a8221f8-e84d-4c6c-a91d-ee87067e9f1e. SegmentId age=29ms
org.apache.jackrabbit.oak.segment.SegmentNotFoundException: Segment 0a8221f8-e84d-4c6c-a91d-ee87067e9f1e not found

 

7) Started AEM and it throws the same error on the crx/de page.

 

Also, the error.log file shows the below error:

08.09.2020 13:10:50.627 *ERROR* [qtp249820188-60] org.apache.sling.engine.impl.SlingHttpContext handleSecurity: AuthenticationSupport service missing. Cannot authenticate request.
08.09.2020 13:10:50.628 *ERROR* [qtp249820188-60] org.apache.sling.engine.impl.SlingHttpContext handleSecurity: Possible reason is missing Repository service. Check AuthenticationSupport dependencies.

 

Please let me know how this can be resolved.

 

@Shashi_Mulugu 


Accepted Solutions (1)

Accepted Solutions (1)

abn93

09-09-2020

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  

Answers (5)

Answers (5)

ChitraMadan

MVP

08-09-2020

Hi @abn93 ,

 

Try to delete these 2 files and start the instance again:

 

/crx-quickstart/repository/segmentstore - repo.lock

/crx-quickstart/launchpad/felix - cache.lock

 

aemmarc

Employee

08-09-2020

RE -- 4) Removed all ./crx-quickstart/repository/segmentstore/*.bak files.

 

That documentation really should be updated.

 

Deleting the .bak files is actually a poor idea and shouldn't be done until the instance is restored to a healthy state.

Removing the bak files essentially ensures you can't recover the journal entries. 

 

Adobe's documentation needs to be better here. 

 

 

vanegi

Employee

08-09-2020

Hi @abn93,

I see segment not found error [0] with AuthenticationSupport service missing, so it confirms that repository is corrupted. As the latter one is just a symptom but not an actual issue.

 

[0]:

13:38:33.737 [main] ERROR o.a.j.o.s.SegmentNotFoundExceptionListener - Segment not found: 0a8221f8-e84d-4c6c-a91d-ee87067e9f1e. SegmentId age=29ms
org.apache.jackrabbit.oak.segment.SegmentNotFoundException: Segment 0a8221f8-e84d-4c6c-a91d-ee87067e9f1e not found

 

Please follow https://helpx.adobe.com/in/experience-manager/kb/fix-inconsistencies-in-the-repository-when-segmentn... to fix SegmentNotFound Exceptions.

 

Thanks!!