Petra Barus
Petra Barus

Reputation: 4013

RPC failed; result=28, HTTP code = 0

I'm trying to push my code into github, but almost everytime I meet this error

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

It's so annoying. Anyone knows how to fix this?

Update After I googled, I read that running git config --global http.postBuffer 524288000 could solve the problem. But even after I ran that command, I still met the problem.

Upvotes: 14

Views: 14960

Answers (5)

Abhijith Sasikumar
Abhijith Sasikumar

Reputation: 14990

It is not necessary to use SSH here as mentioned in the accepted answer. Recently got stuck with the same issue. Increase the Http default 1 MiB buffer size to a large value:

git config --global http.postBuffer 1048576000

then try git push remote branch_name.

Hope it helps somebody.

Upvotes: 2

Akah
Akah

Reputation: 1398

Generally these error conditions and codes are due to a network misconfiguration or unreliable internet connectivity at the moment. Usually after a few tries, everything should be back to normal. Try different connection protocols if problem persists after several tries.

Upvotes: 0

andygavin
andygavin

Reputation: 2884

That error code is a timeout error on the client. Although I suspect that the server-side is closing as the message suggests. To try and get more information you could try setting the environment variable GIT_CURL_VERBOSE=1 for your push eg:

GIT_CURL_VERBOSE=1 git push origin

This can give you an indication of whether it is the client timing out or the server disconnecting that is the original error. There are a number of things you might do to ensure that you're not always coming across this error.

  1. Check the timeouts on the server side, if you can control it. They may be too small. This depends on the server implementation.
  2. Check your repository for large files particularly binary files. These can be handled differently.
  3. Ensure you aren't setting http.lowSpeedLimit, http.lowSpeedTime inadvertently: they should be off by default (by looking at the code).

Large Repository

For point 2. There are a number of things you can do if you suspect that the pack you are pushing is large objects. This blog post is quite detailed on the subject:

http://blogs.atlassian.com/2014/05/handle-big-repositories-git/

I don't think the http.postBuffer is really a solution here.

Upvotes: 0

Siwei
Siwei

Reputation: 21557

I met the same problem( working behind a proxy and not able to access git://)

maybe it depends on the network situation?

do the "push" more times and it works for me. (pushed total 5 times, 2 successful)

btw, I am using the "https_proxy" environment variable, not the "http_proxy"

Upvotes: 0

Lazy Badger
Lazy Badger

Reputation: 97282

Use git:// or git+ssh://, not https

Upvotes: 29

Related Questions