composer / composer

Dependency Manager for PHP
https://getcomposer.org/
MIT License
28.53k stars 4.53k forks source link

Failed to clone via git, https protocols, aborting #2176

Closed stefanmerk closed 11 years ago

stefanmerk commented 11 years ago

Hey there,

it's me again with a new issue.

I am trying to update (install) a package with composer. But if I do this I receive the following ERROR message My command: php composer.phar update friendsofsymfony/user-bundle Output:

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Updating friendsofsymfony/user-bundle dev-master (f821491 => 96c5833)
    Checking out 96c58334211aab5f57376f0f4f817a7fda853c4f

  [RuntimeException]
  Failed to clone https://github.com/FriendsOfSymfony/FOSUserBundle.git via git, https protocols, aborting.

  - git://github.com/FriendsOfSymfony/FOSUserBundle.git
    fatal: Unable to look up github.com (port 9418) (No such host is known. )

  - https://github.com/FriendsOfSymfony/FOSUserBundle.git

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]
 [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

And composer diagnose output:

Checking platform settings: OK
Checking http connectivity: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: OK
Checking HTTPS proxy support for request_fulluri: OK
Checking composer.json: OK
Checking disk free space: OK
Checking composer version: OK

And also a run with -vvv


  [RuntimeException]
  Failed to clone https://github.com/FriendsOfSymfony/FOSUserBundle.git via g
  it, https protocols, aborting.

  - git://github.com/FriendsOfSymfony/FOSUserBundle.git
    fatal: Unable to look up github.com (port 9418) (No such host is known. )

  - https://github.com/FriendsOfSymfony/FOSUserBundle.git

Exception trace:
 () at phar://C:/Users/u529228/Applications/xampp/htdocs/Lufthansa/composer.phar
/src/Composer/Downloader/GitDownloader.php:377
 Composer\Downloader\GitDownloader->throwException() at phar://C:/Users/u529228/
Applications/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Downloader/GitDow
nloader.php:314
 Composer\Downloader\GitDownloader->runCommand() at phar://C:/Users/u529228/Appl
ications/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Downloader/GitDownloa
der.php:74
 Composer\Downloader\GitDownloader->doUpdate() at phar://C:/Users/u529228/Applic
ations/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Downloader/VcsDownloade
r.php:91
 Composer\Downloader\VcsDownloader->update() at phar://C:/Users/u529228/Applicat
ions/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Downloader/DownloadManage
r.php:215
 Composer\Downloader\DownloadManager->update() at phar://C:/Users/u529228/Applic
ations/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Installer/LibraryInstal
ler.php:161
 Composer\Installer\LibraryInstaller->updateCode() at phar://C:/Users/u529228/Ap
plications/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Installer/LibraryIn
staller.php:105
 Composer\Installer\LibraryInstaller->update() at phar://C:/Users/u529228/Applic
ations/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Installer/InstallationM
anager.php:171
 Composer\Installer\InstallationManager->update() at phar://C:/Users/u529228/App
lications/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Installer/Installati
onManager.php:138
 Composer\Installer\InstallationManager->execute() at phar://C:/Users/u529228/Ap
plications/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Installer.php:509
 Composer\Installer->doInstall() at phar://C:/Users/u529228/Applications/xampp/h
tdocs/Lufthansa/composer.phar/src/Composer/Installer.php:210
 Composer\Installer->run() at phar://C:/Users/u529228/Applications/xampp/htdocs/
Lufthansa/composer.phar/src/Composer/Command/UpdateCommand.php:103
 Composer\Command\UpdateCommand->execute() at phar://C:/Users/u529228/Applicatio
ns/xampp/htdocs/Lufthansa/composer.phar/vendor/symfony/console/Symfony/Component
/Console/Command/Command.php:244
 Symfony\Component\Console\Command\Command->run() at phar://C:/Users/u529228/App
lications/xampp/htdocs/Lufthansa/composer.phar/vendor/symfony/console/Symfony/Co
mponent/Console/Application.php:897
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/Users/u52922
8/Applications/xampp/htdocs/Lufthansa/composer.phar/vendor/symfony/console/Symfo
ny/Component/Console/Application.php:191
 Symfony\Component\Console\Application->doRun() at phar://C:/Users/u529228/Appli
cations/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Console/Application.ph
p:117
 Composer\Console\Application->doRun() at phar://C:/Users/u529228/Applications/x
ampp/htdocs/Lufthansa/composer.phar/vendor/symfony/console/Symfony/Component/Con
sole/Application.php:121
 Symfony\Component\Console\Application->run() at phar://C:/Users/u529228/Applica
tions/xampp/htdocs/Lufthansa/composer.phar/src/Composer/Console/Application.php:
83
 Composer\Console\Application->run() at phar://C:/Users/u529228/Applications/xam
pp/htdocs/Lufthansa/composer.phar/bin/composer:43
 require() at C:\Users\u529228\Applications\xampp\htdocs\Lufthansa\composer.phar
:15

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]
 [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

The --prefer-source option does not help here.

Also I am able to call all the websites in my browser with the same proxy settings.

Seldaek commented 11 years ago

It says No such host is known. at:

  - git://github.com/FriendsOfSymfony/FOSUserBundle.git
    fatal: Unable to look up github.com (port 9418) (No such host is known. )

Seems like dns/network issues, I doubt we can help much :/

stefanmerk commented 11 years ago

@Seldaek Thanks for your quick reply. But I can visit github.com (on the same machine, with the same proxy settings).

And also: Why is https protocols, aborting ? As I said, I am able to open it in my browser.

Any help is very appreciated.

phansys commented 11 years ago

@stefanmerk, what if you try $ nslookup github.com or $ telnet github.com 9418 from your CLI?

Seldaek commented 11 years ago

aborting is just because all protocols failed so it stops.

In the -vvv output, above the exception you should see the last command it tried to execute, you could try to run that in the shell yourself to see if that works or not.

stefanmerk commented 11 years ago

It is really strange, but i guess it was just a proxy related problem (as you thought in the beginning) Thanks everybody for your help

@phansys I am not able to run these commands, due to proxy restrictions. And I guess I was just using a broken proxy.

Thanks.

roczhang commented 10 years ago

The same problem(fatal: Unable to look up github.com (port 9418) (No such host is known. )) I faced that I can access github.com from browser with proxy in the company domain internet, but I failed to access the github from CLI , even I reset the git proxy or environment variable http_proxy.

BTW, when I set the http_proxy and then try other tools , for example curl and it works. So I think the case is message about git with proxy. Maybe I wrong. But how I can do?

timhtheos commented 10 years ago

I get the same problem. I get Failed to clone .... via git, https protocols, aborting..

  [RuntimeException]
  Failed to clone https://github.com/symfony/Filesystem.git via git, https protocols,
  aborting.

  - git://github.com/symfony/Filesystem.git
    fatal: unable to connect to github.com:
    github.com: Name or service not known

  - https://github.com/symfony/Filesystem.git
    error: Couldn't resolve host 'github.com' while accessing https://github.com/symfo
  ny/Filesystem.git/info/refs
    fatal: HTTP request failed

I was able to successfully run this command somewhere else, at home, but in the office, I just can't. This seems like a DNS issue.

Seldaek commented 10 years ago

@timothyescopete indeed seems like it's on your end (or your ISP or something), not something we can fix.

timhtheos commented 10 years ago

@Seldaek How did you get those errors, if you got them? Mine, I just get them via composer install.

Seldaek commented 10 years ago

@timothyescopete I don't get them that's my point, it's probably something on your end.

Trishkova commented 10 years ago

@stefanmerk , If the problem still remains, you can try to ping github.com from your own machine(any other computer without problems) as

ping github.com
, then received IP you shouldt write to /etc/hosts as
received_ip github.com wiki.github.com gist.github.com assets0.github.com assets1.github.com assets2.github.com assets3.github.com
where received_ip == 192.30.252.129 for example. Sorry for my english

gabrielaleoniec commented 9 years ago

My error in Windows was:

Failed to clone git@github.com:symfony/symfony-standard.git via git, https, ssh protocols, aborting.

When I explicitly ran CMD as administrator (although my user had administrator rights) everything went ok.

nghuyy commented 9 years ago

check your date and time, try reinstall git-scm and try clone witout composer

git clone https://github.com/symfony/Filesystem.git

ted-strauss-K1 commented 9 years ago

I am getting the same issues as above and assume it is caused by proxy/firewall at my work. My question is: does Composer use a specific port (or anything else unusual) when calling git?

stof commented 9 years ago

@tedstrauss no. It just calls git normally and lets it do its work

raswaminathanptc commented 8 years ago

Mostly a firewall issue enable incoming&outgoing traffic for port 9418 on your environment and try.Port 9418 is used by github

Abyssking commented 7 years ago

I had the same problem, but i used the github ip instead of www.github.com, use it, it will help you to get your file with ease.

uti-james commented 6 years ago

I had the same issues. I just ran "composer clear-cache" to clear the cache after which I ran "composer install" on my project directory folder. that solved it

Paulohf007 commented 6 years ago

Tanks uti-james "clear-cache" solved the problem!!

NgatiaFrankline commented 6 years ago

If you are in windows environment, please disable antivirus and try again.

usmanjutt84 commented 6 years ago

Resolved by turn off the firewalls settings on windows 10.

GaneshKandu commented 5 years ago

@uti-james thanks you saved my life i am wasted whole week on it thanks

narayan1992 commented 5 years ago

Manually deleted the composer files, vendor folder and Start install my package again, it got worked.

davydocsurg commented 4 years ago

I want to install laravel/ui but I got this error: Failed to clone https://github.com/laravel/ui.git via https, ssh proto
cols, aborting.

hsmfawaz commented 4 years ago

solved by composer self-update

yogesh1663 commented 7 months ago

goto php.ini file and search ";extension=zip" and change it to "extension=zip"

daniel-for-j commented 6 months ago

Thank you @yogesh1663 , That worked for me.