博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
GitLab 使用git push 出现RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
阅读量:7119 次
发布时间:2019-06-28

本文共 1475 字,大约阅读时间需要 4 分钟。

  hot3.png

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

$ git push originCounting 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 Errorfatal: The remote end hung up unexpectedlyfatal: The remote end hung up unexpectedlyEverything 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

你可能感兴趣的文章
Postfix+Courier-Authlib+MySQL+Webmail搭建邮件服
查看>>
HTTP Live Streaming
查看>>
19个心得 明明白白说Linux下的负载均衡
查看>>
Spring Aop之Jdk代理实现原理详解
查看>>
吐槽神文推荐:不想装×的傻×不是好二×
查看>>
java 使用相对路径读取文件
查看>>
0823第三课-2 Linux的文件系统 bash基础特性
查看>>
解决Eclipse下真机调试无法输出Logcat
查看>>
知识链-Java IO
查看>>
SpringBoot入门九,添加shiro支持
查看>>
Spark算子:RDD行动Action操作(1)–first、count、reduce、collect
查看>>
jQuery插件开发
查看>>
OCJP 考试题之七
查看>>
RabbitMQ 消息中间件如何保证消费者customer能够成功处理消息?
查看>>
DNS轮循技术
查看>>
FreeSWITCH Dialplan of conference join user
查看>>
[Windows Azure] How to Scale an Application
查看>>
前端资源
查看>>
UIStepper 加减条
查看>>
fopen参数@windows和linux的区别
查看>>