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 ...
随机推荐
- BZOJ 1008 越狱 组合数学
题目链接: https://www.lydsy.com/JudgeOnline/problem.php?id=1008 题目大意: 监狱有连续编号为1...N的N个房间,每个房间关押一个犯人,有M种宗 ...
- Python ,pickle
@Python pickle模块学习 pickle提供了一个简单的持久化功能.可以将对象以文件的形式存放在磁盘上. ---------------------------------------- ...
- BZOJ1014:[JSOI2008]火星人(Splay,hash)
Description 火星人最近研究了一种操作:求一个字串两个后缀的公共前缀.比方说,有这样一个字符串:madamimadam, 我们将这个字符串的各个字符予以标号:序号: 1 2 3 4 5 6 ...
- 【[SCOI2016]背单词】
这是一道贪心题 刚开始yy出来一个比较\(sb\)的贪心 之后发现它错了 首先这道题得先把题面翻译成人话 如果存在一个单词是它的后缀,且当前没被填入,代价为\(n*n\): 如果不存在一个单词是它的后 ...
- CentOS7开发环境搭建
BIOS开启VT支持 查询笔记本进入BIOS的按键,启动BIOS的虚拟化设置 假设安装360卫士,那么请永久关闭Intel-VT核晶防护引擎 CentOS DNS配置 Linux 下设置DNS位置有3 ...
- CCF认证201803-2 碰撞的小球 java代码实现。
问题描述 数轴上有一条长度为L(L为偶数)的线段,左端点在原点,右端点在坐标L处.有n个不计体积的小球在线段上,开始时所有的小球都处在偶数坐标上,速度方向向右,速度大小为1单位长度每秒. 当小球到达线 ...
- JavaScript编写学生查询系统
const readline = require('readline-sync')//引用readline-sync //用户名,密码 let user = [{ username: 'yang', ...
- JAVA语言编程思维入门
Java语言是一门强数据类型语言,也就是所有的数据有自己的数据类型,不能搞混淆.比如整数int 字符串String 不能用int a="字符串123";这样写是错的,因为数据类型不 ...
- 【腾讯敏捷转型No.3】Scrum有什么好?
在敏捷转型的过程中,除了敏捷宣言中的四个价值观和十二条原则以外,并没有太多比较权威的理论实践. 如图一,敏捷宣言中的四个价值观: (图一) 四条敏捷核心价值观指出了敏捷的核心思想,但是并没有仔细说明具 ...
- C++笔记020:const 和 #define 的对比
原创笔记,转载请注明出处! 点击[关注],关注也是一种美德~ 第一,const与#define的相同点 C++中的const常量类似于宏定义 const int c = 5 ≍ #defi ...