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


i getting error when trying push django code git around 100 mb.

error: rpc failed; result=22, http code = 413 fatal: remote end hung unexpectedly

i tried http.postbuffer , changed nginx , apache2 settings, added client_max_body_size 500m;. neither using of servers. trying upload git. can 1 give me solution?

when 1 error?

this error occurs when try push large repository on http.

http.postbuffer setting on git client controls maximum size in bytes of buffer used when posting data. default size 1 mib , if try push file greater this, error.

some possible solutions:

1. setting higher value http.postbuffer setting

you can set higher value http.postbuffer setting on git client.

# increase git buffer size largest individual file size of repo git config --global http.postbuffer <size_in_mib>  

2. nginx servers:

(a) client_max_body_size setting

it can occur due default reverse proxy configuration settings. 1 such setting client_max_body_size setting sets maximum allowed size of request body.

in case of nginx server, default size of 1 mib applied pushing repository greater results in error.

from client_max_body_size setting in nginx docs:

sets maximum allowed size of client request body, specified in “content-length” request header field. if size in request exceeds configured value, 413 (request entity large) error returned client. please aware browsers cannot correctly display error. setting size 0 disables checking of client request body size.

to change client_max_body_size setting, load nginx.conf , add client_max_body_size setting value per needs in http block. can set client_max_body_size setting 0 allows users push repositories of size.

# nginx.conf     client_max_body_size <required_size_in_mib>; # add setting in http block set custom size client_max_body_size 0; # push repositories of size 

after adding setting, need reload nginx using sudo service nginx reload , try again push commit on http.

(b) connection timeout setting

the reverse proxy may have connection timeout that's closing connection (e.g. timeout or proxytimeout in apache, proxy_read_timeout in ngnix). try bypassing proxy pushing directly ip:port. if works, it's highly proxy server causing disconnect , needs tuned.

3. apache server:

you can set limitrequestbody setting increase allowed limit of http request body.

you need add limitrequestbody setting custom value per requirements in httpd.conf file. setting value 0 allow push file of size.

# httpd.conf limitrequestbody <custom_size_in_bytes> # set custom limit limitrequestbody 0 # no limit on size 

4. using ssh instead:

you can use ssh instead of http push repository.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -