brew: Running brew update results in process hang / freeze

brew doctor output

Your system is ready to brew.

Verification

  • My “brew doctor output” above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue’s title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 3.6.12-22-gd98de74
ORIGIN: https://github.com/Homebrew/brew
HEAD: d98de7438a9d6efb8049d0f1d59109b98f7a1d7b
Last commit: 29 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 3b2af9221dda2be65b3319f2e066875de4c7b734
Core tap last commit: 2 weeks ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.38.1 => /opt/homebrew/bin/git
Curl: 7.84.0 => /usr/bin/curl
macOS: 13.0.1-arm64
CLT: 14.1.0.0.1.1666437224
Xcode: 14.1
Rosetta 2: false

What were you trying to do (and why)?

I was trying to update brew with brew update

What happened (include all command output)?

While trying to run brew update, the system hanged.

I then ran brew update -d to run in debug mode and noticed that it hung on the following logs:

rm -f /opt/homebrew/.git/TMP_FETCH_FAILURES

What did you expect to happen?

I expected brew to update

Step-by-step reproduction instructions (by running brew commands)

> brew update
> brew update -d

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Getting the same issue. Running brew update just hangs (5 mins at least). Ran Brew update-reset also had a hang when Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-core… but it did (after several mins resolve and proceed normally. Tested network connections between my local computer and host and am able to connect @ 1.1Gbps with no packet loss. Could still be on GitHub side but just thought I’d share my experience. Snippet of the update-reset below with the slow step bolded.

DTassara@Gauss ~ % brew update-reset
==> Fetching /opt/homebrew...
remote: Enumerating objects: 104, done.
remote: Counting objects: 100% (76/76), done.
remote: Total 104 (delta 76), reused 76 (delta 76), pack-reused 28
Receiving objects: 100% (104/104), 65.19 KiB | 10.86 MiB/s, done.
Resolving deltas: 100% (82/82), completed with 56 local objects.
From https://github.com/Homebrew/brew
 * [new branch]          dependabot/bundler/Library/Homebrew/rubocop-1.38.0 -> origin/dependabot/bundler/Library/Homebrew/rubocop-1.38.0
 * [new branch]          dependabot/bundler/Library/Homebrew/rubocop-ast-1.24.0 -> origin/dependabot/bundler/Library/Homebrew/rubocop-ast-1.24.0
 * [new branch]          less-agressive-core-tap -> origin/less-agressive-core-tap

==> Resetting /opt/homebrew...
branch 'master' set up to track 'origin/master'.
Switched to and reset branch 'master'
Your branch is up to date with 'origin/master'.

==> Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-cask...

==> Resetting /opt/homebrew/Library/Taps/homebrew/homebrew-cask...
branch 'master' set up to track 'origin/master'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.

==> Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-core... Very slow at this step >5 mins
remote: Enumerating objects: 25621, done.
remote: Counting objects: 100% (11790/11790), done.
remote: Compressing objects: 100% (229/229), done.
remote: Total 25621 (delta 11572), reused 11773 (delta 11561), pack-reused 13831
Receiving objects: 100% (25621/25621), 10.92 MiB | 28.75 MiB/s, done.
Resolving deltas: 100% (19071/19071), completed with 4173 local objects.
From https://github.com/Homebrew/homebrew-core
   82d49a08630..f0312b42414  master       -> origin/master
 * [new branch]              ubuntu-18.04 -> origin/ubuntu-18.04

==> Resetting /opt/homebrew/Library/Taps/homebrew/homebrew-core...
branch 'master' set up to track 'origin/master'.
Reset branch 'master'

Running brew update-reset before brew update fixed this for me.

For issues with initial installs, refer to https://github.com/orgs/Homebrew/discussions/666. Initial install does take several minutes and we’re aware some networking setups (ISPs, proxies, etc.) have issues with git fetches that take that length of time (e.g. Virgin Media).

This issue is mostly about brew update being suddenly being slow on existing previously-working installs (where it should take a few seconds), which is an issue I’ve seen less today so it might be fixed.

Running into this issue as well on an initial fresh install, with no indication of how to fix.

brew update-reset does not finish successfully either:

$ brew update-reset
==> Fetching /home/linuxbrew/.linuxbrew/Homebrew...

==> Resetting /home/linuxbrew/.linuxbrew/Homebrew...
branch 'master' set up to track 'origin/master'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.

==> Fetching /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core...
remote: Enumerating objects: 1361745, done.
remote: Counting objects: 100% (848/848), done.
remote: Compressing objects: 100% (443/443), done.
error: RPC failed; curl 56 OpenSSL SSL_read: Connection reset by peer, errno 104
error: 8179 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
error: Not a valid ref: refs/remotes/origin/master

==> Resetting /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core...
fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
fatal: 'origin/HEAD' is not a commit and a branch '' cannot be created from it

Connection speeds seem fine:

==> Fetching /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core...
remote: Enumerating objects: 1361745, done.
remote: Counting objects: 100% (848/848), done.
remote: Compressing objects: 100% (442/442), done.
Receiving objects:   5% (72193/1361745), 59.38 MiB | 986.00 KiB/s 

…it just always fails.

Same issue here, but brew update-reset is hanging on homebrew-core for me too…

HOMEBREW_VERSION: 3.6.13-2-gcb355a2
ORIGIN: https://github.com/Homebrew/brew
HEAD: cb355a23a0d4456a26eed6ddc42ddb2509c1df14
Last commit: 2 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: b53da006764f44876fcf8907a1f4e77ded60a8d9
Core tap last commit: 13 days ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.38.1 => /opt/homebrew/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.6-arm64
CLT: 14.0.0.0.1.1661618636
Xcode: N/A
Rosetta 2: false