Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.93k stars 10.71k forks source link

Brew cask install google-chrome failed #90593

Closed kiruthikaponnusamy0503 closed 4 years ago

kiruthikaponnusamy0503 commented 4 years ago

Description of issue

Brew cask chrome installation fails due to checksum mismatch. Latest Version of chrome on Google - 86.0.4240.75 Version Being installed from Brew after running the command brew cask _stanza version {{cask_name}} - 84.0.4147.105

Issue persists even after brew update command has been run.

Command that failed

brew cask install google-chrome

Output of command with --force --verbose --debug

+ brew cask install --force --verbose --[REDACTED] google-chrome
==> Cask::Installer#install
/usr/local/Homebrew/Library/Homebrew/shims/scm/git --version
==> Tapping homebrew/cask-versions
git clone https://github.com/Homebrew/homebrew-cask-versions /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions'...
Tapped 161 casks (208 files, 65.4MB).
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.5\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.14.6\)\ curl/7.54.0 --header Accept-Language:\ en --retry 3 --location https://api.github.com/repos/Homebrew/homebrew-cask-versions --header Accept:\ application/vnd.github.v3\+json --write-out '
'\%\{http_code\} --header Accept:\ application/vnd.github.antiope-preview\+json --dump-header /private/tmp/github_api_headers20201009-19873-ng8ygg
git config --replace-all homebrew.private false
==> Printing caveats
==> Cask::Installer#fetch
==> Downloading
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.5\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.14.6\)\ curl/7.54.0 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
==> Downloading https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.5\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.14.6\)\ curl/7.54.0 --header Accept-Language:\ en --retry 3 --location --range 0-1 --dump-header - --write-out \%\{http_code\} --output /dev/null https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.5\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.14.6\)\ curl/7.54.0 --header Accept-Language:\ en --fail --silent --retry 3 --location --remote-time --continue-at 0 --output /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg.incomplete https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
==> Checking quarantine support
/usr/bin/xattr
/usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift
==> Quarantine is available.
==> Verifying Gatekeeper status of /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
/usr/bin/xattr -p com.apple.quarantine /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
==> /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg is not quarantined
==> Quarantining /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
/usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg https://www.google.com/chrome/
==> Downloaded to -> /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
tar tf /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
hdiutil imageinfo -format /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
Error: Checksum for Cask 'google-chrome' does not match.
Expected: b37980c7d92b589c062f748465a317af460ac29a0adde8e881e8ecd0b09a69a7
  Actual: 3ab76266189a7b2c5b9f789fbae7f7d25404e7158ee3e841dc0692eae2718182
    File: /Users/vagrant/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
To retry an incomplete download, remove the file above.
If the issue persists, visit:
  https://github.com/Homebrew/homebrew-cask/blob/HEAD/doc/reporting_bugs/checksum_does_not_match_error.md
/usr/local/Homebrew/Library/Homebrew/cask/verify.rb:26:in `all'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:168:in `verify'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:68:in `fetch'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:93:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:73:in `block in install_casks'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:72:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:72:in `install_casks'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:37:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:95:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:186:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:14:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:119:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:191:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:191:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:168:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:14:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:119:in `<main>'
==> Verifying SHA-256 checksum for Cask 'google-chrome'.
==> Note: Running `brew update` may fix SHA-256 checksum errors.

Output of brew doctor --verbose

+ brew doctor --verbose
==> Cask Environment Variables:
BUNDLE_PATH
CHRUBY_VERSION
GEM_HOME
GEM_PATH
HOMEBREW_CASK_OPTS
LC_ALL
PATH
RBENV_VERSION
RUBYLIB
RUBYOPT
RUBYPATH
SHELL
==> $LOAD_PATHS
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/ruby-macho-2.2.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-rspec-1.43.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-performance-1.8.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/plist-3.5.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/patchelf-1.3.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/mechanize-2.7.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/elftools-1.1.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/bindata-2.4.8/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/activesupport-6.0.3.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/zeitwerk-2.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/tzinfo-1.2.7/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/thread_safe-0.3.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/i18n-1.8.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/concurrent-ruby-1.1.7/lib/concurrent-ruby
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/x86_64-darwin14
/usr/local/Homebrew/Library/Homebrew

Output of brew tap

==> Homebrew Version
2.5.5
==> macOS
10.14.6
==> SIP
Disabled
==> Java
11.0.8, 1.8.0_232
==> Homebrew Cask Staging Location
/usr/local/Caskroom
==> Homebrew Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (3672 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (161 casks)
/usr/local/Homebrew/Library/Taps/adoptopenjdk/homebrew-openjdk (43 casks)
/usr/local/Homebrew/Library/Taps/wix/homebrew-brew (1 cask)
Please note that these warnings are just used to help the Homebrew maintainers
with [REDACTED]ging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python
  node
miccal commented 4 years ago

google-chrome was updated in https://github.com/Homebrew/homebrew-cask/pull/90464.

Most likely the error you are seeing is due to a brew update failure because the issue reported in https://github.com/Homebrew/homebrew-core/issues/61772 has resurfaced.

Please try to run brew update again before installing google-chrome.

ayush-ridecell commented 4 years ago

@miccal Even after running brew update successfully, I'm still getting the SHA mismatch error for brew cask install google-chrome This has been happening ever since the google chrome's cask was updated to 86.0.4240.75

miccal commented 4 years ago

@ayush-ridecell the sha256 is definately correct:

|-> brew cask fetch google-chrome

==> Downloading external files for Cask google-chrome
==> Downloading https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'google-chrome'.
==> Success! Downloaded to -> /Users/miccal/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg

  Try running brew cleanup -s before running brew install google-chrome.

ayush-ridecell commented 4 years ago

@miccal I tried running brew update followed by brew cleanup -s followed by brew cask install google-chrome. And I'm still getting the same SHA mismatch error.

Expected: b37980c7d92b589c062f748465a317af460ac29a0adde8e881e8ecd0b09a69a7
     Actual: 3ab76266189a7b2c5b9f789fbae7f7d25404e7158ee3e841dc0692eae2718182
miccal commented 4 years ago

Try running rm -rf "$(brew --cache)" then brew install google-chrome. Note that you should now use brew install google-chrome, NOT brew cask install google-chrome.

ayush-ridecell commented 4 years ago

@miccal

I ran rm -rf "$(brew --cache)" followed by brew install google-chrome instead of brew cask install google-chrome but I'm still getting the SHA mismatch error.

ayush-ridecell commented 4 years ago

@miccal I ran brew cask _stanza version google-chrome and I'm getting version 85.0.4183.121 instead of 86.0.4240.75 Running brew update doesn't seem to fix this

miccal commented 4 years ago

That is very odd -- please run brew update-reset and then see if brew cask _stanza version google-chrome reports the newer version.

ayush-ridecell commented 4 years ago

@miccal I ran brew update-reset. Got this output

==> Resetting /usr/local/Homebrew...
Switched to and reset branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/adoptopenjdk/homebrew-openjdk...
==> Resetting /usr/local/Homebrew/Library/Taps/adoptopenjdk/homebrew-openjdk...
Reset branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
Reset branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
From https://github.com/Homebrew/homebrew-core
   e3440682e3..b0ac018839  master     -> origin/master
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Reset branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/thii/homebrew-xcbeautify...
==> Resetting /usr/local/Homebrew/Library/Taps/thii/homebrew-xcbeautify...
Reset branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/wix/homebrew-brew...
==> Resetting /usr/local/Homebrew/Library/Taps/wix/homebrew-brew...
Reset branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
Your branch is up to date with 'origin/master'.

But brew cask _stanza version google-chrome still gives me the previous google-chrome version: 85.0.4183.121

miccal commented 4 years ago

Ok, one last thing to try -- please run

brew uninstall --force google-chrome

then

rm -r "$(brew --prefix)/Caskroom/google-chrome"

then

brew install google-chrome
ayush-ridecell commented 4 years ago

@miccal I tried all the steps you've mentioned but still, the issue persists. brew cask _stanza version google-chrome still gives the outdated version 85.0.4183.121

miccal commented 4 years ago

Please run cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-cask then run git log and please post the output of the first commit shown.

ayush-ridecell commented 4 years ago

@miccal Ran those two and got this as the first commit: Please note that I'm running this on bitrise.

f7aacbdd4a9de9f1acc821e80a4377b69404871e
Author: Brian Morton <brianmortondesign@gmail.com>
Date:   Fri Jun 15 16:51:56 2018 -0700
    Update pdf-converter-master to use TLS/HTTPS (#48530)
miccal commented 4 years ago
Date:   Fri Jun 15 16:51:56 2018 -0700

There is the problem -- your Cask files are very out-of-date.

What is bitrise?

Please post the output of brew config.

ayush-ridecell commented 4 years ago

@miccal We use bitrise as our CI/CD tool and in order to deploy our iOS apps we need to do some automation using google-chrome I'm checking the brew config...

ayush-ridecell commented 4 years ago

@miccal brew config output:

HOMEBREW_VERSION: 2.5.4
ORIGIN: https://github.com/Homebrew/brew
HEAD: 588f5f1713cd095bbeddef1d7919132531941474
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d7a1f622adf10060812ff5ca456e59c81b139fc7
Core tap last commit: 5 days ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 2
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_AUTO_UPDATE: set
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: dual-core 64-bit ivybridge
Clang: 11.0 build 1100
Git: 2.28.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 11.0.8, 1.8.0_222
macOS: 10.14.6-x86_64
CLT: 10.3.0.0.1.1562985497
Xcode: 11.2.1
miccal commented 4 years ago
HOMEBREW_VERSION: 2.5.4

This is also out-of-date; brew is currently at version 2.5.6.

Since brew update reports that you are already up-to-date and brew update-reset did not work, I do not know what else to suggest. There is some issue with your installed Homebrew that is specific to your set-up.

ayush-ridecell commented 4 years ago

@miccal But brew cask install homebrew/cask-versions/google-chrome-beta works and brew install google-chrome fails because of SHA mismatch

miccal commented 4 years ago

I understand that, but there is something wrong with your Homebrew install such that your Casks are out-of-date.

This is specific to your set-up: google-chrome is a very popular Cask and we are not seeing this issue with other users, or myself for that matter:

|-> brew cask _stanza version google-chrome
86.0.4240.80
ayush-ridecell commented 4 years ago

@miccal Thank you so much for your help with this. I'll take this matter with the Bitrise team.

miccal commented 4 years ago

You are most welcome @ayush-ridecell, thank you.