19

When I try to clone on git bash, I receive this error:

$git clone <link>
Cloning into 'name_project'...
Password for '<link>':
remote: Counting objects: 100% (659/659), done.
error: RPC failed; result=18, HTTP code = 200B | 1 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: recursion detected in die handler

This is the command used:

git clone h(double t)ps://account@bitbucket.org/path.git

Can anyone help?

Leigh
  • 28,765
  • 10
  • 55
  • 103
Innet
  • 459
  • 3
  • 5
  • 18

9 Answers9

24

Solution for failed with error: RPC failed; result=18, HTTP code = 200

First Solution:

Try running the command below in the remote repository if error is fatal: index-pack failed

git repack -a -f -d --window=250 --depth=250

Second Solution:

Also try the below ones from the remote repository location if the above one didn't work:

git gc --aggressive

git repack -a -f -d --window=250 --depth=250

Third Solution:

Try reducing the postBuffer size in the remote repository config. Follow the steps below

  1. Go to remote git repository directory
  2. Run the following command to reduce the size of postBuffer

    git config http.postBuffer 24288000

  3. you can check this value by doing "git config --get http.postBuffer"
  4. Try cloning the repository now (back to where are you cloning)
  5. If failed with error: RPC failed; result=18, HTTP code = 200 try again by incresing the postBuffer ever further in the config. go to step 1.
Ravi Rajendra
  • 688
  • 4
  • 11
  • First solution worked for me for the error error: RPC failed; result=18, HTTP code = 200 1.20 MiB/s fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed – Loganathan Jan 29 '15 at 09:16
13

Hey I had same issue but resolved from link i mentioned below

https://confluence.atlassian.com/pages/viewpage.action?pageId=301663284

EDIT:

** From Website: **

Workaround:

While we have server site settings set appropriately for this option, you may need to adjust/override your client's settings. To do this, execute the following command(s):

From within a specific repository. Note the number at the end is the size, in bytes that you wish to allow in a single post. If you have much larger files, you may need to increase this number.

git config http.postBuffer 524288000

To set this gloablly for all remote Git repositories you ever connect to

git config --global http.postBuffer 524288000

I'm not quite sure that it'll work for everyone, but this solved my problem

Srinivas
  • 176
  • 2
  • 12
  • 1
    at the time of me having this issue, the link is down. Please provide actual instructions. – krivar Feb 06 '14 at 10:10
7

I try it and can't solve current solution. It solved when i just visit to my GitLab unicorn log that displays the problem:

I, [2014-02-10T17:46:29.953026 #5799]  INFO -- : worker=0 ready
E, [2014-02-10T17:47:52.026874 #5719] ERROR -- : worker=1 PID:5728 timeout (181s > 180s), killing
E, [2014-02-10T17:47:52.039670 #5719] ERROR -- : reaped #<Process::Status: pid 5728 SIGKILL (signal 9)> worker=1

the worker timeout says about problems with long time running for git clone.

It fixed in GitLab Unicorn config.. just change 180 seconds to bigger in config/unicorn.rb

timeout 360

If you use other web server or use proxy Nginx, possible you need also:

  server {
       ...
    # if a file, which is not found in the root folder is requested,
    # then the proxy pass the request to the upsteam (gitlab unicorn)
    location @gitlab {
      proxy_read_timeout 600; # https://github.com/gitlabhq/gitlabhq/issues/694
      proxy_connect_timeout 600; # https://github.com/gitlabhq/gitlabhq/issues/694
      proxy_redirect     off;

      proxy_set_header   X-Forwarded-Proto $scheme;
      proxy_set_header   Host              $http_host;
      proxy_set_header   X-Real-IP         $remote_addr;

      proxy_pass http://gitlab;
    }
  }

pay attention to part of proxy_read_timeout and proxy_connect_timeout.

Alex
  • 1,297
  • 1
  • 16
  • 12
  • 2
    In my case timeout in unicorn.rb was 30 seconds. It looks like stupid message: # nuke workers after 30 seconds instead of 60 seconds (the default). And it was a problem to clone repository because 30 seconds was not enough for big repository. I changed it to 300 and now it works fine. – Maxim Jul 25 '14 at 11:09
  • 1
    @Alex, Thanks a lot..It worked. I was searching for this config file for last 2 days.. +1 – sat Feb 21 '19 at 10:02
4

We need to adjust/override your client's settings.

git config --global http.postBuffer 524288000
jsduniya
  • 2,464
  • 7
  • 30
  • 45
2

On Linux

Execute the following in the command line before executing the Git command:

  1. export GIT_CURL_VERBOSE=1
  2. export GIT_TRACE_PACKET=1
  3. export GIT_TRACE=1

On Windows

Execute the following in the command line before executing the Git command:

  1. set GIT_TRACE_PACKET=1
  2. set GIT_TRACE=1
  3. set GIT_CURL_VERBOSE=1

More info ==> Atlassian Documentation

0

I faced with this problem using git in Kubuntu. I've also noticed overall instability in networking and found a solution.

in /etc/resolv.conf add the line to the end of the file

options single-request

This fixed delays before every domain name resolution and git started to work like a charm after this.

Community
  • 1
  • 1
truf
  • 2,843
  • 26
  • 39
0

I faced this Problem while cloning the code from bitbuket.com

Error

D:\ABCProj>git clone xxxxxxx
cloning into 'xxxxx'.....
Password for 'https://ccccc':
remote:Counting Objects : 14705,done.
remote:Compressing Objects :100%(1234/1234),done.
error:fatal:fatal:RPC failed ; result =18 ,HTTP code =200B/s early EOF
The remote end hung up unexpectedly
fatal:index-pack failed

Solution , below things are fixed my Probs ! Simply I just excute the below any one of the command then could you plz again clone /check out like

D:\ABCProj>git config http.postBuffer 524288000

If you want To set this gloablly for all remote Git repositories you ever connect to

D:\ABCProj>git config --global http.postBuffer 524288000

Then Once clone your Project

D:\ABCProj>git clone xxxxxxxxxxxxx 

Further more details or clarification about this Problem Please refer this site https://confluence.atlassian.com/pages/viewpage.action?pageId=301663284

SakthiSureshAnand
  • 1,324
  • 16
  • 32
0

If the following command not works:

git config http.postBuffer 24288000

Try this command:

git config --add core.compression -1
SummerRC
  • 1
  • 2
0

Set http.postBuffer, but still raises the error.

git config --global http.postBuffer 524288000

Adding GIT_CURL_VERBOSE=1 before git clone ... works for me.

GIT_CURL_VERBOSE=1 git clone https://github.com/...

Refer to: git config - Git clone return result=18 code=200 on a specific repository - Stack Overflow

SparkAndShine
  • 17,001
  • 22
  • 90
  • 134