git clone的时候报error: RPC failed; result=18错误
因业务需求,需要把内网gitlab仓库的地址对外网访问,在gitlab前端配置了一个nginx代理服务器,来实现需求,可以在git clone的时候报error: RPC failed错误
[root@Server_yd]# git clone http://username:password@gitlab.linzhongfengniao.com/ElectronicAPI.git
Initialized empty Git repository in /tmp/ElectronicVisaAPI/.git/
remote: Counting objects: , done.
remote: Compressing objects: % (/), done.
error: RPC failed; result=, HTTP code =
Receiving objects: % (/), 12.00 KiB | KiB/s
^C
经查询大致的意思就是内容过大,需要配置http.postBuffer,在服务器端配置后,依然无效,使用没有经过nginx代理端的地址测试正常。
git config --global http.postBuffer
由此判断问题出现在了nginx代理服务器,下载大文件超时。
nginx代理前端用户请求下载文件, nginx代理会先从后端nginx拿到文件并缓存到本地,然后响应给客户端,其中与proxy buffer相关的配置项如下:
proxy_buffer_size 512k;
proxy_buffers 512k;
proxy_busy_buffers_size 512k;
proxy_temp_file_write_size 512k;
由此可知, buffer缓冲区最大可以缓冲2.5M的数据,然后就开始刷写磁盘,如果磁盘无法写入,数据丢失。这也是为什么前端下载部分数据,即下载不动的原因。
1)将代理服务器缓存设置更大,可以直接缓存整个文件,跟上面的解决一样
2)禁用代理服务器缓存:
proxy_redirect default;
proxy_buffering off;
3)设置更长的超时时间
proxy_send_timeout ; #后端服务器数据回传时间(代理发送超时)
proxy_read_timeout ; #连接成功后,后端服务器响应时间(代理接收超时)
代理配置如下:
server {
listen ;
server_name gitlab.linzhongfengniao.com;
access_log /var/log/nginx/gitlab.linzhongfengniao.log main;
set $web_url $host;
if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot")
{
return ;
}
location / {
proxy_pass http://192.168.3.100;
include /etc/nginx/conf.d/deny.conf;
proxy_redirect default;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
set $domain default;
}
}
git clone的时候报error: RPC failed; result=18错误的更多相关文章
- (转)git clone: error: RPC failed; result=18, HTTP code = 200 解决办法
git clone: error: RPC failed; result=18, HTTP code = 200 解决办法 分类: git2013-09-01 17:03 10753人阅读 评论(2) ...
- cocoaPods安装成功终端代码(期间报error: RPC failed; result=56, HTTP code = 200)
Last login: Sat Oct 15 23:30:24 on ttys002 Sivek_lindeMacBook-Pro:~ Sivek_lin$ sudo gem update --sys ...
- git clone 新项目时,报error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: The remote en ...
- 对于在git上面拉代码报"error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054"解决方法
主要原因是安全设置的问题: 首先执行git config http.sslVerify "false" 若出现下列错误 git config http.sslVerify &q ...
- git bash: error: RPC failed; result = 18, HTP code = 200B
git config --global http.postBuffer 2428800 如果还是失败,说明buffer不够大,继续增加buff git config --global http.pos ...
- pod setup》error: RPC failed; result=18, HTTP code = 200
Try reducing the postBuffer size in the remote repository config. Follow the steps below Go to remot ...
- git clone报错error: RPC failed; curl 18 transfer closed with outstanding read data remaining
具体错误信息如下图: error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: ...
- 解决git报错:error: RPC failed; curl 18 transfer closed with outstanding read data remaining 的方法
报错信息: error: RPC failed; curl 18 transfer closed with outstanding read data remainingfatal: the remo ...
- git clone error: RPC failed; result=22, HTTP code = 502
http://www.jianshu.com/p/645d3fe4e028 git克隆的工程太大用https的方式会有如下问题 hbl:tmp hubert$ git clone https://gi ...
随机推荐
- freemarker模板加载TemplateLoader常见方式
使用过freemarker的肯定其见过如下情况: java.io.FileNotFoundException: Template xxx.ftl not found. 模板找不到.可能你会认为我明明指 ...
- list详解
#include <iostream> #include <vector> #include <list> std::list<std::string> ...
- Springboot时间参数格式化
@Configuration public class DateTimeFormatConfiguration extends WebMvcConfigurerAdapter { @Value(val ...
- 404 Note Found队-Alpha2
目录 组员情况 组员1(组长):胡绪佩 组员2:胡青元 组员3:庄卉 组员4:家灿 组员5:凯琳 组员6:丹丹 组员7:家伟 组员8:政演 组员9:黄鸿杰 组员10:刘一好 组员11:何宇恒 展示组内 ...
- IIS中ASP.NET虚拟目录不继承主站点web.config设置的办法(转载)
ASP.NET提供了强大的Web.config来配置网站,一般来说一个网站只有一个根目录下的Web.config文件,有时候我们希望子目录有着不同的权限或者参数设置,则可以在相应子目录增加一个Web. ...
- Xcode 5.1安装插件:规范凝视生成器VVDocumenter
类似java的多行凝视! 安装过程: 1.前往GitHub下载project文件:VVDocumenter-Xcode 2.用Xcode打开project,Command + B Build成功后,能 ...
- HTML小记
1.页面内跳转 当<a>元素用于页面内的锚点跳转时,应该先为该页面设置一些锚点,而定义锚点有两种办法: 通过<a>元素的name属性来定义,如:<a name=" ...
- TestNG+Maven+IDEA 自动化测试(二) TestNG.xml
示例代码: https://github.com/ryan255/TestNG-Demo 项目代码结构参考上一章 TestNG+Maven+IDEA 自动化测试(一) 环境搭建 maven插件引入 & ...
- 线程队列-queue
使用队列的目的: 解耦,使程序之间实现松耦合:提高处理效率 FIFO = 先进先出,first in first out LIFO = 后入先出,last in first out 生产者消费 ...
- MySQL常用:Got a packet bigger than 'max_allowed_packet' bytes & MySQL开远程服务
1. 数据导入时出现错误 Got a packet bigger than 'max_allowed_packet' bytes 通过终端进入mysql控制台 mysql>show VARIAB ...