git bash: 错误: RPC 失败;结果 = 18,HTP 代码 = 200B | 1KiB/s

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17683295/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 16:34:24  来源:igfitidea点击:

git bash: error: RPC failed; result = 18, HTP code = 200B | 1KiB/s

gitclone

提问by Innet

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

当我尝试在 git bash 上克隆时,收到此错误:

$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://[email protected]/path.git

Can anyone help?

任何人都可以帮忙吗?

回答by Ravi Rajendra

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

failed with error的解决方法:RPC failed;结果=18,HTTP代码=200

First Solution:

第一个解决方案:

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

如果错误是致命的,请尝试在远程存储库中运行以下命令:index-pack failed

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

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

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

尝试减少远程存储库配置中的 postBuffer 大小。请按照以下步骤操作

  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.
  1. 转到远程 git 存储库目录
  2. 运行以下命令来减小 postBuffer 的大小

    git config http.postBuffer 24288000

  3. 您可以通过执行“git config --get http.postBuffer”来检查此值
  4. 现在尝试克隆存储库(回到您克隆的位置)
  5. 如果失败并报错:RPC failed; result=18, HTTP code = 200 通过在配置中进一步增加 postBuffer 来重试。转到步骤 1。

回答by Srinivas

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

嘿,我遇到了同样的问题,但通过下面提到的链接解决了

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

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

**来自网站:**

解决方法:

虽然我们为此选项适当设置了服务器站点设置,但您可能需要调整/覆盖客户端的设置。为此,请执行以下命令:

从特定存储库中。请注意,末尾的数字是您希望在单个帖子中允许的大小,以字节为单位。如果您有更大的文件,则可能需要增加此数字。

git config http.postBuffer 524288000

为您曾经连接到的所有远程 Git 存储库设置全局

git config --global http.postBuffer 524288000

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

我不太确定它对每个人都有效,但这解决了我的问题

回答by Alex

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

我试了一下,无法解决当前的解决方案。当我访问显示问题的 GitLab 独角兽日志时,它解决了:

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.

工作超时表示长时间运行 git clone 的问题。

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

它已在 GitLab Unicorn 配置中修复。只需在 config/unicorn.rb 中将 180 秒更改为更大

timeout 360

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

如果您使用其他 Web 服务器或使用代理 Nginx,您可能还需要:

  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.

注意proxy_read_timeout和proxy_connect_timeout的部分。

回答by jsduniya

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

我们需要调整/覆盖您客户的设置。

git config --global http.postBuffer 524288000

回答by truf

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

我在 Kubuntu 中使用 git 遇到了这个问题。我还注意到网络的整体不稳定并找到了解决方案

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

options single-request

在 /etc/resolv.conf 中,将这一行添加到文件末尾

选项单一请求

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

这个固定的延迟在每个域名解析和 git 在此之后开始像魅力一样工作。

回答by SakthiSureshAnand

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

我在从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 gloabllyfor all remote Git repositories you ever connect to

如果你想为你曾经连接到的所有远程 Git 存储库设置全局

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

有关此问题的更多详细信息或说明请参阅此站点https://confluence.atlassian.com/pages/viewpage.action?pageId=301663284

回答by Santiago Palacios

On Linux

在 Linux 上

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

在执行 Git 命令之前,在命令行中执行以下操作:

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

On Windows

在 Windows 上

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

在执行 Git 命令之前,在命令行中执行以下操作:

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

More info ==> Atlassian Documentation

更多信息 ==> Atlassian 文档

回答by SummerRC

If the following command not works:

如果以下命令不起作用:

git config http.postBuffer 24288000

Try this command:

试试这个命令:

git config --add core.compression -1