Git / Bower Errors: Exit Code # 128 & Failed connect

GitBower

Git Problem Overview


I am using Bower to install several libraries. For demonstration purposes here, I am installing bootstrap. Regardless of the package, I receive the following errors:

C:\Scott>bower install bootstrap
bower not-cached    git://github.com/twbs/bootstrap.git#*
bower resolve       git://github.com/twbs/bootstrap.git#*
bower ECMDERR       Failed to execute "git ls-remote --tags --heads git://github
.com/twbs/bootstrap.git", exit code of #128

Additional error details:
fatal: unable to access 'https://github.com/twbs/bootstrap.git/': Failed connect
to github.com:443; No error    

I have tried using the following solution to remove the first error - which I found from this search:

git config --global url."https://".insteadOf git://

However, this does not work nor do any of the other solutions found on that page. Searching for a solution for the 2nd error, it seems that setting a username/pwd for a proxy server will resolve the issue if you are on a corporate network/behind a firewall. However, I am not using a proxy server as I am on my home pc/network (windows 7 x64).

Thanks!

EDIT: Command window with errors:

enter image description here

Git Solutions


Solution 1 - Git

I know this is not "fixing" the problem, but you can use

git config --global url."https://".insteadOf git://

to tell git to use HTTPS instead of GIT which worked out for me to install npm dependencies.

Solution 2 - Git

Instead to run this command:

 git ls-remote --tags --heads git://github.com/twbs/bootstrap.git

you should run this command:

 git ls-remote --tags --heads git@github.com:twbs/bootstrap.git

or

 git ls-remote --tags --heads https://github.com/twbs/bootstrap.git

or you can run git ls-remote --tags --heads git://github.com/twbs/bootstrap.git but you need to make git always use https in this way:

 git config --global url."https://".insteadOf git://

Reference: https://github.com/bower/bower/issues/50

Solution 3 - Git

I came across this with my corporate network.

It seemed strange because I've always been using ssh to connect with git and never had an issue.

I tried https and didn't work so I added proxy settings to git's config and all was well

git config --global http.proxy http://proxyuser:[email protected]:8080
git config --global https.proxy https://proxyuser:[email protected]:8080

And making sure it worked

git config --list

Solution 4 - Git

Port 22 was being blocked on my computer. Once I found what was blocking it and opened the port, I was able to run the bower install cmd without any issues.

Solution 5 - Git

It appears as though azsl1326 failed to use bower (git) over port 9418 (git://), then told git to use port 22 (https://) instead. This was still failing, but then opening port 22 got the desired result.

The most direct solution is to open port 9418. This is the port that the git:// protocol uses.

Solution 6 - Git

Navigate to your Application Folder and run this command

> git config --global url."https://".insteadOf "git://

"

This should fix your issue

Solution 7 - Git

Perhaps you need to generate an ssh key so you are authenticated with github.

Solution 8 - Git

Are you behind a firewall?

Git doesn't pick up the proxy configuration when it's called, so set environment variables explicitly, e.g.:

export HTTP_PROXY=http://username:password@proxyserver:port/
export HTTPS_PROXY=http://username:password@proxyserver:port/

If your corporate proxy doesn't need authentication just omit the username:password@ bit in the URLs.

It worked for me!

Solution 9 - Git

If your country block github, e.g. China mainland, then you can build a proxy, e.g. use goagent & gae, then set proxy address for git, e.g.

git config --global http.proxy 127.0.0.1:8087

Solution 10 - Git

This error is related to a bad configuration of your firewall. You will notice that bower trying to contact git via the git:// protocol and not http://. You have to open port 9418. Add this two lines in your iptables configuration :

iptables -t filter -A INPUT -p tcp --dport 9418 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp --dport 9418 -j ACCEPT

This should do the trick.

Solution 11 - Git

Firstly, you should check if Visual Studio Command prompt recognizes git command: Tools > Command Line

C:\....\> git

if this command is not recognized, you should add git folder into Environment Variables

https://stackoverflow.com/a/26620861/3449657

This is what I was missing and did the trick for me.

Hope it helps.

Solution 12 - Git

Am adding my answer here as this is one of the closest questions that matched my situation. Was trying to install select2 rather than bootstrap, but the outcome was the same.

bower install select2 reported that git was unable to locate the directory. Used the

> git config --global url."https://".insteadOf git://

config fix, but that resulted in a (paraphrased) error

> I can't use https

My issue was resolved unsatisfactorily, as it involves magic.

I was attempting to run this in a command shell (cmd.exe, windows). I ran the same command and ran it in powershell and it worked. ಠ_ಠ

tl;dr: combination of https:// and powershell worked for me

Solution 13 - Git

I got this error after my virus checker had quarantined a download from github.com. For some unknown reason.

After I cleared those files (exe files) everything worked.

Solution 14 - Git

git config --global url. "https://".insteadOf "git://"  

was not working for me. So I found this alternative:

Go to your temp folder. ( i.e. if you are using windows then C:\Users\{username}\AppData\Roaming\bower\cache\packages ). There you can see several files. Open each of them and you can see the URL. Change it from git://... to https://... and save all files.

Now run the bower install.

Solution 15 - Git

Check your git config settings (git config --global --edit). In my case there were a couple of no longer valid entries like:

> [core]
> gitproxy=gitproxy.cmd
> ["https://"]
> ["https://"]
> [url "https://"]

Revise them and remove if you don't need them anymore.

Solution 16 - Git

Your keys are wrong. Just add them to GitHub/Bitbucket/whatever you are using. It's nothing more than a permission issue with your keys.

Solution 17 - Git

> However, I am not using a proxy server as I am on my home pc/network

Had the same problem (getting exit code 128) on my home network and was quite sure i was not using a proxy. Turns out, Git had saved a proxy i had entered some time in the past - after looking around in the configs, i found it under the [http] tag.

I'm new to Git, and i'm not at all sure, if those configs are usually easily accessible - am using Tortoise Git, since i'm not doing anything fancy really and that has a GUI for the things.

Hope the "answer" helps nonetheless.

Solution 18 - Git

In my case was the folder access where i was during the command execution! On windows I created the folder first by command line: mkdir "MyFolder" and I had the error. but if I create the folder with the mouse, right click, create folder etc. Works fine!

Solution 19 - Git

If you are authenticating with bitbucket, where I'm getting error 128 & Failed connect. but when using authenticating git hub its working fine.

Solution 20 - Git

I know this is an old question, anyway let me add one more thing.

Sometimes(If you are in an office or private network) your gateway server firewall block the https requests(port 443) from the command terminal

git config --global url."http://".insteadOf "https://"

Use this to config the git to use http over https for those situvations

Solution 21 - Git

This worked for me,

Copy the file "libcurl.dll" in Git installation folder ( C:\Program Files\Git\bin\libcurl.dll ). Paste it in location where the git.exe exists ( C:\Program Files\Git\libexec\git-core ).

Solution 22 - Git

Run these 2 commands to grant git access via your system

eval `ssh-agent`
ssh-add ~/.ssh/id_rsa

These commands are assuming that you have ssh key over the remote git server(bitbucket/github/other)

Solution 23 - Git

I ran into this error too, and resolved by updating git. When I ran the failed git ls-remote command, the underlying error was that an old tls version was being used. So updated version of git uses later version of tls.

https://git-scm.com/download/win

Solution 24 - Git

i found this error on my linux os. and i solve this problem

  1. open curl log export GIT_CURL_VERBOSE=1 2.clone git repo
  2. find the log
  3. i fix the problem by update nss and curl (yum update nss nss-util nspr curl)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionazsl1326View Question on Stackoverflow
Solution 1 - GitablaisView Answer on Stackoverflow
Solution 2 - GitantonjsView Answer on Stackoverflow
Solution 3 - GitFrank FuView Answer on Stackoverflow
Solution 4 - Gitazsl1326View Answer on Stackoverflow
Solution 5 - GitHenryView Answer on Stackoverflow
Solution 6 - GitIgnatius AndrewView Answer on Stackoverflow
Solution 7 - GitKitView Answer on Stackoverflow
Solution 8 - GitSteve NealView Answer on Stackoverflow
Solution 9 - GitDahar YoussefView Answer on Stackoverflow
Solution 10 - GitTwystOView Answer on Stackoverflow
Solution 11 - GitrentireView Answer on Stackoverflow
Solution 12 - Gituser1228View Answer on Stackoverflow
Solution 13 - GitGervaseView Answer on Stackoverflow
Solution 14 - Gitavadhesh pareekView Answer on Stackoverflow
Solution 15 - Gituser3805793View Answer on Stackoverflow
Solution 16 - GitkaiserView Answer on Stackoverflow
Solution 17 - GitflailgullView Answer on Stackoverflow
Solution 18 - GitMatteo TosatoView Answer on Stackoverflow
Solution 19 - GitNarayanaView Answer on Stackoverflow
Solution 20 - GitStenal P JollyView Answer on Stackoverflow
Solution 21 - GitShashank GuptaView Answer on Stackoverflow
Solution 22 - GitVikas VermaView Answer on Stackoverflow
Solution 23 - GitJohnnyFunView Answer on Stackoverflow
Solution 24 - GitalkingView Answer on Stackoverflow