AEM Cloud Manager deployment fails with DEPLOY_FAILED_BAD_PACKAGES due to missing package dependencies
This article explains how to troubleshoot and resolve deployment failures in Adobe Experience Manager (AEM) Cloud Manager when a required package dependency is missing, resulting in the DEPLOY_FAILED_BAD_PACKAGES error.
Description description
Environment
Adobe Experience Manager (AEM) Cloud Manager (all versions)
Issue/Symptoms
During a Cloud Manager pipeline execution, the deployment to an environment (such as Stage or Production) fails. The deployment logs show an error similar to:
Failed to install /etc/packages/com.example.common/example.ui.content-<version>.zip. Error message: {"success":false,"msg":"Refusing to install package com.example.common:example.ui.content:<version>: required dependencies missing: [ com.example.common:example.ui.apps:<version>] "}
Cloud Manager reports:
errorCode: DEPLOY_FAILED_BAD_PACKAGES
publicMessage: The deployment failed due to an issue in the deployed packages. The content package (example.ui.content-<version>) has a declared dependency on example.ui.apps-<version>. The required apps package is not present at the specified version on the target AEM instances. As a result, AEM refuses to install the content package, and the deployment fails.
Cause
The deployment fails because a content package declares a dependency on a specific version of an apps package that is not present in the deployment artifacts or on the target AEM instances. AEM’s package manager enforces dependency checks and refuses to install packages with unmet dependencies, resulting in the DEPLOY_FAILED_BAD_PACKAGES error.
Resolution resolution
To fix the DEPLOY_FAILED_BAD_PACKAGES error, follow these steps:
- Verify package dependencies. Ensure that the required package (for example,
example.ui.apps) at the correct version exists in your codebase and is being built as part of the pipeline. - Confirm that your aggregator or “all” package includes both the apps and content packages (for example,
example.ui.appsandexample.ui.content) as sub-packages or embedded packages so both are generated and deployed together. - Make sure the version specified as a dependency in the content package matches the actual version of the apps package being built and deployed. If the versions don’t match, update the dependency declaration in the content package or ensure the apps package is built at the required version.
- After correcting the packaging and dependency configuration, re-trigger the Cloud Manager pipeline.
- Confirm that both packages are present in the deployment artifacts and that the deployment completes successfully.