7

I try to install brew to install python libs using the code

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 

But I get this error

error: 1262 bytes of body are still expected MiB | 11.00 KiB/s fetch-pack: unexpected disconnect while reading sideband packet fatal: early EOF fatal: fetch-pack: invalid index-pack output Failed during: git fetch --force origin 

tried the gpt solution to it but it didn't work. git config --global http.postBuffer 157286400 This will increase the size of the buffer that Git uses when fetching data from the remote repository, which may help to resolve the issue if it is caused by large files or a slow connection.

I also tried to run this

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

I got the same error. Keep in mind that my internet is working properly and I am browsing the web.

2
  • 1
    Keep in mind that my internet is working properly and I am browsing the web. The fact that you can browse the web doesn't mean that your Internet connection is 100% working. You mention macos in tags (and brew, which doesn't seem to be for Windows) so you'll have bypassed one of the common problems with Windows systems where certain network drivers have bugs that only affect some software. (Such bugs can occur on macs as well of course, they're just not common right now, unlike Windows.) Commented Dec 27, 2022 at 9:05
  • But some middleware (including some VPNs)—hardware and/or software boxes—will corrupt some data, so that too can be a source of problems. In any case, this isn't a programming issue, it's a network operation one: you'll want superuser.com or similar. Commented Dec 27, 2022 at 9:08

3 Answers 3

8

You can try changing the compression configuration:

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

2 Comments

On Windows 11, I also had to disable Windows Defender's Real Time Protection.
TY @juniel_katarn, same. Using Git-for-Windows 2.43.0 and disabling Defender real-time protection allowed me to git submodule foreach git reset --hard to finish checking out my submodules.
4

Looking for solutions to this on Windows 10 took me to:

The current workaround appears to be to use PuTTY/Pageant instead of open-ssh tools on windows.

Maybe this will help you or someone else track progress on a real fix if it is on Windows. I don't get this issue on my Ubuntu system.

Comments

2

I had this issue and couldn't fetch a repo. So what I did was to first clone shallow a single branch. And then unshallow the repo.

git clone --depth=1 -b main https://repo 

To unshallow see the excellent answer https://stackoverflow.com/a/17937889/520567

Note that I needed to run the fetch command a couple of times until it succeeded. The difference is that when clone fails, the target dir is removed. When fetch fails, all objects fetched remain. So running fetch multiple times helps you get more and more objects until all pass through.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.