Git Problem And Resolution

  • Problem: Git Push Fails - fatal: The remote end hung up unexpectedly

Attention: This resolution comes from:
https://confluence.atlassian.com/stashkb/git-push-fails-fatal-the-remote-end-hung-up-unexpectedly-282988530.html

  • description

When users try to run "git push" the following error message is shown:

$ git push
Counting objects: 2332669, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (360818/360818), done.
error: RPC failed; result=22, HTTP code = 411
fatal: The remote end hung up unexpectedly
Writing objects: 100% (2332669/2332669), 483.30 MiB | 114.26 MiB/s, done.
Total 2332669 (delta 1949888), reused 2330461 (delta 1949349)
fatal: The remote end hung up unexpectedly
  • Cause

The "Smart HTTP" protocol in Git uses "TransferEncoding: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.
  • Workaround

When pushing a large amount of data (initial push of a big repository, change with very big file(s))
may require a higher http.postBuffer setting on your git client (not the server).
From https://www.kernel.org/pub/software/scm/git/docs/gitconfig.html
Configuration on your reverse proxy. 
Usually ngnix the parameter client_max_body_size is a blocker. 
The reverse proxy may also have a connection timeout 
that's closing the connection(e.g. TimeOut or ProxyTimeout in apache, 
proxy_read_timeout in 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.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容