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 ...
随机推荐
- php-fpm配置参数.md
Global Options pid string PID文件的位置.默认为空.默认路径放在/usr/local/php-fpm/var. error_log string 错误日志的位置.默认:安装 ...
- Guava包学习---I/O
Guava的I/O平时使用不太多,目前项目原因导致基本上只有在自己写一些文本处理小工具才用得到.但是I/O始终是程序猿最常遇到的需求和面试必问的知识点之一.同时Guava的I/O主要面向是时JDK5和 ...
- python3通过qq邮箱发送邮件
python3通过qq邮箱发送邮件 0.了解qq邮箱的SMTP QQ邮箱 POP3 和 SMTP 服务器地址设置如下: 邮箱 POP3服务器(端口995) SMTP服务器(端口465或587) qq. ...
- 人人开源之代码生成器(renren-generator)
本篇文章,主要包含三个部分,介绍.代码生成演示.代码分析(不会很深入)等 三个部分足以让你学会使用,实际生产可能遇到的问题不会在这遇到. 代码生成器的作用在于提高开发效率.但是这个代码生成器仍有其局限 ...
- redis安装及测试
http://jingyan.baidu.com/article/9113f81b0333e12b3214c7a8.html 下载地址:http://git.oschina.net/bingoPure ...
- git编译安装报错 http-push.c:20:19: 警告:expat.h:没有那个文件或目录
解决: [root@hdoop3 git-2.18.1]# yum install expat-devel
- mixup: Beyond Empirical Risk Minimization
这篇论文MIT和FAIR的工作,主要是提出了一种mixup的方式.(感觉是一种产生hard sample的方法,是一种新的.更有效的数据增强.) 1 Introduction 大网络需要大数据,目前C ...
- 链表推导式 【list comprehension】
x for x in x 链表推导式 [list comprehension]链表推导式提供了一个创建链表的简单途径,无需使用 map(), filter() 以及 lambda.返回链表的定义通常要 ...
- Java Calendar and SimpleDateFormat 时间模块
package UtilTest; import java.util.Calendar; import java.text.SimpleDateFormat; import org.apache.co ...
- PAT——1038. 统计同成绩学生
本题要求读入N名学生的成绩,将获得某一给定分数的学生人数输出. 输入格式: 输入在第1行给出不超过105的正整数N,即学生总人数.随后1行给出N名学生的百分制整数成绩,中间以空格分隔.最后1行给出要查 ...