简体   繁体   English

如何修复 git 错误:RPC 失败; curl 56 GnuTLS

[英]How to fix git error: RPC failed; curl 56 GnuTLS

I use Ubuntu 16.04.我使用 Ubuntu 16.04。 When I want to git push origin master I get:当我想要 git 推送 origin master 时,我得到:

error: RPC failed; curl 56 GnuTLS recv error (-12): A TLS fatal alert has been received.
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

The accepted answer from @harlequin might work, but I spend 2 hours and could not build git package from source code. @harlequin 接受的答案可能有效,但我花了 2 个小时无法从源代码构建 git 包。

However, Check the below link as this works for me.但是,请检查以下链接,因为这对我有用。

The remote end hung up unexpectedly while git cloning git cloning 远程端意外挂断

just update the http post buffer value只需更新http post缓冲区值

git config --global http.postBuffer 1048576000

看完你的帖子后,我简单地解决了它

apt install gnutls-bin

To solve this issue:要解决此问题:

Rebuilding git with openssl instead of gnutls fixed my problem.使用openssl而不是gnutls重建 git 解决了我的问题。

I followed these instructions我遵循了 这些说明

I have a workaround if you need to clone or pull and the problem lies in the size of the repository history.如果您需要克隆或拉取并且问题在于存储库历史记录的大小,我有一个解决方法 It may also help when you want to push later, with no guarantee.当您想稍后推送时,它也可能有所帮助,但不能保证。

Simply retrieve the last commits with --depth=[number of last commits] .只需使用--depth=[number of last commits]检索最后--depth=[number of last commits]

You can do this at clone time, or, if working from a local repository to which you added a remote, at pull time.您可以在克隆时执行此操作,或者,如果从添加了远程的本地存储库工作,则在拉取时执行此操作。 For instance, to only retrieve the last commit (of each branch):例如,仅检索(每个分支的)最后一次提交:

git clone repo --depth=1
# or
git pull --depth=1

UPDATE: if the remote is getting too much ahead of you, the issue may come back later as you try to pull the last changes, but there are too many and the connection closes with curl 56. You may have to git pull --depth=[number of commits ahead on remote] , which is tedious if you're working on a very active repository.更新:如果遥控器超出您的范围,那么当您尝试拉取最后一次更改时,问题可能会在稍后再次出现,但数量太多并且连接会以 curl 56 关闭。您可能需要git pull --depth=[number of commits ahead on remote] ,如果您正在处理一个非常活跃的存储库,这会很乏味。

You can set some option to resolve the issue您可以设置一些选项来解决问题

Either at global level: (needed if you clone , don't forget to reset after)无论是在全球层面:(如果你clone需要,不要忘记重置后)

$ git config --global http.sslVerify false
$ git config --global http.postBuffer 1048576000

or on a local repository或在本地存储库上

$ git config http.sslVerify false
$ git config http.postBuffer 1048576000

我也遇到了同样的情况,重启系统就解决了:)

I am also using Ubuntu based system ( Mint mate 18 ), got the similar issue when clone large repo from github.我也在使用基于Ubuntu的系统( Mint mate 18 ),从 github 克隆大型 repo 时遇到了类似的问题。

The simple solution worked for me is to use ssh protocol instead of http(s) protocol.对我有用的简单解决方案是使用ssh协议而不是http(s)协议。

eg例如

git clone git@github.com:xxx/yyy.git

WSL2 users getting this with Ubuntu 18, read this . WSL2 用户在 Ubuntu 18 上获得了这个,阅读这个 Basically you need to update your wireless driver.基本上你需要更新你的无线驱动程序。

I saw similar issues (particularly with depth) on some legacy projects when we were cloning that used to live on TFS.当我们克隆曾经存在于 TFS 上的项目时,我在一些遗留项目中看到了类似的问题(尤其是深度问题)。 Enabling long paths resolved our issue and may be something else worth trying.启用长路径解决了我们的问题,可能是其他值得尝试的事情。

git config --system core.longpaths true

Try to upgrading openssl modules尝试升级openssl模块

I solved it by doing that我这样做解决了

sudo apt install openssl

I faced this issue on Ubuntu 18.04 when cloning CppCheck using https .我在 Ubuntu 18.04 上使用https克隆CppCheck时遇到了这个问题。

A workaround to it was to use http instead.一种解决方法是改用http

All I did was disconnect and reconnect my pc from the wifi and it worked.我所做的只是断开并重新连接我的电脑与 wifi,它工作正常。 Sometimes the answer might be very simple.有时答案可能非常简单。 Mine works now我的现在工作

检查您的网络是否正常工作...由于互联网问题也会出现此问题

I just managed to solve this by cloning using SSH.我只是设法通过使用 SSH 进行克隆来解决这个问题。

To do that I had to add my machine's SSH key to my account.为此,我必须将我机器的 SSH 密钥添加到我的帐户中。

Additionally,this error may occurs in you are using any proxy in command line.此外,此错误可能发生在您在命令行中使用任何代理时。

if you export any proxy before , unset it .如果您之前导出任何代理,请取消设置。

$ unset all_proxy && unset ALL_PROXY

我通过断开 VPN 连接解决了这个问题(我的操作系统是 ubuntu-16.04)。

For Linux: Simple you can run below commands:对于 Linux:简单,您可以运行以下命令:

1) git config -l
2) git config --global http.postBuffer 524288000
        Or set double value  1048576000
3) git config --global https.postBuffer 
4) git config --global core.compression -1 
5) service apache2 restart

Then again check the config of git然后再次检查git的配置

git config -l git 配置 -l

now you can run clone command现在您可以运行克隆命令

git clone yourrepo git 克隆你的仓库

I hope this will be solved the issue.我希望这将解决这个问题。

I solved it by just running single command我通过运行单个命令解决了它

apt upgrade (being root user) apt升级(成为root用户)

Another way here:please try it again, sometimes it happen just result from your network status.这里的另一种方法:请再试一次,有时它的发生只是由于您的网络状态。

My situation is as below.我的情况如下。

在此处输入图片说明

Try to disable your IPV6 for that and disable after.尝试为此禁用您的 IPV6,然后禁用。 I think this is your problem.我想这是你的问题。

I tried all the above without success.我尝试了以上所有方法都没有成功。 Eventually I realised I had a weak WiFi connection and therefore slow download speed.最终我意识到我的 WiFi 连接很弱,因此下载速度很慢。 I connected my device VIA Ethernet and that solved my problem straight away.我通过以太网连接了我的设备,这立即解决了我的问题。

I got this error while i tried to push a new branch upstream我在尝试向上游推送新分支时遇到此错误

git push --set-upstream origin xyz

I tried almost all of the git config edits suggested above including a system reboot.我尝试了上面建议的几乎所有 git config 编辑,包括系统重启。 Nothing worked.没有任何效果。

So I went back to master and did a pull, went back to my xyz branch, did a merge with master and was able to push.所以我回到 master 并做了一个 pull,回到我的 xyz 分支,与 master 合并并且能够推送。

* currently on branch xyz
git checkout master
git pull
git checkout xyz
git merge master
git push --set-upstream origin xyz

I have to say nothing in master conflicted with any of my changes in my new branch "xyx".我不得不说 master 中的任何内容与我在新分支“xyx”中的任何更改都没有冲突。 Only a couple of new commits from master were merged to my "xyz" branch.只有来自 master 的几个新提交合并到我的“xyz”分支。 This shouldn't have been a problem on normal days.这在平时应该不是问题。

我遇到了同样的问题,并通过使用 SSH 协议解决了它。

git clone git@github.com:micro/micro.git

Had the same problem hosting Go Git Server behind nginx and cloning:在 nginx 和克隆之后托管 Go Git Server 时遇到了同样的问题:

remote: Enumerating objects: 103, done. remote: Counting objects: 100% (103/103), done. remote: Compressing objects: 100% (47/47), done. remote: Total 103 (delta 52), reused 99 (delta 51), pack-reused 0 Receiving objects: 100% (103/103), 11.56 KiB | 1.16 MiB/s, done. Resolving deltas: 100% (52/52), done. error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.

After searching RPC based issues, there appears to he a requirement to use HTTP2在搜索基于 RPC 的问题后,他似乎需要使用 HTTP2

Therefore this line in my nginx site configuration:因此,我的 nginx 站点配置中的这一行:

listen 443 ssl; # managed by Certbot

Was changed to this, to enable http2 - which is not a default:已更改为此,以启用 http2 - 这不是默认值:

listen 443 ssl http2; # managed by Certbot

And TLS in general seems happier (ie I had other errors regarding curl and TLS, when inspecting verbose output)并且 TLS 通常看起来更快乐(即,在检查详细输出时,我还有其他关于 curl 和 TLS 的错误)

I have verified this as a root cause by removing http2, which reproduces the error and reinstating http2 resolves the problem.我已经通过删除 http2 验证了这是根本原因,这会重现错误并恢复 http2 解决问题。

I had a similar fault:我有一个类似的错误:

error: RPC failed;错误:RPC 失败; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received. curl 56 GnuTLS recv 错误 (-9):收到了长度意外的 TLS 数据包。

when trying to clone a repository from Github.尝试从 Github 克隆存储库时。

After trying most of the solutions posted here, none of which worked, it turned out to be the parental controls on our home network.在尝试了这里发布的大多数解决方案后,没有一个有效,结果是我们家庭网络上的家长控制。 Turning these parental controls off solved the problem.关闭这些家长控制解决了这个问题。

If you are are running the git server service, then rather than it be a git client issue ... perhaps it's a git server issue too !如果您正在运行 git 服务器服务,那么它不是 git 客户端问题……也许它也是 git 服务器问题! This is what the solution was for me...这就是我的解决方案......

We were running a gitbucket server with a front-end nginx reverse proxy for https.我们正在运行带有 https 前端 nginx 反向代理的 gitbucket 服务器。

Following a major system OS version upgrade, we started getting this error across all git clients.在主要系统操作系统版本升级之后,我们开始在所有 git 客户端上收到此错误。 Turns out that nginx got replaced and the new package's default nginx.conf got installed.结果是 nginx 被替换了,新包的默认 nginx.conf 被安装了。 The default nginx user 'www-data' was NOT what it used to be.默认的 nginx 用户 'www-data' 不是以前的样子。

Somewhere underneath it all, there must have been a permissions issue, because resetting the nginx user back to it's former value, and restarting nginx got everything going again.在这一切的背后,一定存在权限问题,因为将 nginx 用户重置回其以前的值,然后重新启动 nginx 使一切重新开始。 .... go figure ! .... 去搞清楚 ! (Yes I had restarted nginx many times prior to the one singular change that solved it) (是的,在解决它的一个单一更改之前,我已经多次重新启动 nginx)

I am facing the same issue since yesterday, but now successfully solved that issue.从昨天开始我就面临同样的问题,但现在成功解决了这个问题。

First, remove the git package and any other dependent package首先,删除 git 包和任何其他依赖包

$ sudo apt-get remove git

and then install git然后安装 git

sudo apt-get install git-all

In my case the problem was that i was using the https instead of the git protocol.在我的例子中,问题是我使用的是 https 而不是 git 协议。 In my config file I forced git to use https.在我的配置文件中,我强制 git 使用 https。

[url "https://"]
        insteadOf = git://

By removing this from my config I was able to clone the required repository.通过从我的配置中删除它,我能够克隆所需的存储库。

If all answers above are not working for you, you should check if you've enabled any kind of proxy before:如果以上所有答案都不适合您,您应该检查之前是否启用了任何类型的代理

git config --global http.proxy ""

My mac was connected to a 2.5GHZ network, I had to enable my wifi to 5GHz.我的 mac 连接到 2.5GHZ 网络,我必须将 wifi 启用到 5GHz。 And the problem disappeared.而问题就消失了。

This solved my problem这解决了我的问题

$ git config http.sslVerify false
$ git config http.postBuffer 1048576000

Turns out I was behind a firewall that didn't allow access to Github, I solved this by contacting my ISP and disabling virus protection.原来我在不允许访问 Github 的防火墙后面,我通过联系我的 ISP 并禁用病毒防护来解决这个问题。

Simply executing command简单的执行命令

git init

before cloning resolved it for me.在克隆之前为我解决了它。

Reinstalling git will solve the problem.重新安装git即可解决问题。

sudo apt-get remove git
sudo apt-get update
sudo apt-get install git

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 git错误:RPC失败; curl 56 GnuTLS recv 错误(-54):拉函数中的错误 - git error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function git 克隆错误:RPC 失败; curl 52 GnuTLS 接收错误 (-110) - git clone error: RPC failed; curl 52 GnuTLS recv error (-110) Git - 错误:RPC 失败; curl 56 请求的 URL 返回错误:401:远程端意外挂断 - Git - error: RPC failed; curl 56 The requested URL returned error: 401: The remote end hung up unexpectedly Git 推送失败。 错误:RPC 失败; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60 - Git push getting failed. error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60 git 克隆错误:RPC 失败; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 - git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 Git clone错误:RPC失败; result = 56,HTTP代码= 200 - Git clone Error: RPC failed; result=56, HTTP code = 200 Git 推送错误:RPC 失败:curl 52 - Git push error: RPC failed: curl 52 GitLab 克隆错误 RPC 失败; curl 56 请求的 URL 返回错误:401 - GitLab clone error RPC failed; curl 56 The requested URL returned error: 401 无法设置 Pod(错误:RPC 失败;curl 56 SSLRead() 返回错误 -9806) - Unable to setup pods (error: RPC failed; curl 56 SSLRead() return error -9806) 错误:RPC 失败; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 - error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM