The remote end hung up unexpectedly while git cloning

后端 未结 30 3287
旧时难觅i
旧时难觅i 2020-11-22 09:02

My git client repeatedly fails with the following error after trying to clone the repository for some time.

What could be the issue here?

30条回答
  •  生来不讨喜
    2020-11-22 09:48

    I was facing this issue when cloning data (via HTTP) from remote git repo hosted on AWS EC2 instance managed by elastic beanstalk. The cloning itself was also done on AWS EC2 instance.

    I tried all aforementioned solutions and their combinations:

    • setting git's http.postBuffer
    • settinghttp.maxrequestbuffer
    • turning off git compression and trying "shallow" git clone and then git fetch --unshallow - see fatal: early EOF fatal: index-pack failed
    • tunning GIT memory settings - packedGitLimit et al, see here: fatal: early EOF fatal: index-pack failed
    • tunning nginx configuration - setting client_max_body_size to both big value and 0 (unlimited); setting proxy_request_buffering off;
    • setting options single-request in /etc/resolv.conf
    • throttling git client throughput with trickle
    • using strace for tracing git clone
    • considering update of git client

    After all of this, I was still facing the same issue over and over again, until I found that issue is in Elastic Load Balancer (ELB) cutting the connection. After accessing the EC2 instance (the one hosting git repo) directly instead of going through ELB I've finally managed to clone git repo! I'm still not sure which of ELB (timeout) parameters is responsible for this, so I still have to do some research.

    UPDATE

    It seems that changing Connection Draining policy for AWS Elastic Load Balancer by raising timeout from 20 seconds to 300 seconds resolved this issue for us.

    The relation between the git clone errors and "connection draining" is strange and not obvious to us. It might be that connection draining timeout change caused some internal changes in ELB configuration that fixed the issue with premature connection closing.

    This is the related question on AWS forum (no answer yet): https://forums.aws.amazon.com/thread.jspa?threadID=258572

提交回复
热议问题