[Solved] Git push error: error: RPC failed; HTTP 413 curl 22 the requested URL returned error: 413

 

#Accident scene

Git submitted push with enrollment error:

Enumerating objects: 448, done.
Delta compression using up to 4 threads
Total 424 (delta 109), reused 0 (delta 0), pack-reused 0
POST git-receive-pack (433422517 bytes)
Error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413

#Solution

As can be seen from the above error message, the code size submitted by Git is 433422517 bytes, about 400m; It is suspected that the submitted documents are too large.

1. First, modify the GIT global configuration

git config –global http.postBuffer 524288000

The result is pushed again, which is invalid
it is suspected that the size of the transfer file is limited in other places. In retrospect, the server where Git is located was accessed directly, but later it was accessed after being forwarded by Nginx. Therefore, I think there may be a problem with the Nginx configuration.

2. View git related configuration of Nginx

	location ~ /git(/.*) {
	    # others
	    
	    client_max_body_size 200M;
	}

The client_max_body_Size modify the configuration to 500m and restart Nginx
push again to solve the problem.

Read More: