markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.59k stars 1.01k forks source link

Installer does not work. The 'https://repo.magento.com/packages.json' URL could not be accessed: HTTP/2 403 #876

Closed SebTechDevelopment closed 1 year ago

SebTechDevelopment commented 1 year ago

Description Running the instructions returns an error:

# Create your project directory then go into it:
mkdir -p ~/Sites/magento
cd $_

# Run this automated one-liner from the directory you want to install your project.
curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.5-p1 community`

Results in the following error:

Composer auth has already been set up.
Fixing filesystem ownerships...
Filesystem ownerships fixed.
Creating a "magento/project-community-edition=2.4.5-p1" project at "./"

  [Composer\Downloader\TransportException]                                            
  The 'https://repo.magento.com/packages.json' URL could not be accessed: HTTP/2 403  

403 meaning, not all “a client is forbidden from accessing a valid URL”

Steps To Reproduce

  1. Begin clean
  2. Run: curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.5-p1 community`

Expected Result Magento gets downloaded from magento.com

Actual Result Magento does not get download from magento.com

Possible reason The most obvious reason is because of invalid auth.json details. The question is, what should these credentials be.

As we all know, Adobe tries to make it as difficult as possible to do anything. So, they refactored their API/key system without being verbose in how to use them.

According to their documentation: https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/prerequisites/authentication-keys.html It looks like that username / password requests by composer are now replaced by “MAG” code and “API key”.

The question is, of course, what data should be entered when prompted for username and password.

I have tried the following:

    "http-basic": {
        "repo.magento.com": {
            "username": "MAG-Code",
            "password": "API key"
        }
    }
    "http-basic": {
        "repo.magento.com": {
            "username": "Code without MAG",
            "password": "API key"
        }
    }
    "http-basic": {
        "repo.magento.com": {
            "username": "adobe username",
            "password": "API key"
        }
    }
    "http-basic": {
        "repo.magento.com": {
            "username": "adobe username",
            "password": "adobe password"
        }
    }

Are there any other combination possible? Do you guys have any suggestions?

SebTechDevelopment commented 1 year ago

Solved it. Api keys should be retrieved from https://marketplace.magento.com/customer/accessKeys/.