Push large commit over http fails #3099

Razer6 opened this Issue Feb 27, 2013 · 17 comments


None yet
Razer6 commented Feb 27, 2013

I'm trying to commit a large commit over http. This always fails with following error message:

$ git push origin master
Username for '<HOST>: <USER_EMAIL>
Password for 'http://<USER_EMAIL>@<HOST>':
Counting objects: 3322, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3010/3010), done.
Writing objects: 100% (3322/3322), 29.87 MiB | 8.07 MiB/s, done.
Total 3322 (delta 2379), reused 371 (delta 249)
efrror: RPC failed; result=22, HTTP code = 413
atal: The remote end hung up unexpectedly
fatal: recursion detected in die handler
Everything up-to-date

I already increased git message size on my client: git config http.postBuffer 524288000. I also increased the git object size in gitlab.yml.
Both configuration help to solve the problem.

Running on d67117b

xforce commented Feb 27, 2013

Try to increase the timeout in gitlab/config/unicorn.rb

Razer6 commented Feb 28, 2013

I found out the issue. I had to increase client_max_body_size of nginx.

@Razer6 Razer6 closed this Feb 28, 2013

Razer6, I'm having the same problem. How do I increase client_max_body_size?

Razer6 commented Apr 2, 2013

You have to add this to the nginx configuration:

http {
    # ...
    client_max_body_size 16M;
    # ...
hardhub commented Feb 23, 2014

client_max_body_size 16M;

For me it was necessary to make 1G instead of 16M. It makes sense if you are moving your source from another source control without history.


Add it to /etc/nginx/sites-available/gitlab. I tried this on /etc/nginx/nginx.conf and wondering why it never worked ;)

hardhub commented Feb 26, 2014

At least in CentOS 6 it should be in /etc/nginx/nginx.conf. In http section as described above.


Could be. I failed to mention that I was trying it on ubuntu.


Also as a work around you could change your repo's remote url protocol from http(s) to git/ssh if for some reason you don't have access to the nginx config. Again, its just a work around not a fix.

pbeeler commented Mar 14, 2015

same issue here but I'm using https://gitlab.com as my remote server... I'm on Ubuntu 14.10. I don't have nginx installed how can I fix this issue without using ssh/git?

Razer6 commented Mar 14, 2015

This should be fixed in GitLab 7.9. The timeout for http pushes is now increased to 1 hour

pbeeler commented Mar 14, 2015

@Razer6 it works fine on a fresh commit to push to a new repo. The issue is when a lot of files change from one commit to another that this issue happens. The issue is not the timeout for me. The error comes fairly quickly sometimes in under 5 minutes... So the only option for me currently, is to do a rebase and squash commits which I really hate doing... Only because it doesn't really preserve the commit history, but instead puts a lot of commits into one.

@cmoulliard cmoulliard referenced this issue in christian-posta/ceposta-devops-ose Apr 24, 2015

RPC failed (result=22) when pushing code to gitlab #6


I'm still having the same issue with gitlab.com

jancp commented Sep 15, 2015

I also have this issue on gitlab.com trying to push a single larger file (< 1 GB).


I'm having the same issue.


Having this issue with gitlab.com after increasing the postbuffer


I have been having the same problem with GitLab CE installed via DigitalOcean's One-Click installer. (Omnibus)

Thanks to DigitalOcean's help I was able to figure out that rather than looking for /etc/nginx/nginx.conf I should have been editing/etc/gitlab/gitlab.rb

I added the line

nginx['client_max_body_size'] = '50m'

and then ran sudo gitlab-ctl reconfigure followed by sudo gitlab-ctl restart nginx

This did not resolve the problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment