Is there a way to fix brew install early eof error? - homebrew

Whenever I type any brew install command into the terminal I always get the same error:
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 659774, done.
remote: Counting objects: 100% (338/338), done.
remote: Compressing objects: 100% (170/170), done.
error: 6957 bytes of body are still expected.31 MiB | 4.20 MiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --origin=origin --template=` exited with 128.
Is there anyway of fixing it? (I have tried uninstalling and reinstalling homebrew and other methods)

That is basically git clone issue, try turn off the compression to see it helps.
git config --global core.compression 0

Related

Error: Error cloning remote repo 'origin`

I'm facing the same issue as mentioned here
ERROR: Error cloning remote repo 'origin'
I'm getting this issue when it is triggered as a downstream job (triggered from another job / Upstream). I'm still be able to make it work by rebuilding the build / manually triggering the build but I don't understand how.
Also Tried giving Git tool chain explicitly in the configuration, but this doesn't have any effect on the build (resolving the above issue)
PFB Code Block:
12:43:55 > /usr/bin/git fetch --tags --force --progress -- <ssh git repo link> +refs/heads/*:refs/remotes/origin/* # timeout=10
12:45:11 ERROR: Error cloning remote repo 'origin'
12:45:11 hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- <ssh git repo link> +refs/heads/*:refs/remotes/origin/*" returned status code 128:
12:45:11 stdout:
12:45:11 stderr: remote: Counting objects: 12277, done
remote: Compressing objects: 1% (47/4605)
remote: Compressing objects: 2% (93/4605)
.
.
12:45:11 Receiving objects: 100% (12277/12277), 1012.00 KiB | 525.00 KiB/s
Receiving objects: 100% (12277/12277), 1.55 MiB | 731.00 KiB/s, done.
12:45:11 fatal: unable to open .git/objects/pack/tmp_pack_9xXtjN: No such file or directory
12:45:11 fatal: index-pack failed

Can't update or upgrade Homebrew

I can no longer run either brew upgrade or brew update: both abort with
Error: homebrew-core is a shallow clone. To `brew update` first run:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
and if I follow this suggestion and run git ... --unshallow and then try brew update or brew upgrade I still get the same error message.
If I then try the command again (maybe I didn't do it right the first time?) I get
fatal: --unshallow on a complete repository does not make sense
How do I get past this error message to run brew upgrade or brew update without errors?
HOMEBREW_VERSION: 2.6.0-82-gde1afcb
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: de1afcbfc58fb3cd5779bd8fbb6b9995700dda4c
Last commit: 30 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a7c63b0f7f7ae416a2f961b263155281759ac3a7
Core tap last commit: 29 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.FwPJPzeLfq/org.macosforge.xquartz:0
HOMEBREW_EDITOR: /usr/local/bin/bbedit
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_EMOJI: set
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: quad-core 64-bit haswell
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_172
macOS: 10.15.7-x86_64
CLT: 12.0.32.27
Xcode: 12.2
XQuartz: 2.7.11 => /opt/X11
It's asking you to unshallow both homebrew-core and homebrew-cask with:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
Nothing worked with me until I did:
cd /usr/local/Homebrew/Library/Taps/homebrew/
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git
note: as of Feb 2023 Taps are now here:
/opt/homebrew/Library/Taps/homebrew
Seems that is has been a change in the Homebrew policy and there is not going to be a shallow clone any more.
The correct answer is unshallow, as requested —see Eric3 answer— or install it again, which is going to produce a unshallow / regular copy of the repo.
This worked for me.
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
remote: Enumerating objects: 561296, done.
remote: Counting objects: 100% (561255/561255), done.
remote: Compressing objects: 100% (200847/200847), done.
remote: Total 552295 (delta 355423), reused 545449 (delta 348597), pack-reused 0
Receiving objects: 100% (552295/552295), 214.42 MiB | 2.60 MiB/s, done.
Resolving deltas: 100% (355423/355423), completed with 4915 local objects.
From https://github.com/Homebrew/homebrew-core
09e19b5c825..003302f81db master -> origin/master
remote: Enumerating objects: 180904, done.
remote: Counting objects: 100% (166460/166460), done.
remote: Compressing objects: 100% (47394/47394), done.
remote: Total 155334 (delta 116608), reused 146431 (delta 107784), pack-reused 0
Receiving objects: 100% (155334/155334), 73.84 MiB | 4.87 MiB/s, done.
Resolving deltas: 100% (116608/116608), completed with 6054 local objects.
From https://github.com/Homebrew/homebrew-cask

CocoaPods/Specs cloning from github takes too much time

I tried many time to clone this url
git clone https://github.com/CocoaPods/Specs.git
But it shows like the following, how to fix this issue? Please help me.
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 1082703, done.
remote: Compressing objects: 100% (279/279), done.
Receiving objects: 2% (25216/1082703), 5.03 MiB | 16.00 KiB/s
Sometime it may breaking like after 50% completed and also showing following error
error: RPC failed; curl 56 SSLRead() return error -9806 MiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
If you only need the most recent version, try
git clone --depth=1 https://github.com/CocoaPods/Specs.git
It will decrease the size to 1/3.
Also, depending on your network condition, a proxy might help.

Can't build docker package (docker-git) with makepkg

I'm trying to build the docker-git package on my archlinux (i686).
I download the package from https://aur.archlinux.org/cgit/aur.git/snapshot/docker-git.tar.gz, untar it and run makepkg.
But I get the following output :
$ makepkg
==> Making package: docker-git 1:1.9.0.dev.18703.670c488-1 (Tue Oct 6 22:27:42 CEST 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating docker git repo...
Fetching origin
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 7 (delta 5), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (7/7), done.
From https://github.com/docker/docker
+ 382d383...29cbec5 refs/pull/16758/merge -> refs/pull/16758/merge (forced update)
-> Found docker.service
-> Found docker.install
-> Found docker.conf
==> Validating source files with md5sums...
docker ... Skipped
docker.service ... Passed
docker.install ... Passed
docker.conf ... Passed
==> Extracting sources...
-> Creating working copy of docker git repo...
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
# WARNING! I don't seem to be running in the Docker container.
# The result of this command might be an incorrect build, and will not be
# officially supported.
#
# Try this instead: make all
#
bundles/1.9.0-dev already exists. Removing.
---> Making bundle: dynbinary (in bundles/1.9.0-dev/dynbinary)
Created binary: bundles/1.9.0-dev/dynbinary/dockerinit-1.9.0-dev
Building: bundles/1.9.0-dev/dynbinary/docker-1.9.0-dev
# _/home/vmonteco/Downloads/docker-git/src/docker/docker
/usr/lib/go/pkg/tool/linux_386/link: running gcc failed: exit status 1
/tmp/go-link-183610645/000007.o: In function `__udivdi3':
(.text+0x8ebc0): multiple definition of `__udivdi3'
/tmp/go-link-183610645/000003.o:(.text+0x740): first defined here
collect2: error: ld returned 1 exit status
==> ERROR: A failure occurred in build().
Aborting...
Did I forget something? I don't know what the error means.
I also tried make all as suggested from the src/docker subdirectory but I got :
$ make all
docker build -t "docker-dev:makepkg" .
/bin/sh: docker: command not found
Makefile:74: recipe for target 'build' failed
make: *** [build] Error 127
NB: I also had to replace the docker.service md5 sum in the PKGBUILD file, it was invalid before.
Try building with this PKGBUILD: https://gist.github.com/grimsock/8edc7c4f38800f3f992f
Do you have all dependecies installed? Especially from makedepends array?

Development Log file exceeds GitHub's file size limit, even after deleting file

I tried to commit some changes in my app, and received an error that the development log was too big at 512MB. I deleted the development log file and tried again, and the same error showed up with a log size of 103.2MB. I also tried rake log:clear with the same error.
Apparently the development log file is getting rewritten. I have never used the logs and would probably not miss them...is there a way to commit to git and not rewrite the development log?
2 files changed, 0 insertions(+), 1096498 deletions(-)
rewrite log/development.log (100%)
rewrite log/production.log (100%)
[master]~/Projects/schoolsapi: git push origin master
Username:
Password:
Counting objects: 26, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (17/17), 6.90 MiB | 322 KiB/s, done.
Total 17 (delta 7), reused 0 (delta 0)
remote: Error code: 026c4e06d174bf5b0e51c754dc9459b0
remote: warning: Error GH413: Large files detected.
remote: warning: See http://git.io/iEPt8g for more information.
remote: error: File log/development.log is 103.32 MB; this exceeds GitHub's file size limit of 100 MB
Update after trying suggestions from answers 1 and 2 below:
The problem still exists. I've removed the log file from the git repo, and my local machine, inserted the .gitignore file and updated development.rb with the config logger bit. The last two lines below show that the development.log file does not exist in git or my local machine.
master]~/Projects/schoolsapi: git add .
[master]~/Projects/schoolsapi: git commit -m"Tried config logger per apnea diving"
[master b83b259] Tried config logger per apnea diving
2 files changed, 4 insertions(+), 0 deletions(-)
create mode 100644 .gitignore
[master]~/Projects/schoolsapi: git push origin master
Username:
Password:
Counting objects: 38, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (26/26), 6.90 MiB | 525 KiB/s, done.
Total 26 (delta 12), reused 0 (delta 0)
remote: Error code: e69d138ee720f7bcb8112e0e7ec03470
remote: warning: Error GH413: Large files detected.
remote: warning: See http://git.io/iEPt8g for more information.
remote: error: File log/development.log is 103.32 MB; this exceeds GitHub's file size limit of 100 MB
[master]~/Projects/schoolsapi: rm log/development.log
rm: log/development.log: No such file or directory
[master]~/Projects/schoolsapi: git rm log/development.log
fatal: pathspec 'log/development.log' did not match any files
[master]~/Projects/schoolsapi:
UPDATE
I had earlier commits which still had the log/development.log file. Using this code provided by the selected answer below (huge thanks to this person), the problem was fixed with one small caveat:
git filter-branch --index-filter 'git rm --cached --ignore-unmatch log/development.log' --tag-name-filter cat -- --all
The caveat is that I had to use git push origin +master to override git's automatic rejection of non-fast-forward-updates. I was comfortable doing this because I am the only person working on this app. See this question:
Git non-fast-forward rejected
It seems you have earlier added/checked-in your development.log file into the git repo.
You need to remove it, and make a commit.
git rm log/development.log
git commit -m "removed log file"
In general, you should put your log directory into your .gitignore file
echo log >> .gitignore
And to completely remove all the log files (in case others were added)
git rm -r --cached log
git commit -m "removed log file"
Github has recently started enforcing a 100MB limit for maximum file sizes. https://help.github.com/articles/working-with-large-files
Edit:
It seems you have previous commits which weren't pushed to github locally.
Try running
git filter-branch --index-filter 'git rm --cached --ignore-unmatch log/development.log' --tag-name-filter cat -- --all
Side answer to prevent the file to expand on your own disk, simply log to STDOUT in development.rb:
config.logger = Logger.new(STDOUT)
You'll keep logs on your server page, but the file won't be populated anymore.

Resources