Deployment fails with correct access keys in env:COMPOSER_AUTH or auth.json

This article provides a solution for the issue when your deployment fails with an error such as the one below, in the deployment log:

W:   [Composer\Downloader\TransportException]
W:   The "https://repo.magento.com/archives/magento/module-customer-balance/magento-module-customer-balance-100.4.0.0.zip" file could not be downloaded (HTTP/1.1 404 Not Found)

Affected products and versions

Adobe Commerce on cloud infrastructure 2.4.x

Issue

Steps to reproduce:

Attempt to deploy.

Expected results:

You deploy successfully.

Actual results:

NOTE
This is an example error. You could get an error indicating a different file (depending on which Adobe Commerce version you deploy).

You do not deploy successfully. You see an error like The “https://repo.magento.com/archives/magento/module-customer-balance/magento-module-customer-balance-100.4.0.0.zip” file could not be downloaded (HTTP/1.1 404 Not Found) in the deployment log.

Cause

The specified composer access keys found in one of these locations may not have access to the code:

  • in the env:COMPOSER_AUTH variable on the project level
  • in the auth.json file, which takes precedence over the env:COMPOSER_AUTH variable.

Solution

Update the env:COMPOSER_AUTH variable on the project level and ensure that it is configured with keys that have access to the code.

For steps, refer to Variable levels in Commerce on Cloud Infrastructure Guide.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a