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 ...
随机推荐
- eclipse 自动生成get/set方法
Shift+Alt+S 会弹出一个对话框 选择Generate Getters and Setters
- 「bzoj 4180: 字符串计数」
题目 真是一道好题 首先根据一个非常显然的贪心,如果给出了一个串\(S\),我们如何算最小操作次数呢 非常简单,我们直接把\(S\)拉到\(T\)的\(SAM\)上去跑,如果跑不动了就停下来,重新回到 ...
- POJ1375 Intervals
嘟嘟嘟 题意简述:给出一个光源\((x_0, y_0)\),和一些圆,求投影区间. 这道题其实就是求经过\((x_0, y_0)\))的圆的切线. 刚开始我想到了一个用向量旋转的方法,但是写起来特别麻 ...
- 使用iframe标签隐藏CSRF代码
index.html <iframe src="1.html" width="0" height="0"></iframe ...
- oracle 查看表空间以及剩余量
--1.查看表空间的名称及大小 SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size FROM dba_tabl ...
- 阅读AuTO利用深度强化学习自动优化数据中心流量工程(一)
目录 问题 解决方法 模型选择 框架构建 Sigcomm'18 AuTO: Scaling Deep Reinforcement Learning for Datacenter-Scale Autom ...
- 解密蓝牙mesh系列
解密蓝牙mesh系列 https://mp.weixin.qq.com/s/KdVhkgcmHIboA0xPFqFCgQ 1.NRF52832 & NRF52840 BLE mesh 协议栈 ...
- ext4文件系统特性浅析
ext4作为Linux下的文件系统因其简单性.易管理性.兼容性强等特定,深受大多数用户喜欢,并且作为大多数Linux发行版中的默认文件系统.但是随着现在文件数目的增多以及文件数据的增大,ext4文件系 ...
- Delphi XE10在 Android下调用静态库a文件
Delphi Seatle can link Delphi project with Static library files(*.a): 1.at Delphi IDE, Add the " ...
- Objective-C基础知识之“类”
Objective-C语言是iOS开发的专用语言,虽然现在在逐步被swift语言取代,但是仍可以作为基础学习,学会Objective-C之后入手swift也是相当快速.今天我来简谈一下关于OC中的类. ...