AEM Cloud Manager: Resolving intermittent install-pnpm failures in frontend-maven-plugin

This article describes how to address intermittent failures in Adobe Experience Manager (AEM) Cloud Manager pipelines that occur during the install-pnpm goal of the frontend-maven-plugin in the ui.frontend Build stage.

Description description

Environment

Adobe Experience Manager as a Cloud Service (AEMaaCS) using Cloud Manager pipelines with frontend-maven-plugin for ui.frontend Builds

Symptoms

  • The Cloud Manager Build pipeline fails intermittently at the install-pnpm goal of the frontend-maven-plugin during the ui.frontend Build stage.
  • No changes are made to pom.xml, package.json, or pnpm configuration between runs.
  • Retrying the same pipeline or commit without code changes often results in a successful build.
  • The failure occurs when the frontend-maven-plugin executes npm install -g pnpm, which exits with code 1 and is reported as BUILD_MAVEN_PACKAGE_ERROR.
  • The exported Build log doesn’t contain the inner npm error message, so the underlying cause isn’t visible.
  • The issue is confined to the frontend Build step and doesn’t affect environment provisioning or deployment infrastructure.

Cause

This type of intermittent failure is typically caused by transient issues in the frontend build or dependency resolution process, such as network instability, registry authentication problems, or version drift, rather than a platform-wide outage or infrastructure failure.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Pin Node, npm, and pnpm versions:

    • Explicitly specify the versions of Node, npm, and pnpm in your pom.xml and package.json files to avoid version drift between local and Cloud Manager Builds.
  2. Use local pnpm installation:

    • Instead of using a global install (npm install -g pnpm), use a local install by running npm install pnpm and invoking ./node_modules/.bin/pnpm in your Build scripts. This reduces sensitivity to global npm permissions and path issues within the Build container.
  3. Review .npmrc files:

    • Ensure all .npmrc files (project-level or global in the repository) have stable and reachable registry URLs and authentication tokens for Cloud Manager. Intermittent registry or authentication issues can cause sporadic npm install failures.
  4. Commit and stabilize lockfiles:

    • Make sure your lockfile (pnpm-lock.yaml or package-lock.json) is committed and stable to ensure reproducible dependency resolution between builds.
  5. If failures persist:

    • If similar BUILD_MAVEN_PACKAGE_ERROR failures occur frequently and aren’t resolved by the above steps, contact Adobe Support for further assistance.

After making these changes, rerun the pipeline to confirm that the build completes successfully.

recommendation-more-help
experience-cloud-kcs-help-kbarticles