GitLab 使用git push 出现RPC failed; HTTP 500 curl 22 The requested URL returned error: 500

今天前端人员提交代码时,出现了如下奇怪错误:

$ git push origin
Counting objects: 4, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 5.59 MiB | 16.73 MiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 Internal Server Error
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

一看,6MB不到的文件居然提交失败,之前20M的文件都提交过.

网上搜了下,大多是说使用git config --global http.postBuffer 524288000将本地http的缓存加大到500MB,但试了下,依旧是这样的错误.于是翻了下gitlab的官方Issue.找到两个:

第一个Issue是说Gitlab中的配置需要修改,我的gitlab是跑在容器中,因此修改gitlab与nginx限制:

  • gitlab/config/gitlab.rb,修改了gitlab_rails['git_max_size'] = '524288000',增加到500MB.
  • nginx['client_max_body_size'] ='0',关闭nginx对上传内容的长度限制. 遗憾的是依旧无效.

第二个Issue中大伙挨个分析了错误的响应,并给出了几个解决办法,遗憾的依旧无效.

我对着日志挨个检查了一遍,发现错误在logs/nginx/gittlab_error.log中,错误内容为:

[crit] 468#0: *101 open() "/var/opt/gitlab/nginx/client_body_temp/0000000001" failed (13: Permission denied)  ...
...

看到这条便恍然,前两天将gitlab服务迁移到群晖下后,是文件夹权限变更导致的.因此git push文件时,size比较小的文件比如2K或者3K的代码提交很快,因为nginx根本不缓存.但是当文件只要稍大时,nginx必将缓存一下,这时权限问题便出现.

因此修改一下权限即可: nginx/client_body_temp/权限改为** 0700 **.

If you move gitlab's data folder, please check logs/nginx/gittlab_error.log,and in most cases, /var/opt/gitlab/nginx/client_body_temp/ Permission denied . So,just change client_body_temp permission to 700 :

chmod 700 data/nginx/client_body_temp

转载于:https://my.oschina.net/idoop/blog/1537023

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值