Brew bundle reports `Upgrading X has failed!` after installing X
Source: Troubleshooting reference
Symptom: bootstrap.sh upgrade pours and links a formula successfully, then
reports Upgrading <formula> has failed!. Nearby errors name a vanished file in
~/.cache/Homebrew/downloads/, such as No such file or directory @ dir_s_rmdir - ...bottle_manifest.json. Several unrelated formulae can fail this
way in one run.
Root cause: Homebrew Bundle defaults to as many as four package workers. Those
workers launch separate brew install or brew upgrade processes that share
one download cache and run install cleanup against it. One worker can remove a
cache entry after another has inspected it, turning successful installs into
nonzero exits. Homebrew tracks the broader parallel-worker race as
Homebrew/brew#23328; the
Homebrew manpage documents the auto job
default and the sequential override.
Confirm after the original bootstrap process has exited:
formula=treebrew list --versions "$formula"brew outdated --formula "$formula"brew linkage --test "$formula"If the new version is listed, brew outdated prints nothing, and linkage
passes, the install succeeded and only its cleanup path failed.
Graphviz has a second version of this symptom. Netpbm fetches its source and
manual from Subversion. Bundle can queue those SVN fetches before it finishes
installing Graphviz’s Subversion dependency, record You must: brew install svn, then install Subversion, retry both checkouts, and successfully build
Netpbm and Graphviz. The early fetch result still makes Bundle print Upgrading graphviz has failed! after the successful install.
Fix: update the checkout and rerun bootstrap.sh upgrade. The shared
installer environment now disables Bundle package jobs; downloads and each
source build can still run concurrently, but package installs and cleanup are
serialized. On Linux it also installs a working Subversion before a Brewfile
containing Graphviz, then runs brew bundle check after any nonzero Bundle exit.
If that check passes, it retries Bundle once and reports recovery only when the
clean retry exits zero. Manual one-off:
brew bundle install --jobs=1 --file="$HOME/dotfiles/packages/Brewfile"Do not start the retry while the first bootstrap is still running.