Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPOSER_HOME is overidden, why? This causes the global composer configuration to be ignoring resulting in errors. #25

Open
kurzyx opened this issue Jul 9, 2024 · 0 comments

Comments

@kurzyx
Copy link

kurzyx commented Jul 9, 2024

Hi,

We receive an error (see error below) when running either composer update or composer scenario:update. This happens because the COMPOSER_HOME environment is set to the working directory each time update:lock is executed for each scenario. (See Handler::298.)

We have defined an auth.json in the original composer home directory which is required to access our private package registry (managed by our own GitLab instance). This file is not available in the working directory.

Simply commenting putenv("COMPOSER_HOME=$dir"); resolves the issue. Why is the original home directory changed before update:lock is executed?

The error:

In Handler.php line 508:
                                                                                                                                                                                                                               
  Error 100 from command 'composer -n update:lock --working-dir=/var/www/html/.scenarios.lock/my-scenario '                                                                                                                         
                                                                                                                                                                                                                               
  Output:                                                                                                                                                                                                                      
                                                                                                                                                                                                                               
  Deprecation Notice: Installer::setIgnorePlatformRequirements is deprecated since Composer 2.2, use setPlatformRequirementFilter instead. in phar:///usr/local/bin/composer/src/Composer/Installer.php:1374                   
  Loading composer repositories with package information                                                                                                                                                                       
  https://<our-gitlab-instance>/api/v4/group/5/-/packages/composer could not be fully loaded (The 'https://<our-gitlab-instance>/api/v4/group/5/-/packages/composer/packages.json' URL required authentication (HTTP 401).     
  You must be using the interactive console to authenticate), package information was loaded from the local cache and may be out of date                                                                                       
                                                                                                                                                                                                                               
  In AuthHelper.php line 205:                                                                                                                                                                                                  
                                                                                                                                                                                                                               
    The 'https://<our-gitlab-instance>/api/v4/group/5/-/packages/composer/p2/doctrine/annotations.json' URL required authentication (HTTP 401).                                                                                
    You must be using the interactive console to authenticate                                                                                                                                                                  
                                                                                                                                                                                                                               
                                                                                                                                                                                                                               
  update:lock [--dry-run] [--no-dev] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]                                                                                                                                                                                                                      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant