Fetch-pack: unexpected disconnect while reading sideband packet

Hello everyone,

we have been working with a selfhosted Gitea for SCM for a while. A few weeks ago we added a CI running on the same server as Gitea. At first everything went fine: all repositories could be cloned and built by the CI.

However, for a few days we have the problem that some repositories couldn’t be cloned by the CI. The same repositories work flawlessly from our individual developers’ PCs.

The following error message is reported to us on the client side:

$ git clone git@git.[servername].de:[organization]/[reponame].git

Cloning into ‘[reponame]’…
remote: Enumerating objects: 2909, done.
remote: Counting objects: 100% (2909/2909), done.
remote: Compressing objects: 100% (2078/2078), done.
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

For this it doesn’t matter whether the CI server wants to clone the repository or whether I run git clone in git bash: both lead to the same error message.

About the system environment:

  • Installed Gitea version: Go1.12.13
  • Installed Git version: 2.37.3 (Git-for-Windows)
  • both running on the same Windows Server 2019
  • Access via SSH (sha1 key)

Does anyone have an idea what could be the cause of the problem and how to fix it?

Many thanks for your help!

Many greetings,

This is a known issue that apparently is related to the windows implementation of OpenSSH. You can find more information here: https://github.com/PowerShell/Win32-OpenSSH/issues/1322

TLDR: Either try a lot of times or move away from the windows OpenSSH implementation