4

I am having an interesting issue. I have a pet project on bitbucket and so far I was able to pull and push from two different networks (home and office). It took a while to set the configuration properly but I have figured it out with some try and error approach. Now the issue is that I have created a branch in the office (which is behind a proxy) and I can't push it to the bitbucket with the --all parameter. I am getting:

RPC failed; result=22, HTTP code = 0

Here is the git bash (modified):

user@machine /c/dev/data/personal/projectname (master)
$ git push --all --dry-run
Password for 'https://username@bitbucket.org':
To https://username@bitbucket.org/username/projectname
 * [new branch]      ivymigration -> ivymigration

user@machine /c/dev/data/personal/projectname (master)
$ git push --all
Password for 'https://username@bitbucket.org':
Counting objects: 194, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (112/112), done.
Writing objects: 100% (116/116), 58.37 KiB, done.
Total 116 (delta 81), reused 0 (delta 0)
efrror: RPC failed; result=22, HTTP code = 0
atal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

user@machine /c/dev/data/personal/projectname (master)
$ git config --global -l
http.proxy=http://user:password@proxy:8080
http.postbuffer=524288000
user.name=[My Name]
user.email=[my_name]@[my.domain]
core.autocrlf=true
push.default=upstream

I have tried stuff from RPC failed; result=28, HTTP code = 0 but without success. Changing the https to git or git+ssh does not work either because of the proxy server. Interestingly the push worked so far fine without the --all attribute. But once I want to push all of it, including the new branch, the whole thing collapses.

Any thoughts?

Update #1:

I have tried to push the branch following the instruction in https://confluence.atlassian.com/display/BITBUCKET/Branching+a+Repository section 'How to branch in git' without success. Here is the git bash:

user@machine /c/dev/data/personal/projectname (master)
$ git push origin ivymigration
Password for 'https://username@bitbucket.org':
Counting objects: 203, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (72/72), done.
Writing objects: 100% (125/125), 70.79 KiB, done.
Total 125 (delta 86), reused 88 (delta 49)
efrror: RPC failed; result=22, HTTP code = 0
atal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

As you can see I get the same error.

Update #2:

I have tried what Seth suggested and here is the result:

user@machine /c/dev/data/personal/projectname (ivymigration)
$ GIT_TRACE=1 git push --all
trace: built-in: git 'push' '--all'
trace: run_command: 'git-remote-https' 'origin' 'https://username@bitbucket.org/username/projectname'
Password for 'https://username@bitbucket.org':
trace: run_command: 'send-pack' '--stateless-rpc' '--helper-status' '--thin' '--progress' 'https://username@bitbucket.org/username/projectname/' 'refs/heads/ivymigration:refs/heads/ivymigration'
trace: built-in: git 'send-pack' '--stateless-rpc' '--helper-status' '--thin' '--progress' 'https://username@bitbucket.org/username/projectname/' 'refs/heads/ivymigration:refs/heads/ivymigration'
trace: run_command: 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
trace: built-in: git 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
Counting objects: 203, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (72/72), done.
Writing objects: 100% (125/125), 70.79 KiB, done.
Total 125 (delta 86), reused 88 (delta 49)
efrror: RPC failed; result=22, HTTP code = 0
atal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

As you can see same result and no extra info related to the actual failure. So I have tried the second command. It failed because I am in Windows so there is no strace (Systrace for Windows). I have also tried to create a branch in the network without proxy (aka home) and were able to successfully git push --all from there. As I said before. I am able to git push from network behind proxy (aka office) but not able to do git push --all.

Community
  • 1
  • 1
Tomas Babic
  • 269
  • 5
  • 14
  • 22 is the curl code "CURLE_HTTP_RETURNED_ERROR", which means that internally (on http protocoll level) something get wrong. – Rudi Jul 16 '12 at 07:28
  • 1
    Try upgrading to the latest version of libcurl and git. You can also try running `GIT_TRACE=1 git push --all` and also `strace -o/tmp/tr -s256 -f git push --all` and see if the output and /tmp/tr has anything which looks interesting. Ideally try to test without going through the proxy or looking for errors on the proxy server. – Seth Robertson Jul 17 '12 at 01:43
  • http://stackoverflow.com/questions/16557071/git-error-rpc-failed-result-22-http-code-411 – firedev May 15 '13 at 04:49

3 Answers3

29

Here is what helped me, the following command increases git buffer to 500mb:

git config http.postBuffer 524288000

from here: Git: error: RPC failed; result=22, HTTP code = 411

Community
  • 1
  • 1
firedev
  • 20,898
  • 20
  • 64
  • 94
2

Kind of a hack, but I got around this using Fiddler2 and setting the proxy in .gitconfig to pass through Fiddler

[http]
proxy = http://USER:PASSWORD@127.0.0.1:8888

Downside is you need to launch Fiddler before doing any remote options and the plain text password, but at least it seems to work.

nschonni
  • 4,069
  • 1
  • 28
  • 37
  • I have installed Fiddler2 and tried to run the request through it but I have got same result. The only difference was that it took significantly (10x) longer to fail :-). – Tomas Babic Aug 10 '12 at 02:21
0

I had the same problem. I solved it by temporarily removing those lines from my .gitconfig:

[http]
    proxy = http://user:password@proxy.domain.tld:8080

And using the following command instead:

export http_proxy=http://user:password@proxy.domain.tld:8080
Marc de Verdelhan
  • 2,501
  • 3
  • 21
  • 40