Fetching homebrew repos is slow

I had a lot of trouble performing brew update (hanging for 20m and never completing), and tried numerous solutions I found throughout the git repo and wider WWW, to no avail. Where I was hanging:

Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
...
wait a long time
...
FAIL

I noticed when running with --verbose --debug that it was trying to use a git binary from this location:
/Applications/Xcode.app/Contents/Developer/usr/bin/git

When I manually changed to the git repo directory and used /usr/bin/git pull the repo updated instantly, and the issue was solved… Just not sure if anyone else has seen this, and I was sort of wondering why homebrew was using that odd git from within Xcode.app?

2 Likes

I have a similar problem, but for now just impossible to pull or even clone this repository (inside or outside /usr/local/Homebrew/Library/Taps/homebrew).

In case it helps you, the exact steps I took (from my history) were:

brew update-reset
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
/usr/bin/git fetch --all
/usr/bin/git
brew update
1 Like

weirdly, i tried again and worked this time, 5 minutes later tried again and stuck again.
I tried on different internet connection and problem is similar. I suppose there is a problem on github side.

:+1: Having similar symptoms on homebrew cask, in multiple attempts. I’ve untapped the repo altogether for now, so can’t conduct further tests.

I contacted GitHub support on https://twitter.com/Blaisorblade/status/1155835681383559168.

I had confirmed that the remote was setup correctly.

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask$ time git pull
Already up to date.

real	2m21.777s
user	0m0.205s
sys	0m0.169s

Also found https://github.com/Homebrew/homebrew-cask/issues/66893.

I also managed to update (slowly), and checked the repo was intact on my side (it was), tried git fsck, git gc etc.

Here’s my latest fetch today (also pretty slow):

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask$ git fetch -v
POST git-upload-pack (1024 bytes)
remote: Enumerating objects: 534, done.
remote: Counting objects: 100% (534/534), done.
remote: Compressing objects: 100% (174/174), done.
remote: Total 445 (delta 324), reused 390 (delta 271), pack-reused 0
Receiving objects: 100% (445/445), 57.62 KiB | 627.00 KiB/s, done.
Resolving deltas: 100% (324/324), completed with 88 local objects.
From https://github.com/Homebrew/homebrew-cask
   a3c2e5828..9090d78d7  master     -> origin/master
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask$ git remote -v
origin	https://github.com/Homebrew/homebrew-cask (fetch)
origin	https://github.com/Homebrew/homebrew-cask (push)
1 Like

BTW, can @willcl-ark or some mod rename this thread to, say, “Fetching from homebrew-cask is too slow” or such? That’s what we’re sure about, and other users and GitHub support might get confused otherwise… The problem seems intermittent, so when it worked it likely wasn’t because of a different git.
(Also, having multiple git installs is pretty common, unfortunately, and it usually just uses a bit more space but works).

I’m also finding that brew update takes a long time. Even getting “hung up” response on my continuous integration service which has a dependency to update brew. Is this an intermittent outage/error on Github’s part?

Noticed this today as well setting up a new machine - updating homebrew/cask often times out and when it does complete it is super slow - untapping cask for now as well

Our pytorch OS X CI builds are also affected by this.

Same here guys. Currently cannot run brew update or install new cask software as it hangs and then fails.

1 Like

Also having this problem. Manually trying to run the git pull in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle/ also just hangs forever

1 Like

Same problem here.
Also tried to fetch git fetch -v /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
failed after 5-10 minutes.

git fetch -v
POST git-upload-pack (gzip 1040 to 611 bytes)
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly

It’s not outright failing for me, but brew updates are taking minutes to complete. 3m27s for the time git pull in homebrew-cask. Sounds like the issue is being looked at, at least.

Yep. Just posting to confirm, as well. It was erratic regardless of the location/region for the server that I was pulling from and sometimes would fail after a few minutes with an error. Other requests, would process in seconds. I noticed this problem beginning about 1-2 days ago.

Did someone report this to github yet?

Seems resolved for me now. Updates were 10+ minutes earlier today. Now < 1 second if nothing to do.

We’re still having issues with this and it’s blocking our CI builds. Is there an open ticket/issue anywhere that we can follow to get updates?

I wrote GitHub on Twitter but got no reply https://twitter.com/Blaisorblade/status/1155835681383559168. The problem seems fixed here right now (EDIT: NOPE!), but if not you might need a new report.

Not for me. It’s been 3 days and counting.
Nothing seems to help. I’ve tried manual updates and all that but nada…

Switching the remote to SSH or manually cloning over SSH to default the origin remote seems to resolve this.

Login to GitHub, make sure your SSH key is added to your profile. Get the SSH git URI

Something like

cd $(brew --repository)/Library/Taps/homebrew; git clone git@github.com:Homebrew/homebrew-cask.git

Once the remote is setup for SSH there does not seem to be an issue and things are quite fast.