8

任何超过一定大小的 repo 的 git 克隆都会在中途失败,我可以使用 ssh 方法,但是对于这种情况,http 是必需的,因为它是 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>'

这是在一台全新的机器上,具有非常快的互联网连接(已验证 git clone 在其他机器上工作)。另外我增加了缓冲区大小

git config --global http.postBuffer 524288000

我在 http 和 ssh 方法中克隆小型存储库都没有问题。我已经查看了类似的堆栈问题,例如下面的问题,但它们没有涵盖这种情况。

错误:RPC 失败;curl 传输关闭,剩余未完成的读取数据

4

7 回答 7

23

事实证明,在我的情况下,它确实是一种我不知道的防病毒软件,Virgin Broadband ISP 使用了一个Virus Safe我不知道未经我同意就被激活的内置软件。对于使用此 isp 的用户,可以通过以下方式停用它https://my.virginmedia.com/my-apps/onlinesecurity/websafe/settings

于 2020-03-27T11:19:16.550 回答
9

如果问题仍然存在,这意味着如果您在尝试自己时看到相同的错误消息:

git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask

然后尝试:

  • SSH克隆:

    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
    
于 2020-03-27T05:38:04.070 回答
8

&tldr;brew update-reset

我只是有同样的问题。首先,我尝试了@VonC 的答案,但没有帮助。我收到消息

➜  ~ git clone git@github.com: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.

谷歌搜索下一条消息给了我这个链接与运行命令的解决方案(在我的情况下)

brew update-reset

那个问题解决后

➜  ~ 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'

尽管我看到获取 homebrew-core 存在一个问题,但所有操作都已成功完成,并且我能够更新软件包

➜  ~ 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) 

由于之前看到的错误,我又使用了一次brew update-reset命令,然后一切顺利,没有错误:

➜  ~
➜  ~ 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'.

➜  ~

我不太确定为什么会这样,但可能与操作系统更新有关(发生在此处的那个点附近)。我收到了将操作系统升级到 10.15.7 一天的通知,即使在更新操作系统之后,初始 brew 错误仍然存​​在。

于 2020-10-01T07:08:24.790 回答
6

这是Virgin ISP设置。我添加https://github.com为允许的网站:https ://my.virginmedia.com/my-apps/onlinesecurity/websafe/settings

Virgin ISP 网络安全设置

请注意,我从之前的尝试中删除了 /usr/local/HomeBrew 目录 ( sudo rm -rf /usr/local/HomeBrew),然后/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"按照标准安装说明运行。

万岁……!

==> Installation successful!

于 2020-10-01T08:44:58.853 回答
2

我手动下载install.sh文件,修改BREW_REPOBREW_REPO="git@github.com:Homebrew/brew",然后运行sh install.sh

于 2020-07-15T09:58:04.650 回答
1

这些答案实际上并不能解决问题,其中一些可能但您的问题会再次出现。

禁用tcp-udp卸载

达尔文/MacOS

sudo sysctl -w net.link.generic.system.hwcksum_tx=0
sudo sysctl -w net.link.generic.system.hwcksum_rx=0

GNU/Linux;

sudo ethtool -K eth0 tx off rx off`

您的计算机正试图“实时”调整您的网卡以适应负载,但失败了。

您可能会遇到的其他相关问题:

海外安装时 NPM 超时

纱线 - 您的网络连接似乎有问题。重试

注意:我使用“实时”作为时间的相对流逝,而不是作为操作系统的 CPU 周期/性能调制的度量

于 2021-10-27T06:41:33.447 回答
0

打开你的 git 文件夹并删除 FETCH_HEAD 文件,然后再次推送 hop

于 2021-03-08T16:47:04.270 回答