3

I execute repo sync from jenkins slave.

But error occured a specific repogitory.

Cloning into 'repo_name'...
Connection to xxx.xxx.xxx.xxx closed by remote host.
fatal: The remote end hung up unexpectedly

When I execute it manualy(not from jenkins), repo sync was success. Above error occured only when executed by jenkins's slave.

I also try to below cmd. But it is failed same error.

git clone ssh://user@xxx.xxx.xxx.xxx:port/path/to/reponame

I try to git config --global http.postBuffer 524288000 with reference to the following. But it is not fixed....

The remote end hung up unexpectedly while git cloning

I add --progress and --verbose for investigation

git clone --progress --verbose ssh://user@xxx.xxx.xxx.xxx:port/path/to/reponame

git clone was succeed!!

Why It is failed from jenkins's slave. Why It is succeed when added --progress --verbose.

Can I fixed it without --progress? (repo sync seems without --progress when execute from jenkins.)

Sorry for my poor English.

stack_user
  • 462
  • 2
  • 12

2 Answers2

0

This is a common issue, it can have different reasons. Sometimes due to the low date speed of your slave machine.

Refer this ,

https://confluence.atlassian.com/bitbucketserverkb/git-clone-fails-fatal-the-remote-end-hung-up-unexpectedly-fatal-early-eof-fatal-index-pack-failed-779171803.html

Thanks

Sarath Kumar
  • 125
  • 7
  • Why did I succeed when I added `--progress` as being caused low date speed. – stack_user Feb 22 '19 at 08:46
  • --progress Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal. – Sarath Kumar Feb 22 '19 at 12:01
0

According to following

https://issues.jenkins-ci.org/browse/JENKINS-9168

When cloning a large repository over HTTP, the git server goes quiet for quite some time, busy computing a pack file. Normally, Apache is configured such that a prolonged inactivity in a socket will trigger a shutdown. So what the end user sees is that after a while, "git clone" fails by the unexpected connection reset by the server.

But, I can't configure server because server is public server. So,

If the user tries the same command from the shell, Git silently adds the --progress option (see the quote from the man page.) This keeps the socket chatty enough to avoid a shutdown from Apache.

On the other, repo can't add --progress option. I don't have any other choice so I mod script of repo. (.repo/repo/git_command.py)

stack_user
  • 462
  • 2
  • 12