The remote end hung up unexpectedly while Git push with large files

旧街凉风 提交于 2021-02-06 11:50:11

问题


When I try to push to my bitbucket repo, I get the following error. (In fact its the same in GitHub as well).

Counting objects: 48, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (38/38), done.
Writing objects: 100% (48/48), 1.95 MiB | 38 KiB/s, done.
Total 48 (delta 9), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
error: RPC failed; result=56, HTTP code = 0
fatal: recursion detected in die handler
Everything up-to-date

Mostly I get another error like

error: RPC failed; result=56, HTTP code = 0
fatal: The remote end hung up unexpectedly

Either way PUSH fails. This is only for large files I guess. For smaller changes it works fine. I've updated http.postBuffer to 2M and it still doesn't work.

Important I've a 3G connection and an CDMA based EVDO Internet connection. With the 3G connection, the PUSH and everything else works FINE. But with the EVDO I get the above errors. So I'm under the impression that its because of some connection problem with my EVDO or ISP.

How can I resolve this?


回答1:


usually, remote end hangups are from unauthorized users. but if you can successfully connect that's not the issue.

if you really think it's a file size issue, this is my best suggestion:

the default size at which the git client starts "chunking" the request is 1MB. you can change this setting using:

git config http.postBuffer 524288000

this example sets the postBuffer to 500MB. play around with this value and see if it helps.




回答2:


I came accross this issue with bitbucket, increasing the postBuffer was likely needed but did not solve the issue.

I was only able to resolve this by using another internet connection.

These are the errors GIT_CURL_VERBOSE=1 returned:

* SSLRead() return error -9820
* Connection died, retrying a fresh connect
* Closing connection 0

and then

* SSLWrite() returned error -36
* Closing connection 1
error: RPC failed; result=55, HTTP code = 0
fatal: The remote end hung up unexpectedly

Hopefully that helps somebody, maybe someone with more knowledge understands those SSL errors?

Update:

The issue I had was on an inital git push into the repo and since then I have tried the same push into the same bitbucket repo with the original internet connection and it works.




回答3:


I ran into the same problem and it was because my push included some large files. Apparently github has a 100MB limit on an individual file size. I removed the large files from my commit and retried git push and it worked. Here's some more information about the size limitations:

https://help.github.com/articles/what-is-my-disk-quota




回答4:


Turns out it was an issue with BSNL's EVDO connection. Unfortunately none of the technicians in BSNL were able to help me. So i discarded the connection.

Back to good old wired broadband :D.




回答5:


When the cause is a huge file and http.postBuffer just won't work for you, try switching from http to ssh (i.e. ssh://git@<your git repository>). This will likely get you past your hurdle.




回答6:


In my case, I didn't have the PRC error, instead it was "client_loop: send disconnect: Connection reset by peer", and then "fatal: the remote end hung up unexpectedly". The solution for me was to use nested VPN. I need a VPN connection to the git repo (because it is behind the clients firewall).

I first connect my computer to a completely different VPN. This VPN connection is of type "IPv6, Layer3, UDP". Then I set up a virtual machine, and connecte it with another VPN to the target network. From this virtual machine I can push successfully.



来源:https://stackoverflow.com/questions/15840002/the-remote-end-hung-up-unexpectedly-while-git-push-with-large-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!