Git Push Fails - fatal: The remote end hung up unexpectedly
When users try to run "git push" the following error message is shown:
The "Smart HTTP" protocol in Git uses "Transfer-Encoding: chunked" in POST requests when it contains packed objects greater than 1MB in size.
Some proxy servers, like Nginx, do not support this transfer encoding by default, and the requests will be rejected before they get to Stash. Because of this, the Stash logs will not show any extra information.
When pushing a large amount of data (initial push of a big repository, change with very big file(s)) may require a higher
http.postBuffersetting on your git client (not the server). From https://www.kernel.org/pub/software/scm/git/docs/git-config.html
- Configuration on your reverse proxy. Usually ngnix the parameter
client_max_body_sizeis a blocker. The reverse proxy may also have a connection timeout that's closing the connection (e.g.
proxy_read_timeoutin ngnix). Try bypassing the proxy by pushing directly to Stash IP:port. If this works, it's highly likely that the proxy server is causing the early disconnect and needs to be tuned.
- User is using an outbound proxy on his machine that is causing the issue.
Increase the Git buffer size to the largest individual file size of your repo:
git config --global http.postBuffer 157286400
Refer to the resolution of Git push fails - client intended to send too large chunked body for ngnix reverse proxy configuration. Increase this parameter to the largest individual file size of your repo.
Bypass the outbound proxy as explained on Can't clone or pull due to a git outbound proxy
Was this helpful?
Thanks for your feedback!