22

git push fails with following error

fatal: RPC failed: curl 52: Empty reply from server

The upload succeeds in case only one file was modified, added or deleted.

The following settings to don't work reliably

 git config --global --add core.compression -1

The git version is 2.8.2 running on ubuntu 14.04, and I have tried with both openssl and gnutls compilations.

ssh remotes also fail.

The problem is encountered with repositories of

bitbucket
github
gitlab

Fail safe answers appreciated

7
  • 1
    Do any commands to the server work? Can you do git push ? Commented May 7, 2016 at 6:22
  • git push works fine only for modification of a single file. Commented May 7, 2016 at 6:25
  • This problem appears to have many causes, including the server going down or using an old version of Git. Commented May 7, 2016 at 6:28
  • <status.bitbucket.org/> says 'via https' is operational, and 2.8.2 is latest available stable git version Commented May 7, 2016 at 6:31
  • Same here and it looks like it's doing it only on certain repos, I have 6 repos on bitbucket it's only doing it on one of them. Everything up to date. Support ticket sent but still not heard back. Commented May 8, 2016 at 23:45

9 Answers 9

17

In terminal use sudo to clone, or type:

git config --global http.postBuffer 157286400

its worked for me

Sign up to request clarification or add additional context in comments.

4 Comments

Worked for me as well on Mac OS X on repo on BitBucket
using sudo to clone did not fix this for me
This worked for me also. Any idea what makes it happen and why this fix works?
16

Following worked for me.

git config --global core.compression 0

git clone --depth 1 <repo> //  partial clone to truncate the amount of info coming down

#cd repo // go into the new directory and 

git fetch --unshallow //retrieve the rest of the clone

git pull --all //final pull

Hope, this could be helpful for someone having the same issue.

3 Comments

YOU SAVED MY REPOS!
git config --global core.compression 0 solved saved my repo.
Looks like it helps when remote hungs up due to something blocking too big requests. Thank you!
7

I had a chat with Gideon @ atlassian he suggested to use SSH over HTTPS to fix the "curl 52" error.

For me switching to SSH fixed the problem. Here's the complete answer:

This is a HTTP/HTTPS timeout issue involving either some large commit size, or a weak network. If you're cloning, can you try to see if you can clone the repository using this method:

https://stackoverflow.com/a/22317479

Can you try to see if running this command before any git operations help as well:

git config --global http.postBuffer 524288000

Also, this issue usually won't occur in SSH; so maybe it is worth trying to set up SSH and then do the operation through SSH:

https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html

1 Comment

Thanks, it works. I found the way to switch to SSH at: help.github.com/articles/changing-a-remote-s-url/…
1

Following worked for me. stop WIFI and use the Network cable to connect the NetWork

Maybe it is a problem about network

1 Comment

I had the same issue. Your statement about the problem with the network was right. But I had vice-versa: I stopped LAN connection and started Wi-Fi, it resolved the issue. Many thanks!
0

I have the same problem on arch linux, git version 2.8.2, can't push to bitbucket repo. Cloning and pull works.

2 Comments

@Dado: Sorry for commenting here, I can't comment your answer yet. I tried earlier with changing postBuffer size, but it didn't work, I have a good internet connection and, and I modified only 4 not too big files (few hundred lines c++ code ~50 lines changed all in all). I nevertheless tried ssh, but it also fails with: fatal: The remote end hung up unexpectedly
Interesting I had problems pulling instead ;) Try to open a ticket with them they are quite good with customer service. (the only thing I can think of is just make sure that you aren't accidentally still using HTTPS)
0

Appearently it's a problem with HTTPS problem. Switching to SSH fix the problem with all repositories.

Comments

0

This happened in my case during a push and it was seemingly due to duplicate consecutive commit messages. Once I amended (git commit --amend) the second message to be slightly different from the first, pushed again, and success.

Comments

0

I had the same problem but for pull and fetch. Fetching or pulling from anywhere (Visual Studio, command line, etc) was failing with this error. Re-cloning the repository using the "Git GUI" for Windows was failing with the same error too.

For whatever reason, re-cloning the repository from the command line worked (either due to luck or due to some different git version being used between the two?) and I got a new working local repository.

I have fetched/pulled from the new local repository to the old (using the first method mentioned here), in order to minimize the things the old repo had to pull from the remote in order to get in sync, but it was still failing after the update. So, this appeared to be something with the repository, not with HTTP for me...

I could not try with SSH to see if there was any difference.

Comments

0

The cause for the push failure can be either the size of the buffer that Git uses when pushing data is lower than expected or your network issues.

First check your current buffer size by running the following command.

git config --get http.postBuffer

If its too low try increasing it to a higher level by running the following command.

git config --global http.postBuffer 524288000

If none of the options listed above delivered the desired result, try pushing your work with a different internet connection, preferably a private one, as occasionally a public connection can also impact this.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.