33

My project size is 1,63 GB (Magento Project) I had followed this tutorial

when I do this command : git push -u origin master , it is starting to write objects and after that I getting this error in git console:

error: RPC failed, result=22, HTTP code = 502 fatal: The remote end hung up unexpectedly fatal: The remote end hung up unexpectedly 

What should I do to make this work ?

The result of the git remote -v is : enter image description here

13
  • How is the git repository hosted? Locally, GitHub, GitLab...? Do you host it yourself, or use some hosting provider? Is there a proxy in front of the repository server? Commented Jun 20, 2014 at 8:25
  • 1
    And incidentally, a repo size of >1GB is pushing git's limits. Consider using something like git-annex. Commented Jun 20, 2014 at 8:26
  • 1
    @sleske I m using a hosting provider Commented Jun 20, 2014 at 8:26
  • @Chester: And which one would that be? And with which access method? Commented Jun 20, 2014 at 8:28
  • 1
    @Chester: 502 is "Bad gateway". It usually means that the web server (nginx, Apache...) in front of the actual service is telling you that that service is not running - not accepting requests. Usually it cannot start due to configuration error, wrong configuration, missing dependencies... We need to know more details to what are you actually connecting. What does git remote -v print out? Commented Jun 20, 2014 at 11:31

10 Answers 10

48

The remote end hangs up because the pack size you are trying to transmit exceeds the maximum HTTP post size. Try to limit this pack size with

git config --local http.postBuffer 157286400 

to 150MB.

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

1 Comment

This solved the issue for me. I was using a standard / default Git installation.
13

I got this problem when I had proxy set, but actually did not need proxy.

To fix:

git config --global --unset http.proxy git config --global --unset https.proxy 

Comments

8

I faced similar issue after I added HTTP_PROXY and HTTPS_PROXY environment variables to make other things work. I was unable to use our internal git repos. There is a way to fix it: You can add proxy variables with empty values to git using git config --global --edit:

[http] proxy = [https] proxy = 

Or using commands:

git config --global --add http.proxy "" git config --global --add https.proxy "" 

1 Comment

Exactly what i am facing.. and looking for :)
4

Try below commands.

git config --global user.name "dummy"

git config --global user.email "[email protected]"

git config --global http.postBuffer 157286400

for more information : https://confluence.atlassian.com/stashkb/error-rpc-failed-result-22-push-to-stash-fails-604537633.html

Comments

3

first increase size

# git config --global http.postBuffer 1048576000 git config --global http.postBuffer 500M git config --global http.maxRequestBuffer 100M git config --global core.compression 0 

to check size

git config --get http.postBuffer 

then open server terminal

su nano /etc/gitlab/gitlab.rb #edit this line unicorn['worker_timeout'] = '4000' #running gitlab-ctl reconfigure 

#for any case restart machine

Comments

2

My HTTP_PROXY and HTTPS_PROXY were setup in environment variable(s) for one project. So, removing this from environment variable(s) helped me sort the issue.

Comments

1

I had similar problem when I switched from proxy connection (via CNTLM) to direct. The solution is to remove this line from http section in file c:\Users\.gitconfig:

proxy = localhost:3128 

Comments

1

In my case I got the same error (HTTP 502 Bad gateway curl 22) when I created a git repository on a server under root user. Of course in this situation fcgiwrap and git-http-backend couldn't receive data from a client under www-data user. So after re-initialization of a server repository under www-data user the error is gone. Hope it helps someone.

2 Comments

I think this is my problem but I don't see or don't know how to find this user. Could you supply the steps that you did so that I can try to see if this helps me?
Thank you! sudo chown -R www-data.www-data . on the server fixed the problem.
1

I was seeing the same error and none of these solutions worked. It was a stupid mistake but I thought I would add it in case anyone else runs into it. I forgot the ".git" on the end of the URL when setting the remote origin.

1 Comment

Worked for me!.Needed to add ".git" to config file under the [remote "origin"] url section
0

if you are experiencing this issue on source tree , then do the following :

  1. Open preferences ( on Mac ) or settings ( in windows )
  2. click on 'Git' tab.
  3. Find "git version". under git version click on 'reset to Embedded git' button and then click back on 'Use System Git' button. ( this setting is for Mac OS , if you are using windows , find something similar there. ) enter image description here

see image

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.