Skip to content

Loading…

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

Closed
stefanmerk opened this Issue · 16 comments
@stefanmerk

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
Composer member

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

@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

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

@Seldaek
Composer member

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

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.

@stefanmerk stefanmerk closed this
@roczhang

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

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
Composer member

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

@timhtheos

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

@Seldaek
Composer member

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

@Trishkova

@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

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.

@loi-chuanoi

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

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

@tedstrauss

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

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

@raswaminathanptc

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.