This is one that’s caught me out on more than one occasion now, hopefully by blogging it I won’t forget about it again quite so soon…
When attempting to push to a git repository over HTTP, you may experience a “broken pipe” error along the lines of the following:
Counting objects: 14466, done. Delta compression using up to 4 threads. Compressing objects: 100% (3746/3746), done. error: RPC failed; result=22, HTTP code = 400 fatal: The remote end hung up unexpectedly Writing objects: 100% (14466/14466), 104.13 MiB | 31.34 MiB/s, done. Total 14466 (delta 10927), reused 13812 (delta 10474) fatal: The remote end hung up unexpectedly fatal: expected ok/error, helper said '2004�Ȍ/↓/Ɠyb��Nj}↑z��"#7‼.m���+x9`>��☼�uhh_������м5���§��z���W?�^&��͙mQM��a`Q�C���Z' fatal: write error: Broken pipe
This error occurs when the amount of data you’re trying to push in one go exceeds git’s http post buffer which is defined in the docs as:
Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.
Whilst most day to day pushes are likely to be under 1MB, if you’re pushing a large repository over HTTP for the first time, there’s a good chance you’ll exceed this limit, resulting in the above error.
Increasing the buffer is a simple config change to set the new size in bytes (a value which will obviously need to exceed the size of the push that’s erroring):
git config http.postBuffer 209715200
One more thing – even after increasing git’s buffer I was still getting fatal errors. If you also host the destination repository, you need to make sure the server it’s running on doesn’t have a limit to the size of POST requests it will accept – a configuration change may be required to that as well. After I bumped up my max request length, everything worked as expected.
28 Comments
There is no +1 button, so I will just say “thanks.” Save me lots of time – just not all of my hair :\.
Thanks for this. Worked for me importing a current repository to Github.
🙂
Thank you very much, worked for me.
Great post… I was stumbling on this issue and this was the right answer to my problem.
Many thanks
Bye
Piero
Great post… I was struggling on this issue and this was the right answer to my problem.
Thanks a ton! I was also struggling with this issue on a git repository while doing git push on new mac. You saved my day!
Congrats man !!!
Saved loaaaaads of time !!
Cheers,
thanks too
thanks!
Thank you very much! It works like a charm.
thank you!
Thanks for posting this, it helped me alot! @–>–
Thanks – helped me when I ran into this exact error! I linked to this post from mine about migrating perforce repos to git.
Thanks a lot bro…
Thanks a lot.
Solved my problem where I spend more than 1 hour 😉
This is really annoying! If I’d known this would be an issue, I’d have added files in groups!
To help Google out, here is my exact error message, as it differs from yours:
$ git push
Unable to rewind rpc post data - try increasing http.postBuffer
error: RPC failed; result=65, HTTP code = 0
fatal: The remote end hung up unexpectedly
Everything up-to-date
$ git config http.postBuffer 209715200
$ git push
error: RPC failed; result=56, HTTP code = 0
fatal: The remote end hung up unexpectedly
Everything up-to-date
Bah!
When you deal git with huge files then need to increase buffer size
$ git config http.postBuffer 524288000
Example sets postbuffet to 500 MB.
Even in 2014, this advice is working great. Though Windows doesn’t refer to the error as a “broken pipe”, the fix works all the same. Thank you for taking the time to post this!
Hi Luke!
I had this same issue, but the post trick didn’t work for me. I figured out that the real problem was that my branch was too far behind the master’s head. So what ended up fixing it was a “git checkout master && git pull && git checkout mybranch && git rebase master && git push -f”. (the git push -f might not be appropriate for all workflows, but happened to be okay for mine.)
Best,
Travis
I could not resist commenting. Very well written!
Also visit my weblog … adobe
I am curious to find out what blog system you’re utilizing?
I’m experiencing some minor security issues with my latest
website and I would like to find something more risk-free.
Do you have any recommendations?
Here is my website; homemade pregnancy test
Hey would you mind letting me know which web host you’re using?
I’ve loaded your blog in 3 different internet browsers and I must say this blog loads a lot quicker then most.
Can you recommend a good internet hosting provider at a reasonable price?
Thanks a lot, I appreciate it!
Feel free to surf to my web site engagement party ideas
Life saver!
Does this setting solve the same problem when using SSH instead of HTTP?
Thanks a lot. It worked.
Thanks for this, it did save me time.
Thank you, man!
Thank you very much. It saves my day
9 Trackbacks
[…] http://blog.lukebennett.com/2011/07/25/git-broken-pipe-error-when-pushing-to-a-repository/ […]
[…] of this article:http://blog.lukebennett.com/2011/07/25/git-broken-pipe-error-when-pushing-to-a-repository/ Share this:TwitterFacebookLike this:Mi piaceBe the first to like […]
ezcreditcarloan
Git broken pipe error when pushing to a repository
Bangkok Condominium Rental
Git “broken pipe” error when pushing to a repository
naked camtocam
Git “broken pipe” error when pushing to a repository
Home-Based Business
Git
[…] Git “broken pipe” error when pushing to a repository –. write error: Broken pipe. Git “broken pipe” error when pushing to a repository. Git “broken pipe” error when pushing to a repository. […]
idea behind training
Git
San Diego Auto Body Repairs
Git