git asking for authentication when auth.json is present while running composer update

28 Views Asked by At

I'm trying to do a composer update inside a docker container but git continues to prompt me for credentials. After I press enter a few times it does fall back on the auth.json I have. Then it works just fine and installs the package from my private packagist without issue. Until the next package when it prompts me again for credentials.

I have a read-only gitlab token and added the config for it to composer

This is what I get when running composer update -vvv I omited the public packages I use which install without issue.

Executing command (CWD): git --version
  - Syncing nobears/2famodule (dev-master 14d0581) into cache
    Cloning to cache at '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-2famodule.git/'
Executing command (/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-2famodule.git/): git rev-parse --git-dir
Executing command (/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-2famodule.git/): git rev-parse --quiet --verify '14d05817c44a0cc73043f208e89d0adea2966d0f^{commit}'
Executing command (/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-2famodule.git/): git branch
Executing command (/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-2famodule.git/): git tag
  - Syncing nobears/cloudflare-module (dev-master b3b5c37) into cache
    Cloning to cache at '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-nobears-cloudflare-module.git/'
Executing command (CWD): git clone --mirror -- '[email protected]:company/modules/nobears-cloudflare-module.git' '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-nobears-cloudflare-module.git/'
[email protected]'s password: 
[email protected]'s password: 
[email protected]'s password: 
Executing command (CWD): git clone --mirror -- 'https://private-token:***@git.private.nl/company/modules/nobears-cloudflare-module.git' '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-nobears-cloudflare-module.git/'
Executing command (/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-nobears-cloudflare-module.git/): git rev-parse --git-dir
Executing command (/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-nobears-cloudflare-module.git/): git rev-parse --quiet --verify 'b3b5c37f97b053adb3cd5646c572d2e61bb1e21d^{commit}'
  - Syncing nobears/homepagemodule (dev-master 87ddd3a) into cache
    Cloning to cache at '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-homepage-3.0.git/'
Executing command (CWD): git clone --mirror -- '[email protected]:company/modules/homepage-3.0.git' '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-homepage-3.0.git/'
[email protected]'s password: 
[email protected]'s password: 
[email protected]'s password: 
Executing command (CWD): git clone --mirror -- 'https://private-token:***@git.private.nl/company/modules/homepage-3.0.git' '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-homepage-3.0.git/'
Executing command (/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-homepage-3.0.git/): git rev-parse --git-dir
Executing command (/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-homepage-3.0.git/): git rev-parse --quiet --verify '87ddd3ac1c0c294c8be28e6e97f6823d06561f56^{commit}'
  - Syncing nobears/logandreactionsremovemodule (dev-master e1982df) into cache
    Cloning to cache at '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-nobears-log-and-reactions-remove-module.git/'
Executing command (CWD): git clone --mirror -- '[email protected]:company/modules/nobears-log-and-reactions-remove-module.git' '/home/www-data/.composer/cache/vcs/git-git.private.nl-company-modules-nobears-log-and-reactions-remove-module.git/'

Running composer diagnose outputs the following:

docker compose exec php sh -c "composer diagnose"
Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK git version 2.39.2
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7EXX7CC5 573090D0  87719BA6 8F3BB723 4EXX42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8AXX  0C708369 153E328C AD901XXD AFE50952
OK
Checking Composer version: OK
Checking Composer and its dependencies for vulnerabilities: OK
Composer version: 2.7.2
PHP version: 8.1.27
PHP binary path: /usr/local/bin/php
OpenSSL version: OpenSSL 3.0.11 19 Sep 2023
cURL version: 7.88.1 libz 1.2.13 ssl OpenSSL/3.0.11
zip: extension present, unzip present, 7-Zip not available

I tried adding the GIT_ASKPASS=echo environment variable but it doesn't have any effect

0

There are 0 best solutions below