Search code examples
gitgit-pushhttp-proxy

git push --all is failing on 'RPC failed; result=22, HTTP code = 0'


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.


Solution

  • 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