Any git clone of a repo above a certain size fails halfway through, I can use ssh method however for this case http is required as it is a secondary action as part of brew install.
$ brew cask install homebrew/cask-versions/adoptopenjdk8
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 422119, done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask` exited with 128.
Follow the instructions here:
https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Homebrew/Library/Homebrew/utils.rb:266:in `safe_system'
/usr/local/Homebrew/Library/Homebrew/tap.rb:273:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:157:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:123:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:103:in `<main>'
This is on a brand new machine, with a very fast internet connection (verified the git clone works on other machines). Additionally I have increased buffer size
git config --global http.postBuffer 524288000
I have no problem cloning small repos in both http and ssh method. I have reviewed similar stack questions such as the one below but they don't cover this scenario.
error: RPC failed; curl transfer closed with outstanding read data remaining
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 git@github.com:Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
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