Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 #41

Open
lanlin opened this issue May 28, 2018 · 15 comments

Comments

@lanlin
Copy link
Owner

lanlin commented May 28, 2018

报错情形

Total 116323 (delta 81906), reused 116320 (delta 81905)
POST git-receive-pack (130907163 bytes)
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

git 在 pull 或者 push 一个大项目时,可能会碰到出现如题所示的错误。
又或许是因为修改了太多的历史提交,一次性需要提交大量信息也可能会导致该情况。

追加补充,请先看这个 (2020/08/11)

为了节约后续搜到这个话题的同学的时间,将大家普遍认为最有效的两种方法追加到这里。

1. 你的 git 版本老掉牙了,请更新到最新版本后再试

@minteliuwm
新买的mac使用初始环境 “ git clone ...” 的时候遇到了同标题一样的问题,我认为是git某些文件可能有问题,比如初始安装不完整什么的,于是用 “ brew install git ” 重新安装(更新)了一下git,问题已解决。

2. 如果你的代码托管在 github 而不是在国内,那么你需要科学上网工具。

如果你的科学工具不太稳定,请尝试 ssh 的方式作为加强,详见 #51

3. 如果确定不是以上的原因...

a
皮一下,作为分隔线

解决办法(分两种)

  1. 网络上往往都会说这是由于大文件造成的提交或者拉取失败。
    但是,经过本人测试。如果 errno 56,那么应该是有大文件或者提交缓存方面的问题。
    errno 54 则不是这个问题。对于 56 错误的解决方式与网络上大部分文章的一致。
    都是增大缓存配置,比如下面就是配置提交缓存为 500M。
git config http.postBuffer 524288000
git config https.postBuffer 524288000
  1. 对于 errno 54 这个错误,经尝试 http 或者 https 协议都无法正常提交。
    必须改为 ssh 方式来提交代码。也就是必须使用公私钥的方式进行账号验证,并提交代码。
    具体生成公私钥的方法,参见 github 帮助文档
    https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
    同时找到 git config 当中的项目 url 配置项,改为 ssh 协议类型的项目地址。
    例如:url = git@github.com:xxx/xxx.git

  2. 请参照以下手段进行尝试(PS:尤其是更新 git 版本
    git error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 #41 (comment)

最后

具体造成 errno 54 的原因是什么,本人也不甚了解,欢迎评论补充。

@shaojiankui
Copy link

无奈。。。

@JiaxiangBU
Copy link

git config http.postBuffer 524288000原来是不行的。

@minteliuwm
Copy link

git clone的时候后遇到这个问题,errno 54,用https和ssh都失败了,有办法解决吗?求教~

@lanlin
Copy link
Owner Author

lanlin commented Jan 15, 2019

@minteliuwm 我只能给你一些建议,你自己去尝试一下。不保证有效。

  1. 检测你的 git 版本是不是最新的。

  2. 你本身是否有这个项目的访问权限。

  3. 如果你开启了账户的双重验证、或者你准备 clone 的项目是一个开启了单点登录(SSO)的企业项目,那你必须要生成一个个人的 access token,而不能直接用密码访问。

  4. 如果你使用 ssh 来访问,你必须先生成 ssh key 公私钥匙对。

  5. 如你的目标项目的企业要求单点登录的,这个时候只能用 https 来访问,不能用 ssh.

  6. 根据我第一种解决办法,设置好缓存,并配置好 ssh 再试。

  7. 改用 subversion 来访问。

  8. 将项目的大文件改用 https://git-lfs.github.com/ 来追踪管理

  9. 以下是一大堆参考文章。。。
    https://help.github.com/articles/https-cloning-errors/
    https://help.github.com/articles/which-remote-url-should-i-use/
    https://help.github.com/articles/what-are-the-differences-between-subversion-and-git/
    https://help.github.com/articles/about-authentication-with-saml-single-sign-on/

  10. 找到原因和答案,欢迎补充。。。

@TianyiKing
Copy link

@minteliuwm
新买的mac使用初始环境 “ git clone ...” 的时候遇到了同标题一样的问题,我认为是git某些文件可能有问题,比如初始安装不完整什么的,于是用 “ brew install git ” 重新安装(更新)了一下git,问题已解决。

@Fessible
Copy link

Fessible commented Apr 15, 2019

@minteliuwm
新买的mac使用初始环境 “ git clone ...” 的时候遇到了同标题一样的问题,我认为是git某些文件可能有问题,比如初始安装不完整什么的,于是用 “ brew install git ” 重新安装(更新)了一下git,问题已解决。

谢谢你,我以为mac中的git没什么影响,原来真的是git版本问题,更新到最新版本解决问题了

@martSforever
Copy link

@minteliuwm
新买的mac使用初始环境 “ git clone ...” 的时候遇到了同标题一样的问题,我认为是git某些文件可能有问题,比如初始安装不完整什么的,于是用 “ brew install git ” 重新安装(更新)了一下git,问题已解决。

溜啊老哥,我这边也是这样,更新了git就没这个问题了

@crifan
Copy link

crifan commented Feb 4, 2020

之前遇到过,后来又遇到过一次,同样的问题:

macgit push提交github.com的仓库,报错:

error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: the remote end hung up unexpectedly

解决方案:

更换有效的代理的节点 -》 此处代理是ss的代理,换了速度更快的日本、新加坡的节点后,即可。

提示:

  • 当天网络不好,可以换第二天等网络好后,再去换ss的节点,就可以了。

额外补充:

  • 不是:文件超出buffer限制
    • http.postBuffer无关
  • 不是:github的SSH的key导致的
  • 不是:mac中git版本的问题

具体过程详见:
【已解决】git上传出错:error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 – 在路上
【已解决】mac中对github去git push再次报错:error RPC failed curl 56 LibreSSL SSL_read SSL_ERROR_SYSCALL errno 54

@hw20101101
Copy link

666

执行 brew install git 就OK了

@jiehu5114
Copy link

mark

@figureai
Copy link

我遇到了这个问题,仓库存在30m大小的单个文件,没翻墙前下载速度10k/s一直出现这个问题,随后翻墙达到700k/s,成功clone

@Heshiyu1996
Copy link

git config http.postBuffer 524288000原来是不行的。

git config https.postBuffer 524288000
学到了get

@changety
Copy link

本质还是brew源的问题,按照下面的办法解决:

// 执行下面这句命令,更换为中科院的镜像:

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

// 把homebrew-core的镜像地址也设为中科院的国内镜像

cd "$(brew --repo)" 

git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" 

git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

测试:

// 更新
brew update

// 使用
brew install node

@lanlin
Copy link
Owner Author

lanlin commented Aug 11, 2020

@changety 这位老哥,麻烦别偏题,别误导别的同学。大家一直都是在说 git 的问题,不是 homebrew

@JustinYi922
Copy link

我用Mac在某个沙箱软件里面拉取700多M的代码也总是提示这个,600kb左右的带宽。太坑了~ 很多网上的方法我都试过了,依然不行。但是windows的电脑说可以。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests