Git RPC failed; curl 18 transfer closed with outstanding read data remaining
It turns out in my case it was indeed an anti-virus that I wasn't aware of, Virgin Broadband ISP use a built in Virus Safe
that I did not know was activated without my consent. For those with this isp, it can be deactivated via https://my.virginmedia.com/my-apps/onlinesecurity/websafe/settings
If the issue persists, meaning if you see the same error message when trying yourself:
git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
Then try:
either an SSH clone:
git clone [email protected]:Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
or a shallow clone as here
git clone --depth 1 https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask git fetch --unshallow
&tldr; brew update-reset
I just had the same issue. First I tried @VonC 's answer but it didn't help. I got message
➜ ~ git clone [email protected]:Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
fatal: destination path '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask' already exists and is not an empty directory.
Googling next for that message gave me this link with solution (in case of mine) of running command
brew update-reset
After that problem was solved
➜ ~ brew update-reset
==> Fetching /usr/local/Homebrew...
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (34/34), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 4), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), 3.55 KiB | 454.00 KiB/s, done.
From https://github.com/Homebrew/brew
* [new branch] imgbot -> origin/imgbot
==> Resetting /usr/local/Homebrew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
==> Fetching /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart...
==> Resetting /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/elastic/homebrew-tap...
==> Resetting /usr/local/Homebrew/Library/Taps/elastic/homebrew-tap...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/heroku/homebrew-brew...
==> Resetting /usr/local/Homebrew/Library/Taps/heroku/homebrew-brew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': transfer closed with outstanding read data remaining
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/sass/homebrew-sass...
==> Resetting /usr/local/Homebrew/Library/Taps/sass/homebrew-sass...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'
Although I see there were one issue with fetching homebrew-core all operation finished successfully and I was able to update packages
➜ ~ brew update && brew upgrade && brew cleanup
Updated 1 tap (homebrew/core).
==> New Formulae
cloudformation-guard
==> Updated Formulae
aws-okta bitrise cbmc crowdin frpc monero openrct2 ssh-audit traefik
==> Upgrading 1 outdated package:
heroku/brew/heroku 7.43.2 -> 7.44.0
==> Upgrading heroku/brew/heroku 7.43.2 -> 7.44.0
==> Downloading https://cli-assets.heroku.com/heroku-v7.44.0/heroku-v7.44.0.tar.xz
######################################################################## 100.0%
==> Caveats
To use the Heroku CLI's autocomplete --
Via homebrew's shell completion:
1) Follow homebrew's install instructions https://docs.brew.sh/Shell-Completion
NOTE: For zsh, as the instructions mention, be sure compinit is autoloaded
and called, either explicitly or via a framework like oh-my-zsh.
2) Then run
$ heroku autocomplete --refresh-cache
OR
Use our standalone setup:
1) Run and follow the install steps:
$ heroku autocomplete
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Summary
/usr/local/Cellar/heroku/7.44.0: 27,477 files, 59.4MB, built in 40 seconds
Removing: /usr/local/Cellar/heroku/7.43.2... (27,475 files, 59.4MB)
Removing: /Users/tpojka/Library/Caches/Homebrew/heroku--7.43.2.tar.xz... (6.9MB)
Removing: /Users/tpojka/Library/Caches/Homebrew/libyaml--0.2.5.catalina.bottle.tar.gz... (107.4KB)
Removing: /Users/tpojka/Library/Caches/Homebrew/nghttp2--1.41.0.catalina.bottle.tar.gz... (968.6KB)
Removing: /Users/tpojka/Library/Logs/Homebrew/htop... (64B)
Removing: /Users/tpojka/Library/Logs/Homebrew/guile... (64B)
Removing: /Users/tpojka/Library/Logs/Homebrew/gnupg... (64B)
I went one more time with brew update-reset
command because of error previously seen and then everything went good with no errors:
➜ ~
➜ ~ brew update-reset
==> Fetching /usr/local/Homebrew...
==> Resetting /usr/local/Homebrew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart...
==> Resetting /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/elastic/homebrew-tap...
==> Resetting /usr/local/Homebrew/Library/Taps/elastic/homebrew-tap...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/heroku/homebrew-brew...
==> Resetting /usr/local/Homebrew/Library/Taps/heroku/homebrew-brew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/sass/homebrew-sass...
==> Resetting /usr/local/Homebrew/Library/Taps/sass/homebrew-sass...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
➜ ~
I am not quite sure why was this but maybe has something with OS update (happened around that point here). I had notification to upgrade OS to 10.15.7 for a day maybe and initial brew error stood even after updating OS.