若无闲事挂心头,便是人间好时节。|

Chuyio

园龄:7年10个月粉丝:87关注:16

2023-08-19 15:38阅读: 248评论: 0推荐: 0

k8s推送代码至gitlab报错error: RPC failed; result=22, HTTP code = 413 fatal: The remote end hung up unexpectedly

# git push -u origin main
Username for 'http://gitlab.wjl.net': root
Password for 'http://root@gitlab.wjl.net': 
Counting objects: 1032, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (871/871), done.
error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly
Writing objects: 100% (1032/1032), 48.53 MiB | 11.68 MiB/s, done.
Total 1032 (delta 179), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
Everything up-to-date

报错

error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly

由于gitlab是部署在k8s集群上的,所以gitlab需要通过ingress发布出去,后面的pull,push操作都是经过nginx的

解决方法
修改ingress-nginx的默认http上传文件大小(默认文件大小不能超过1MB),导致上传失败,出现了413问题。

# kubectl exec -it ingress-nginx-controller-rgf4j -n ingress-nginx -- bash
bash-5.1$ 
bash-5.1$ nginx -t
2023/08/19 07:31:22 [warn] 858#858: the "http2_max_field_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /etc/nginx/nginx.conf:144
nginx: [warn] the "http2_max_field_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /etc/nginx/nginx.conf:144
2023/08/19 07:31:22 [warn] 858#858: the "http2_max_header_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /etc/nginx/nginx.conf:145
nginx: [warn] the "http2_max_header_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /etc/nginx/nginx.conf:145
2023/08/19 07:31:22 [warn] 858#858: the "http2_max_requests" directive is obsolete, use the "keepalive_requests" directive instead in /etc/nginx/nginx.conf:146
nginx: [warn] the "http2_max_requests" directive is obsolete, use the "keepalive_requests" directive instead in /etc/nginx/nginx.conf:146
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
bash-5.1$ 
bash-5.1$ cp /etc/nginx/nginx.conf{,.bak20230819}
bash-5.1$ vi /etc/nginx/nginx.conf
找到如下字段修改为300m
client_max_body_size                    300m;
···
编辑nginx.conf后执行nginx -t检查配置文件
没问题执行nginx -s reload

再次推送

# git push -u origin main
Username for 'http://gitlab.wjl.net': root
Password for 'http://root@gitlab.wjl.net': 
Counting objects: 1032, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (871/871), done.
Writing objects: 100% (1032/1032), 48.53 MiB | 13.02 MiB/s, done.
Total 1032 (delta 180), reused 0 (delta 0)
remote: Resolving deltas: 100% (180/180), done.
To http://gitlab.wjl.net/root/ruo-yi-cloud.git
 * [new branch]      main -> main
分支 main 设置为跟踪来自 origin 的远程分支 main

本文作者:Chuyio

本文链接:https://www.cnblogs.com/chuyiwang/p/17642547.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Chuyio  阅读(248)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起