Skip to content

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

@kurzyx

Description

@kurzyx

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>...]                                                                                                                                                                                                                      

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions