6

I'm encountering an issue while trying to clone a Git repository from GitHub. When I run the git clone command, I consistently receive the following error message:

1824 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

I've tried several troubleshooting steps, including:

  • Checking my network connection
  • Increasing the buffer size using git config
  • Cloning via HTTPS instead of SSH
  • Checking the size of the repository
  • Ensuring I have enough disk space

However, none of these solutions have resolved the issue. I'm not sure what else to try. Has anyone else encountered a similar problem? Any suggestions for further troubleshooting or resolution would be greatly appreciated.

Thank you in advance for your help!

2
  • Interesting, I had a similar problem two days ago. I ended up using the download as zip function ti get the repo. Commented Apr 28, 2024 at 2:59
  • What OS and version of Git are you using? Are you using any sort of proxy, including a non-default antivirus or firewall, TLS MITM device, or monitoring software? Commented Apr 28, 2024 at 22:01

3 Answers 3

7

Solution: Try both command

git config --global http.postBuffer 52428800
git config --global core.compression 0
Sign up to request clarification or add additional context in comments.

1 Comment

git config --global http.postBuffer 52428800 working like a charm!!
2

Try these also,

Clear Git Cache:

Run the git config --global --unset http.sslVerify command to clear the Git cache and re-establish a clean connection.

Reduce Packet Size:

Try reducing the packet size using git config pack.windowSize 1024

Disable Compression:

git config --global core.compression 0

Comments

0

for me the accepted solution didn't work, with 500mb 1gb 2gb 100mb. I used this contraption:

# 100MB
git config --global http.postBuffer 104857600
git config --global http.version HTTP/1.1
git config --global core.compression 0
git config --global pack.window 10
git config --global pack.depth 50
git config --global pack.windowSize 10m
git config --global pack.packSizeLimit 2m
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 99999
git config --global http.keepAlive true

echo -e "${GREEN}INIT REPO${PLAIN}" ;
repo init -u $HALIUM_REPO -b "halium-$HALIUM_VERSION" --depth=1 --no-clone-bundle;

echo -e "${GREEN}SYNC START. This can take a very long time${PLAIN}" ;
repo sync -c --jobs=$JOBS --no-tags --force-sync --no-clone-bundle --optimized-fetch --prune;
repo sync -c --jobs=$JOBS --no-tags --force-sync --no-clone-bundle --optimized-fetch --prune;

Also changed SSH config just in case(this is from dockerfile):

# Configure SSH client for Git
RUN mkdir -p /home/ubpuser/.ssh && \
    echo "Host *\n\
    ServerAliveInterval 60\n\
    ServerAliveCountMax 10000\n\
    ConnectTimeout 300" > /home/ubpuser/.ssh/config \
    && chmod 600 /home/ubpuser/.ssh/config \
    && chown -R ubpuser:ubpuser /home/ubpuser/.ssh

1 Comment

its a big big repo alright xD

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.