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-pnpmgoal of thefrontend-maven-pluginduring theui.frontendBuild stage. - No changes are made to
pom.xml,package.json, orpnpmconfiguration between runs. - Retrying the same pipeline or commit without code changes often results in a successful build.
- The failure occurs when the
frontend-maven-pluginexecutesnpm 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
npmerror 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:
-
Pin
Node,npm, andpnpmversions:- Explicitly specify the versions of
Node,npm, andpnpmin yourpom.xmlandpackage.jsonfiles to avoid version drift between local and Cloud Manager Builds.
- Explicitly specify the versions of
-
Use local
pnpminstallation:- Instead of using a global install (
npm install -g pnpm), use a local install by runningnpm install pnpmand invoking./node_modules/.bin/pnpmin your Build scripts. This reduces sensitivity to globalnpmpermissions and path issues within the Build container.
- Instead of using a global install (
-
Review
.npmrcfiles:- Ensure all
.npmrcfiles (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 sporadicnpminstall failures.
- Ensure all
-
Commit and stabilize lockfiles:
- Make sure your lockfile (
pnpm-lock.yamlorpackage-lock.json) is committed and stable to ensure reproducible dependency resolution between builds.
- Make sure your lockfile (
-
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.