How to fix the «Failed to execute git clone... 401 Unauthorized while accessing code.dmitry-fedyuk.com» issue?

ssh
ssh-key
composer
mage2.pro
composer-require
command-line
install-extension
(Dmitry Fedyuk) #1

Failed to execute git clone --no-checkout ‘https://code.dmitry-fedyuk.com/m2e/currency-form
at.git’ ‘/home/anine/public_html/vendor/mage2pro/currency-format’ && cd ‘/home/anine/public
_html/vendor/mage2pro/currency-format’ && git remote add composer ‘https://code.dmitry-fedy
uk.com/m2e/currency-format.git’ && git fetch composer
error: The requested URL returned error: 401 Unauthorized while accessing https://code.dmit
ry-fedyuk.com/m2e/currency-format.git/info/refs
fatal: HTTP request failed

0 Likes

How to fix the «Authentication failed for code.dmitry-fedyuk.com» failure for a composer command?
(Dmitry Fedyuk) #2

The problem could be because of a legacy Git version on your server.

Solution 1

So the first way to solve the problem is just to upgrade Git.

Solution 2

If the problem is not solved with Solution 1 (after Git upgrading), then use SSH authentication instead of HTTP authentication.
You need to register your SSH Key in the Mage2.PRO code repository.
Then redeclare the Mage2.PRO repository to the Composer, but use the https://mage2.pro/ssh URL instead of https://mage2.pro URL:

{
	"repositories": [
		{
			"type": "composer",
			"url": "https://mage2.pro/ssh"
		}
	]
}
0 Likes

(Dmitry Fedyuk) #3

From now on, the usage of https://mage2.pro/ssh instead of https://mage2.pro URL is the recommended way.

0 Likes

(Dmitry Fedyuk) #4

See also:

0 Likes