We are running a Team Foundation Server (on premises) and as part of a build process it runs composer to install dependancies. Sometime in the last week this process has started failing and I cannot figure out why.
Here is the console output from a failed run:
- Installing symfony/polyfill-ctype (v1.11.0): Downloading (connecting...)Downloading (failed)
Downloading (connecting...)Downloading (failed)
Downloading (connecting...)Downloading (failed) Failed to download symfony/polyfill-ctype from dist: The "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a" file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Now trying to download from source
- Installing symfony/polyfill-ctype (v1.11.0): Cloning 82ebae0220
[RuntimeException]
Failed to clone https://github.com/symfony/polyfill-ctype.git via https, ss
h protocols, aborting.
- https://github.com/symfony/polyfill-ctype.git
Cloning into 'D:\agent\_work\3\s\vendor\symfony\polyfill-ctype'...
fatal: unable to access 'https://github.com/symfony/polyfill-ctype.git/':
Failed to connect to github.com port 443: Timed out
- git#github.com:symfony/polyfill-ctype.git
Cloning into 'D:\agent\_work\3\s\vendor\symfony\polyfill-ctype'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Here is part of the output from a successful run about a month ago:
2021-03-25T09:46:09.0972736Z Package operations: 28 installs, 0 updates, 0 removals
2021-03-25T09:46:09.0972880Z - Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
2021-03-25T09:46:09.2716787Z - Installing webmozart/assert (1.4.0): Loading from cache
2021-03-25T09:46:09.5064411Z - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
2021-03-25T09:46:09.7547542Z - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
2021-03-25T09:46:10.0682007Z - Installing phpdocumentor/reflection-docblock (4.3.1): Loading from cache
2021-03-25T09:46:10.4608228Z - Installing phpunit/php-token-stream (3.0.1): Loading from cache
The successful run shows it is "loading from cache" rather than going to github. I'm not that experienced with composer so I'm not sure what has gone wrong. No settings on our TFS system have changed to my knowledge.
The server that this runs cannot access github as it is behind a firewall & proxy that block it. But that has always been the case.
Does anyone know why composer would previously have been using a cache and is now trying to access github?
I have been searching the internet for hours for how the composer cache works but haven't been able to find anything that helps.
Many thanks for any help.
Set variable system.debug to true to check the log to see whether you can get more information.
It seems the composer cache is removed on your agent machine recently. You would either make your agent machine access the internet, or install the package manually on the agent machine.
I finally got this issue fixed by getting our corporate proxy updated to allow our build server to access github.
I still do not know how builds were working for so long without issue because to my best knowledge the build server would not have been allowed to access github for at least the last year. I can only assume that either somebody manually setup the Composer cache or the server could, at some time, access github and then the cache just lasted for a very long time.
This was one of those confusing problems where nothing seems to have changed to explain it. However I think something must have changed just a long time ago and the cache was masking it.
Thanks to everyone who helped.
Related
You need to install the project, follow the instructions, docker-compose up is successfully completed, however, when executing the docker-compose exec php composer install -o --prefer-dist command, the following message appears:
Loading composer repositories with package information
Installing dependencies (including require-dev) from the lock file
Package operations: 244 installations, 0 updates, 0 deletions
- Installation of yiisoft/yii2-composer (2.0.8): Download (failed)
Download (failed)
Download (failed) Failed to load yiisoft/yii2-composer from disk: "https://api.github.com/repos/yiisoft/yii2-composer/zipball/5c7ca9836cf80b34db265332a7f2f8438eb469b9 " file failed to load: stream failed to open: connection timeout expired
Now I'm trying to download from the source code
I assume that there is a problem with network access, but I do not understand what is the matter
os - ubuntu
environment - phpstorm
I'm having this error when I execute composer update in my laravel project (it's been working for years):
- Installing smatar/laravel-settings (1.3): Downloading (failed) Failed to download smatar/laravel-settings from dist: The "https://api.github.com/repos/SMATAR/laravel-settings/zipball/7b76462fe90224688c632d90c5f84a28c0f6e2bc" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
- Installing smatar/laravel-settings (1.3): The authenticity of host 'github.com (18.231.5.6)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Cloning 7b76462fe9
[RuntimeException]
Failed to clone https://github.com/SMATAR/laravel-settings.git via https, ssh protocols, aborting.
- https://github.com/SMATAR/laravel-settings.git
Cloning into '/var/www/html/prod/web/vendor/smatar/laravel-settings'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/SMATAR/laravel-settings.git/'
- git#github.com:SMATAR/laravel-settings.git
Cloning into '/var/www/html/prod/web/vendor/smatar/laravel-settings'...
Warning: Permanently added the RSA host key for IP address '18.228.67.229' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Package deleted from github: https://github.com/SMATAR/laravel-settings
Packagist page for package: https://packagist.org/packages/smatar/laravel-settings
You must contact with package publisher.
I've been trying to troubleshoot this error in many ways (including re-installing composer, clearing the cache, diagnosing composer, checking for an empty AutoRun folder in the registry etc.) I've also tried installing Drush first but get the same error.
For clarity this is my first Drupal install, but I've been very careful up to this point and no warnings or errors are showing up in my php.
I've been running the following from the admin (and default) command line:
composer create-project drupal-composer/drupal-project:8.x-dev
The full error message is as follows:
Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d3a1c9363d53fc6da4111701269496e9ca)
- Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d)
Cloning 3b9ee0d3a1c9363d53fc6da4111701269496e9ca
Failed to download drupal-composer/drupal-project from source: RecursiveDirectoryIterator::__construct(C:\drupal-project,C:\drupal-project): The system cannot find the file specified. (code: 2)
Now trying to download from dist
- Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d)
[UnexpectedValueException]
RecursiveDirectoryIterator::__construct(C://drupal-project/,C://drupal-project/):
The system cannot find the file s pecified. (code: 2)
So far I haven't come across the same error posted anywhere; any help would be hugely appreciated. My next move would be to install Drupal directly from Git but I understand this is not recommended for maintainability.
Try this following command :
composer create-project drupal-composer/drupal-project:8.x-dev ./ --stability dev -vv
This can display an error token message , github have protection from web crawling, so you need to create a token on github like was indicated in message
i'm trying to get composer to work on our server but i keep getting issues trying to install/update repositories.
I have configured the environment variables correctly to achieve all this:
http_proxy=http://fastweb.int.bell.ca:8083/
ftp_proxy=ftp://fastweb.int.bell.ca:8083/
HTTP_PROXY_REQUEST_FULLURI=false
I have also forced my composer to use HTTPS protocol only using the configuration directive:
"config": {
"github-protocols": ["https"]
}
We tried to update the ca_bundle following the post SSL certificate rejected trying to access GitHub over HTTPS behind firewall by setting the GIT_SSL_NO_VERIFY or updating the ca-bundle.crt in /etc/pki/tls/certs...
Nothing seems to work!
Here's the output, it does it for all packages, i tried with and without --prefer-source just to see if it would help, still nothing...
./composer.phar update Loading composer repositories with package
information Updating dependencies (including require-dev)
- Updating crazycodr/data-transform (dev-master 11f8499 => 2.0.2)
Checking out 11f8499d0027468705fca72ab67acfbf8ee2e6be
[RuntimeException] Failed to clone
https://github.com/crazycodr/data-transform.git via git, https and
http protocols, aborting.
- https://github.com/crazycodr/data-transform.git
fatal: https://github.com/crazycodr/data-transform.git/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?
I confirm being able to clone/pull/push a GitHub repo behind a firewall.
And you do need https_proxy in addition of http_proxy:
set http_proxy=http://<login_internet>:<password_internet>#aproxy:aport
set https_proxy=http://<login_internet>:<password_internet>#aproxy:aport
set no_proxy=.company
(the no_proxy part is there to avoid using the proxy for internal url, internal to the company)
I have been trying to get laravel installed with no success.
I have been following what seems to be the usual recipe
git clone -b develop git://github.com/laravel/laravel.git myapp
cd myapp
curl -sS https://getcomposer.org/installer | php
php composer.phar install
When I run it I always get the following. I tried killing the cache dir updating etc.
Running PHP Version 5.4.6 open-ssl , mcrypt enabled in the cli.
Just don't know what I'm missing. Been giving it a shot for over a week. Saw some talk about network issues. When I manually download the json in the browser, I notice it redirects to a secure https url. Any pointers would be great. I've have never had a problem like this where I have not been able to dig up the answer.
# php composer.phar install
Loading composer repositories with package information
Installing dependencies
[Composer\Downloader\TransportException]
The "http://packagist.org/p/laravel/framework$de13d7a9bde179aa3dbe63308a250
911fa2330b3e0ba7510dea52827ec3c2f14.json" file could not be downloaded: fai
led to open stream: HTTP request failed!
I noticed with wget or a browser, I would get an https redirect. It seems that however composer does it is different enough from these other 2 that it creates a firewall problem. The link above solved it by adding a section to my composer.json file. Now it doesn't need to redirect as it is starting at https. I am running behind a sonicwall. I am not sure why it would work with a browser and wget, but not composer. It solved it however.
You're cloning the Developer branch from github. This version can be broken in the moment. So you could wait and try it later again (maybe it'll get fixed meanwhile) or you download this develop.zip which is the official way described in the L4 documentation.