ÃÛ¶¹ÊÓÆµ

Resolving deployment errors in AEM as a Cloud Service

This article addresses deployment errors in ÃÛ¶¹ÊÓÆµ Experience Manager (AEM) as a Cloud Service caused by customizations in the repository initialization script. When deploying a feature branch to the development stage, these errors can hinder successful deployment and are not easily visible in the logs. Analyzing debug logs fixes the issue.

Description description

Environment

  • Product: ÃÛ¶¹ÊÓÆµ Experience Manager (AEM) as a Cloud Service - Sites
  • Stage: Development
  • Constraints: Direct modifications via the Felix Console are restricted.

Issue/Symptoms

  • Deployment of a feature branch fails due to repository initialization errors.

  • Logs display messages such as:

    code language-none
    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 310, script[ 0] " was: CreatePath execution failed at cq(sling:Folder): javax.jcr.nodetype.ConstraintViolationException: org.apache.jackrabbit.oak.spi.state.ReadyOnlyBuilderException: This builder is read-only...
    
  • Errors indicate attempts to modify read-only nodes or immutable parts of the repository.

Resolution resolution

To resolve the issue, follow these steps:

  1. Set the log level to DEBUG for repo-init operations to get detailed exception information during repository initialization. Since direct access via Felix Console is restricted, use a custom logging configuration within your project.

  2. Create an OSGi configuration file under your project’s /apps/<your-project>/config/ folder, such as com.adobe.granite.logging.impl.LogManagerFactory.config.

    • Include the following properties in this file:

      code language-none
      loggers=[ "org.apache.sling.jcr.repoinit.impl.RepositoryInitializerFactory"]
      org.apache.sling.jcr.repoinit.impl.RepositoryInitializerFactory.log.level=DEBUG
      
  3. Deploy the updated configuration through Cloud Manager and verify that detailed debug logs for repo-init operations are visible after deployment.

  4. Review debug logs for additional context about errors during repository initialization, looking for indications of unauthorized modifications or attempts to alter read-only nodes.

  5. Ensure your repo-init script does not attempt to create or modify nodes within immutable parts of the repository (for example, system paths).

  6. Remove or adjust any CreatePath commands targeting nodes defined as cq(sling:Folder) if they reside in read-only areas. If new nodes or structures must be added, package these changes separately using content packages deployed to allowed paths.

Following these steps will help you identify and fix deployment failures while respecting AEM’s system path constraints.

Debugging AEM as a Cloud Service build and deployments

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f