白日依山尽,黄河入海流。欲穷千里目,更上一层楼。 -- 唐·王之涣

gitlab报错 - RPC failed

导语

部门使用的代码管理仓库是gitlab,随着业务发展,代码量也越来越大,到目前已经大于100M,今天新入职员工全量拉取代码时候报错,查找原因是因为代码仓库太大导致拉取超时。 这里记录下处理过程


报错

fatal: early EOF
fatal: The remote end hung up unexpectedly
fatal: index-pack failed
error: RPC failed; result=18, HTTP code = 200

解决

因为这边使用的docker搭建的gitlab,处理方式有点不同
必须先进入到gitlab容器中去操作,重启 gitlab 也必须是进入到docker 容器中重启,
否则从服务器直接重启容器会导致配置丢失,恢复成默认值

nginx client_max_body_size

之前修改过gitlab前端nginx的 client_max_body_size 大小,确保上传下载超大文件的可能性

vi /etc/nginx/nginx.conf
client_max_body_size 50M;

## check and reload nginx config
nginx -t
nginx -s reload

gitlab timeout

## need to enter gitlab container firstly
## then edit the config
vi config/unicorn.rb
timeout 300

## then restart gitlab in container
## remember that must be in container
/etc/init.d/gitlab restart

git http.postBuffer

另外建议也修改下本地 http.postBuffer 参数

## modify in commandline 
git config --global http.postBuffer 524288000

## check config list 
git config --list

最后重新拉取,没有问题


公众号: DailyJobOps DailyJobOps