Why do I get error: RPC failed; result=52, HTTP code = 0 fatal: The remote end hung up unexpectedly when pushing to github?

无人久伴 提交于 2019-12-03 00:06:00
jjpcondor

Bitbucket has the same error message. Often it is related to degraded server performance. Before you start doing anything else, check:

Dughall

This error also happens if your HTTP post buffer is too small for the changes you want to push.

In this case, the solution is to increase it, for example using

git config http.postBuffer 524288000

Now it is working! I didn't even change a thing.

This kind of an error ' result=52 ' is an error with github itself. Github.com was going down and when I tried uploading I got the error. Now the site is back up and I can commit like normal.

I ran into this problem when trying to clone/fetch from a Bitbucket repository over http. It turns out the repository is too big (+1gb) and Bitbucket replies with this error:

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

I switched to the SSH protocol and now it works fine. Afterwards, you can set the remote back to the http version if you need to, and it will keep working.

This could happen if you have a faulty internet connection too, Yeah I am experiencing one at this time.. :).

This can be also due to the following

Reason

Prescence of large files (45MB in our case)

Why

Large files cause HTTPS Timeout

Solution

Use SSH or Remove large files

I tried this:

$ git config --global --add core.compression -1
$ git clone https://....

and it worked.

(Found here)

It took me hours. I had the same problem using https. Plus: I could not connect to bitbucket via ssh.

I'm using Linux Mint 17.x and this solution worked like a charm for ssh:

https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1254085 (answer from bs – bentzy-sagiv)

This solved the issue:

Append to /etc/sysctl.conf the following: net.ipv4.tcp_mtu_probing = 1

after restart you should see at /proc/sys/net/ipv4/tcp_mtu_probing the value "1"

A temporary solution is: echo 1 > /proc/sys/net/ipv4/tcp_mtu_probing caveat: this will be reset at boot.

You can try also with value "2" if still not working.

(see explanation at:https://thesimplecomputer.info/pages/adventures-in-linux-tcp-tuning-page2)

Nolwennig

For Bitbucket, I resolve this with switch to ssh instead of http.

  1. Configure SECURITY > SSH keys in Avatar > Bitbucket settings :
  2. Change remote url from https://... to git@...
    • Edit .git/config file OR launch git remote set-url origin git@...
  3. git push -u origin --all (NB: git add . follow by git commit -m "intial commit" before)

based on wintersolider's answer

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