Gitlab HTTP 413 curl 22 Request Entity Too Large

错误信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
git.exe push -v --progress "origin" master

Counting objects: 322, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (322/322), done.
POST git-receive-pack (chunked)
Writing objects: 100% (322/322), 118.46 MiB | 16.21 MiB/s, done.
Total 322 (delta 57), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
Pushing to http://code.yezhou.me/Document/AlgorithmApp.git
Everything up-to-date


git did not exit cleanly (exit code 1) (53516 ms @ 2017/7/2 18:37:36)

解决方法

1
2
# sudo -u git -H vim config/gitlab.yml
# sudo -u git service gitlab restart

修改max_size大小:

1
2
3
4
5
6
7
8
9
10
11
## Git settings
# CAUTION!
# Use the default values unless you really know what you are doing
git:
bin_path: /usr/bin/git
# The next value is the maximum memory size grit can use
# Given in number of bytes per git object (e.g. a commit)
# This value can be increased if you have very large commits
max_size: 52428800 # 20.megabytes
# Git timeout to read a commit, in seconds
timeout: 10

注意:如果采用Nginx反向代理配置域名,则需要设置client_max_body_size(上传文件大小限制)

1
2
3
4
5
6
7
8
9
server {
listen 80;
server_name code.yezhou.me;

location / {
client_max_body_size 0; #表示不限制
proxy_pass http://xxx.xxx.xxx.xxx:88;
}
}

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :