docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

Warning from repo.magento.com: Your Magento authentication keys are invalid.

Open avido opened this issue 11 months ago • 2 comments

Description 1st install i failed to enter the correct authentication credentials, right now install is no longer possible.

An update on documentation should suffice (~/.composer/auth.json)

Steps To Reproduce

  1. Install with wrong credentials

Expected Result Re-enter credentials

Actual Result

Creating a "magento/project-community-edition=2.4.6-p4" project at "./"
Warning from repo.magento.com: Your Magento authentication keys are invalid. Please double-check your keys in your Marketplace account. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html

In AuthHelper.php line 205:

  The 'https://repo.magento.com/packages.json' URL required authentication (H
  TTP 401).
  You must be using the interactive console to authenticate

avido avatar Feb 27 '24 10:02 avido

It's because the container already exists cached auth.json with the wrong credentials.

There are 2 ways to fix this issue:

1 Way (IMHO better than 2):

  1. Drop inside the docker container bin/bash

  2. Now, you can see the file which is called auth.json.sample, you should paste your public and private keys in this file vim auth.json.sample

  3. Rename the file from auth.json.sample to auth.json

2 Way (Re-install):

  1. Delete the file with the incorrectly cached credentials: rm ~/.composer/auth.json

  2. Clean up the failed install: bin/removeall

  3. Delete the files left behind by the failed install: cd .. followed by rm -rf yourpoject

Then, create your new project directory again so you can attempt the install process again. The bin/removeall command removes all previous Docker containers & volumes related to the specific project directory you are within. You can then attempt the installation process again.

YevhenZvieriev avatar Feb 27 '24 11:02 YevhenZvieriev

Yeah i know.. i wasn't really clear :)

Already mentioned a documentation update should suffice..

But tnxx for your quick reply !

avido avatar Feb 27 '24 12:02 avido