错误1
- 错误简要:
git push 大文件时提示:error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
- 详情:
:~/test$ git push
Username for 'https://gitlab.dajxyl.com': root
Password for 'https://root@gitlab.dajxyl.com':
warning: redirecting to https://gitlab.dajxyl.com/root/test.git/
Enumerating objects: 12, done.
Counting objects: 100% (12/12), done.
Delta compression using up to 8 threads
Compressing objects: 100% (11/11), done.
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
Writing objects: 100% (12/12), 126.13 MiB | 20.10 MiB/s, done.
Total 12 (delta 2), reused 0 (delta 0)
fatal: the remote end hung up unexpectedly
Everything up-to-date
- 排除思路:
- 错误原因:push文件过大,超过5m。刚好是nginx设置的默认request_body的最大大小。
环境考虑: nginx(边缘代理) -> nginx(docker) -> githubserver
-
配置边缘nginx
client_max_body_size
大小并reload -
上传>5m文件测试,若不能通过,继续检查github的docker镜像中的nginx配置,和gitlab中对文件上传的限制
-
解决过程:
配置边缘节点nginx:
client_max_body_size 0; # 不限制客户端请求主体的大小
git push
- 参考文档: github push 413错误
错误2
- 错误提示:
git方式clone的ssh端口不对
- 解决办法:
# 配置ssh端口
vi /etc/gitlab/gitlab.rb
gitlab_rails['gitlab_shell_ssh_port'] = 20022
# 重启gitlab服务
gitlab-ctl restart