Pipeline failures in AEM Sites due to user name conflicts in RepoInit scripts
During a production pipeline in Adobe Experience Manager (AEM) as a Cloud Service, the pipeline fails to progress beyond the Deployment phase due to service user name conflicts with existing user group names in RepoInit scripts. This article provides steps to resolve these conflicts.
Description
Environment
- Adobe Experience Manager (AEM) as a Cloud Service - Sites
- Component: Cloud Manager
Issue/Symptoms
During the execution of a production pipeline in AEM as a Cloud Service, the pipeline completes up to the Build Images stage but fails during the Deployment phase at the Install mutable content step.
The symptoms include:
-
Prolonged execution time before failure with previous instances taking several hours.
-
The deployment process becomes stuck.
-
The following errors appear in the error logs:
level: ERROR msg: [ Apache Sling Repository Startup Thread #1] com.adobe.granite.repository.impl.SlingRepositoryManager Exception in a SlingRepositoryInitializer, SlingRepository service registration aborted javax.jcr.RepositoryException: Applying repoinit operation failed despite retry; set loglevel to DEBUG to see all exceptions. Last exception message from "Configuration PID 325, script[ 0] " was: Unable to create service user [ <serviceusername>] :org.apache.jackrabbit.api.security.user.AuthorizableTypeException: Invalid authorizable type 'interface org.apache.jackrabbit.api.security.user.User
level: ERROR msg: [ Apache Sling Repository Startup Thread #1] com.adobe.granite.panic.impl.PanicLoggerDetail uuid : 000000xx-xx00-0x00-00xx-000000xx0xxx reason : Exception in a SlingRepositoryInitializer, SlingRepository service registration aborted throwable : javax.jcr.RepositoryException: Applying repoinit operation failed despite retry; set loglevel to DEBUG to see all exceptions. Last exception message from "Configuration PID 325, script[ 0] " was: Unable to create service user [ <serviceusername>] :org.apache.jackrabbit.api.security.user.AuthorizableTypeException: Invalid authorizable type 'interface org.apache.jackrabbit.api.security.user.User _ at...
Cause
The root cause identified for this issue is a conflict with existing user or group names within the repository. In particular, if there is an attempt to create a service user with an ID that matches an existing group name, it results in conflicts that prevent successful deployment.
Resolution
To resolve conflicts when creating service users during deployment, follow these steps:
- Verify if any existing groups or users have the same names as those being created by your RepoInit script.
- Ensure that service user names specified in your RepoInit script do not conflict with any pre-existing user or group IDs within your environment.
- Example adjustment might involve renaming either the conflicting group/user or altering your script’s naming conventions.
- Once changes are made to avoid naming conflicts, redeploy your code through the pipeline and verify whether it proceeds previously failing steps.
- Test deployments on non-production environments first after making adjustments to ensure no further issues occur before attempting another production deployment.
- If further assistance is required, consider reaching out for additional support from Adobe’s technical team.