Can’t access Adobe Commerce on cloud repo: 403 Forbidden or 404 Not Found error when deploying
To resolve Adobe Commerce deployment errors like 403 Forbidden or 404 Not Found, obtain valid authorization keys, and ensure they are correctly specified in the env:COMPOSER_AUTH
variable and auth.json
file.
Description
Environment
Adobe Commerce on cloud infrastructure versions 2.2.x, 2.3.x, and 2.4.x
Issue/Symptoms
When deploying Adobe Commerce on cloud infrastructure, you might encounter errors indicating that the repository URL could not be accessed, resulting in deployment failure. In the deployment error log in the Project UI, an error message similar to the following is displayed:
The ‘https://repo.magento.com/archives/magento/magento-cloud-configuration/magento-magento-cloud-configuration-x.x.x.x.zip’ URL could not be accessed: HTTP/1.1 403 Forbidden
OR
The ‘https://repo.magento.com/archives/magento/module-customer-segment/magento-module-customer-segment-x.x.x.x-patchY.zip’ file could not be downloaded (HTTP/1.1 404 Not Found)
(Click the Failure icon in the Project UI to see the log.)
Cause
The primary cause of these errors is invalid or incorrectly specified authorization keys. This can happen due to:
- Using keys generated from a shared account
- License revocation due to payment issues
Note: If you find this is due to an invoicing or lapsed contract issue, please contact your Adobe Account Team for guidance to get this resolved. After your license is re-activated, your support and deployment entitlements will be restored.
Resolution
Take the following steps to solve the issue with the authorization keys:
-
To obtain valid authorization keys (skip this if you are sure your key is valid):
- Contact the Adobe Commerce license owner to generate the keys if you were using those created under a shared account. If your license was previously revoked due to payment issues but has since been renewed, you will need to generate new authentication keys.
- If the account owner is unable to log in to the Commerce Marketplace, submit a support request at Adobe Experience League for further assistance.
- If the login is successful, check the MAGE ID at your Commerce Marketplace to ensure it is associated with the current account owner’s email address. If the Mage ID is associated correctly, submit a support request at Adobe Experience League for further assistance. If not, submit a support case directly to the Marketplace team by visiting the Adobe Commerce Marketplace site, navigating to the bottom of the page, and clicking Contact Us to open a form for submitting a Marketplace support ticket.
- If that doesn’t work, send an email directly to Commerce Marketplace Support to request an update to the email address associated with the MAGE ID.
-
Add the keys value in the
env:COMPOSER_AUTH variable
(or make sure that the correct value is there) and check if the keys are specified consistently in the variable on the project level and environment level as well as theauth.json
file (if it exists) in the project root. See the instructions and related information in Prepare your existing system and Add authentication keys in the Commerce on Cloud Guide. -
Update or delete
auth.json
, to have a single place where the key is configured, if the authorization keys values are not specified or have another value. Log in to the machine that has your Adobe Commerce on cloud infrastructure SSH keys and then log in to your project:magento-cloud login
-
Create a branch to update the code (in the following example the branch name is
auth
is created from the primary branch):magento-cloud environment:branch auth master
-
Change to the project root directory.
-
Optional: Delete the
auth.json
if you prefer and continue to step 10. -
Open
auth.json
in a text editor.{ "http-basic": { "repo.magento.com": { "username": "<public_key>", "password": "<private_key>" } } }
-
Add the correct authentication keys.
-
Save your changes and exit the text editor.
-
Commit and merge your changes:
git add -A git commit -m "<message>" git push origin master
-
Wait for the project to deploy.