0
votes

In my composer.json I updated the following line:

 "require": {
     "<x>/<y>" : "dev-<newBranch>"
 }

When I call composer update <x>/<y> I get this error:

The "https://repo.packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out`

The the given URL is accessible from my browser without any problem.

The package and branch are available on packagist.


Output composer update <x>/<y> -vv

Exception trace:

() at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:550 Composer\Util\RemoteFilesystem->get() at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:101 Composer\Util\RemoteFilesystem->getContents() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:682 Composer\Repository\ComposerRepository->fetchFile() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:497 Composer\Repository\ComposerRepository->loadRootServerFile() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:276 Composer\Repository\ComposerRepository->hasProviders() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Pool.php:99 Composer\DependencyResolver\Pool->addRepository() at phar:///usr/local/bin/composer/src/Composer/Installer.php:378 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:228 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:162 Composer\Command\UpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:241 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:843 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:193 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:254 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:103 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:56 require() at /usr/local/bin/composer:24


This appeared after calling: composer clearcache

1
what's the exact output of composer update <package> -vv and echo "$HTTP_PROXY" "$HTTPS_PROXY"? - Nicolai Fröhlich
` echo "$HTTP_PROXY" "$HTTPS_PROXY"` is empty - Lokomotywa
There's - probably important - ouput missing at the beginning of the trace - [..] (). Add the full trace including the exception message please. - Nicolai Fröhlich
Yes, but only this line: Exception trace: - Lokomotywa
So I guess not important - Lokomotywa

1 Answers

0
votes

Without fully understanding it, this solved the issue: sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"