Closed johnmcdowell closed 4 months ago
I am experiencing this issue in an existing install. It has occurred a couple of times. I haven't been able to isolate the pattern yet.
I can repeat the error consistently with following:
brew developer on
brew update
git reset --hard 3d31594e39
brew developer off
brew update
Obviously this is just a test scenario, so I am not exactly sure what pattern is causing the issue for me in more normal usage.
brew update --debug
output with error attached:
brew_update_debug.txt
Issue also referenced in discussion - Error message "fatal: cannot force update the branch 'master' checked out at '/opt/homebrew'" when installing Homebrew #5113
Issue also referenced in discussion - Error message "fatal: cannot force update the branch 'master' checked out at '/opt/homebrew'" when installing Homebrew #5113
This other thread also refers to the error only directly after install on Apple Silicon macs, which is where I saw the issue also.
It's interesting that you also have seen it in a case not right after install-- maybe there are multiple ways to hit the state with the fatal error.
Perhaps it'd be helpful if someone doing a fresh install of homebrew on Apple Silicon ran their first brew update
with --debug
. (I'm hesitant to try to fully uninstall on my work machine with other packages installed.)
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Perform an initial brew update after .pkg installation on Apple Silicon without seeing a fatal error in the output
What happened (include all command output)?
Used GUI .pkg installer of latest homebrew from Releases -> Assets
Ran brew update:
What did you expect to happen?
Not see any fatal errors on first invocation of brew update
Step-by-step reproduction instructions (by running
brew
commands)Observe:
Note that brew update DOES fix the problem and subsequent brew updates do not have this fatal error.
However, it seems unacceptable that a clean install of brew via the .pkg should reproducibly produce a fatal error when clean installed. This is an ugly look for what should be considered a first class package manager. There is no way to submit an issue to homebrew-core with issues that only occur on the first brew update, but we should not require users to have to ignore errors marked fatal.
I think EITHER there should be code in brew update to handle whatever was handled without showing a fatal error OR the pkg installer should not install the state that brew update generates a fatal error. (I'm not sure which.)
I did not run these commands before running brew update, but perhaps it's useful or interesting that after the first brew update after install prints:
Then I see a different branch here: