Git, WSL2, SSH: unexpected disconnect while reading sideband packet

12,673

Solution 1

The WiFi networking card on my laptop was the root cause. My card is killer wifi but also read the same happening to Intel WiFi cards.

Upgrading the WiFi card drivers immediately fixed the issue.

Still completely lost on me how a networking drive ended up causing this strange git error issue.

Solution 2

export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

git config --global core.compression 0
git clone --depth 1 <repo_URI>
# cd to your newly created directory
git fetch --unshallow 
git pull --all

Solution 3

The trick for me was --no-tags:

git clone --no-tags ssh://[email protected]/repo/project.git

Solution 4

Try to switching to different network and see if this problem persists. If my assumption is right, it's due to the low connectivity of your internet.

It's most likely due to bad internet, as evident by the following line:

fetch-pack: unexpected disconnect while reading sideband packet
Share:
12,673

Related videos on Youtube

amateur barista
Author by

amateur barista

Professional Drupalista. Amateur Barista.

Updated on September 18, 2022

Comments

  • amateur barista
    amateur barista over 1 year

    While attempting to clone a remote Git repo using SSH I got the following error:

    git clone user@remote-repo:project.git .
    remote: Counting objects: 187444, done.
    remote: Compressing objects: 100% (73430/73430), done.
    client_loop: send disconnect: Broken pipe.06 MiB | 4.04 MiB/s
    fetch-pack: unexpected disconnect while reading sideband packet
    fatal: early EOF
    fatal: index-pack failed
    

    My environment has the following Specs:

    • WSL2 (Windows Subsystem 4 Linux)
    • git --version git version 2.30.1

    The git package can be found here https://pkgs.alpinelinux.org/package/edge/main/x86_64/git

    uname -a
    Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 Linux
    
    2021-03-09-07:11AM wsl@Alpine:~$ more /etc/issue
    Welcome to Alpine Linux 3.10
    Kernel \r on an \m (\l)
    

    I've got no clue why is this happening. Is it a bursting or kernel configuration issue on Alpine? WSL? I doubt it's the remote host. The remote host works fine for SSH, as well as cloning for every non-WSL user.

  • malat
    malat over 2 years
    The trick was git config --global core.compression 0
  • AW101
    AW101 over 2 years
    I had same issue with git push and found that I had to disconnect my highspeed wired and wifi networks and connect to a cellular 4G network. Speed was much slower but it worked. Now I need to find a real solution.