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

cask microsoft-remote-desktop fails to update due to checksum error #80779

Closed SadRebel1000 closed 4 years ago

SadRebel1000 commented 4 years ago

General troubleshooting steps

Description of issue

There is a checksum error however checking the version with 'brew cask _stanza version'

10.4.0.1771,531

is the same as last available version at

https://install.appcenter.ms/orgs/rdmacios-k2vy/apps/microsoft-remote-desktop-for-mac/distribution_groups/all-users-of-microsoft-remote-desktop-for-mac

so I'm affraid I don't really know what is wrong and what I can do.

Command that failed

brew cask upgrade microsoft-remote-desktop-beta

or

brew cask install --force microsoft-remote-desktop-beta

or

brew cask uninstall microsoft-remote-desktop-beta
brew cask install microsoft-remote-desktop-beta

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

==> Cask::Installer#install
==> Printing caveats
==> Cask::Installer#fetch
==> Downloading
==> Downloading https://rink.hockeyapp.net/api/2/apps/5e0c144289a51fca2d3bfa39ce7f2b06/app_versions/531?format=zip
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.2.13\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.3\)\ curl/7.64.1 --retry 3 --location --silent --head --request GET https://rink.hockeyapp.net/api/2/apps/5e0c144289a51fca2d3bfa39ce7f2b06/app_versions/531\?format=zip
Already downloaded: /Users/tmsn/Library/Caches/Homebrew/downloads/bec1dfe8fd5ae95f9d2d1da63f6fbee127bb2d9df662b20b54e6d3ae5b807343--Microsoft Remote Desktop Beta.app.zip
==> 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/tmsn/Library/Caches/Homebrew/downloads/bec1dfe8fd5ae95f9d2d1da63f6fbee127bb2d9df662b20b54e6d3ae5b807343--Microsoft Remote Desktop Beta.app.zip
/usr/bin/xattr -p com.apple.quarantine /Users/tmsn/Library/Caches/Homebrew/downloads/bec1dfe8fd5ae95f9d2d1da63f6fbee127bb2d9df662b20b54e6d3ae5b807343--Microsoft\ Remote\ Desktop\ Beta.app.zip
==> /Users/tmsn/Library/Caches/Homebrew/downloads/bec1dfe8fd5ae95f9d2d1da63f6fbee127bb2d9df662b20b54e6d3ae5b807343--Microsoft Remote Desktop Beta.app.zip is quarantined
==> Downloaded to -> /Users/tmsn/Library/Caches/Homebrew/downloads/bec1dfe8fd5ae95f9d2d1da63f6fbee127bb2d9df662b20b54e6d3ae5b807343--Microsoft Remote Desktop Beta.app.zip
==> Verifying SHA-256 checksum for Cask 'microsoft-remote-desktop-beta'.
==> Note: Running `brew update` may fix SHA-256 checksum errors.
Error: Checksum for Cask 'microsoft-remote-desktop-beta' does not match.
Expected: 5a2f87ef909074a35364de138164273673d463228c9e104553c1e7eb44039606
  Actual: a2513a0b608822b145fe851b043bc4d9acab653bf5b66c7f0d781f0a42796747
    File: /Users/tmsn/Library/Caches/Homebrew/downloads/bec1dfe8fd5ae95f9d2d1da63f6fbee127bb2d9df662b20b54e6d3ae5b807343--Microsoft Remote Desktop Beta.app.zip
To retry an incomplete download, remove the file above.
If the issue persists, visit:
  https://github.com/Homebrew/homebrew-cask/blob/master/doc/reporting_bugs/checksum_does_not_match_error.md
/usr/local/Homebrew/Library/Homebrew/cask/verify.rb:23:in `all'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:165:in `verify'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:63:in `fetch'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:90:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:22:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:16:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:16:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:36:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:150:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:92:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:140:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:92:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `<main>'

Output of brew cask doctor

==> Homebrew Version
2.2.13
==> macOS
10.15.3
==> SIP
Enabled
==> Java
N/A
==> xattr issues
<NONE>
==> Gatekeeper support
Enabled
==> Homebrew Cask Install Location
<NONE>
==> Homebrew Cask Staging Location
/usr/local/Caskroom
==> Homebrew Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (3525 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (156 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (145 casks)
==> Contents of $LOAD_PATH
/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.38.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-performance-1.5.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rexml-3.2.4/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/mechanize-2.7.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/activesupport-6.0.2.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/zeitwerk-2.3.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.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby
/Library/Ruby/Site/2.6.0
/Library/Ruby/Site/2.6.0/universal-darwin19
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/universal-darwin19
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19
/usr/local/Homebrew/Library/Homebrew
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/local/Homebrew/Library/Homebrew/shims/scm:/usr/bin:/bin:/usr/sbin:/sbin"
SHELL="/bin/zsh"

Output of brew tap

homebrew/cask
homebrew/cask-drivers
homebrew/cask-versions
homebrew/core
miccal commented 4 years ago

On February 10th all remaining HockeyApp apps were moved to App Center (link), and the current download link for this Cask redirects to:

-bash-5.0.16- /Users/miccal (33) [> curl -sLI https://rink.hockeyapp.net/api/2/apps/5e0c144289a51fca2d3bfa39ce7f2b06/app_versions/531?format=zip
[SNIP]
Location: https://appcenter-filemanagement-distrib1ede6f06e.azureedge.net/af496428-61a4-4f3b-9966-f1e59bac43bf/Microsoft%20Remote%20Desktop%20Beta.app.zip?sv=2019-02-02&sr=c&sig=V%2BINIBf3H%2FBqZdootOb7S94VnSWWdpOSESdDKde8Jfo%3D&se=2020-04-17T14%3A45%3A33Z&sp=r
[SNIP]

The appcast for Microsoft Remote Desktop Beta.app now points to:

https://api.appcenter.ms/v0.1/public/sparkle/apps/5e0c1442-89a5-1fca-2d3b-fa39ce7f2b06

and the provided url linking to the latest version (which at the moment is Version 10.4.0 (1772)) seems to constantly change -- for example, refreshing three times yields:

https://appcenter-filemanagement-distrib1ede6f06e.azureedge.net/af496428-61a4-4f3b-9966-f1e59bac43bf/Microsoft%20Remote%20Desktop%20Beta.app.zip?sv=2019-02-02&sr=c&sig=1I6Lmr%2Bur349nldNqxlT9PSQRBxwgSM0OubG2vu3Ke0%3D&se=2020-04-17T15%3A40%3A37Z&sp=r
https://appcenter-filemanagement-distrib1ede6f06e.azureedge.net/af496428-61a4-4f3b-9966-f1e59bac43bf/Microsoft%20Remote%20Desktop%20Beta.app.zip?sv=2019-02-02&sr=c&sig=Tl6jcUxyWCZxYMwOSqoUexNlr5CoD4yUlAOzsnhihao%3D&se=2020-04-17T15%3A45%3A41Z&sp=r
https://appcenter-filemanagement-distrib1ede6f06e.azureedge.net/af496428-61a4-4f3b-9966-f1e59bac43bf/Microsoft%20Remote%20Desktop%20Beta.app.zip?sv=2019-02-02&sr=c&sig=auNLqs%2BAaY6AKg4ASM1PHszSHrEsaYm4U7vz4%2F01a1A%3D&se=2020-04-17T15%3A41%3A28Z&sp=r

Notice that the string after https://appcenter-filemanagement-distrib1ede6f06e.azureedge.net/af496428-61a4-4f3b-9966-f1e59bac43bf/Microsoft%20Remote%20Desktop%20Beta.app.zip changes each time.

No idea how to rectify this.

vitorgalvao commented 4 years ago

One more cask that we’ll need to remove due to those links.

SadRebel1000 commented 4 years ago

can you explain a little more why? It's not really a solution right?

vitorgalvao commented 4 years ago

can you explain a little more why?

@miccal did, above. The links keep changing, which means we can’t add them to the cask, because next time someone tries to download it, it breaks.

SadRebel1000 commented 4 years ago

Ok, didn't know this was general policy :) so the only solution would be to ask Microsoft what's up?

vitorgalvao commented 4 years ago

Ok, didn't know this was general policy :)

It’s not yet. We still have to open an issue on it.

so the only solution would be to ask Microsoft what's up?

It would be for them to provide links that not expire, yes.

frankli0324 commented 4 years ago

https://install.appcenter.ms/api/v0.1/apps/rdmacios-k2vy/microsoft-remote-desktop-for-mac/distribution_groups/all-users-of-microsoft-remote-desktop-for-mac/releases/444

"444" here counts the release, the latest release is the 444th release, which is listed in:

https://install.appcenter.ms/api/v0.1/apps/rdmacios-k2vy/microsoft-remote-desktop-for-mac/distribution_groups/all-users-of-microsoft-remote-desktop-for-mac/public_releases?scope=tester

miccal commented 4 years ago

@frankli0324 the problem is the url is unstable -- for example, refreshing your link https://install.appcenter.ms/api/v0.1/apps/rdmacios-k2vy/microsoft-remote-desktop-for-mac/distribution_groups/all-users-of-microsoft-remote-desktop-for-mac/releases/444 three times gives three different download_url's:

https://appcenter-filemanagement-distrib1ede6f06e.azureedge.net/feff42f3-3d9d-4b8c-8dc3-6a0848043a51/Microsoft%20Remote%20Desktop%20Beta.app.zip?sv=2019-02-02&sr=c&sig=z%2F4QVUVqUhUWpO33ugV1NtdsuCb6idsKCXPU%2F%2FLkzTg%3D&se=2020-04-18T03%3A41%3A14Z&sp=r
https://appcenter-filemanagement-distrib1ede6f06e.azureedge.net/feff42f3-3d9d-4b8c-8dc3-6a0848043a51/Microsoft%20Remote%20Desktop%20Beta.app.zip?sv=2019-02-02&sr=c&sig=%2BHE0ECHHNyFiCQuAgsqhdiCrctTbnb84chRR9hygEmw%3D&se=2020-04-18T03%3A44%3A02Z&sp=r
https://appcenter-filemanagement-distrib1ede6f06e.azureedge.net/feff42f3-3d9d-4b8c-8dc3-6a0848043a51/Microsoft%20Remote%20Desktop%20Beta.app.zip?sv=2019-02-02&sr=c&sig=%2F91XlByD6%2BPDb3b2DfM31Lai%2F3XLeYEscnVpwdH%2B7T4%3D&se=2020-04-18T04%3A39%3A44Z&sp=r
frankli0324 commented 4 years ago

can't that be solved with a submodule? something like url "#{Fetch.latest_url}"

miccal commented 4 years ago

@frankli0324 I am not sure if Homebrew-Cask has that functionality, but @vitorgalvao and/or @reitermarkus would know for certain.

frankli0324 commented 4 years ago

https://github.com/Homebrew/homebrew-cask/tree/master/doc/cask_language_reference#arbitrary-ruby-methods

frankli0324 commented 4 years ago

so? is the method which #arbitrary-ruby-methods described an option?

frankli0324 commented 4 years ago
module AppCenter
    def self.get
        require 'net/http'
        require 'json'
        url = URI('https://install.appcenter.ms/api/v0.1/apps'+
            '/rdmacios-k2vy/microsoft-remote-desktop-for-mac/distribution_groups/'+
            'all-users-of-microsoft-remote-desktop-for-mac/public_releases?scope=tester');
        id = JSON.parse(Net::HTTP.get(url))[0]['id'];
        url = URI('https://install.appcenter.ms/api/v0.1/apps'+
        '/rdmacios-k2vy/microsoft-remote-desktop-for-mac'+
        '/distribution_groups/all-users-of-microsoft-remote-desktop-for-mac'+
        '/releases/%d' % id)
        download_url = JSON.parse(Net::HTTP.get(url))['download_url'];
        return download_url
    end
end

update:

url do
    require 'net/http'
    require 'json'
    base = URI(
      'https://install.appcenter.ms/api/v0.1/apps' \
      '/rdmacios-k2vy/microsoft-remote-desktop-for-mac' \
      '/distribution_groups/all-users-of-microsoft-remote-desktop-for-mac' \
      '/releases/latest',
    )
    JSON.parse(Net::HTTP.get(base))['download_url']
end
frankli0324 commented 4 years ago

image seems usable

vitorgalvao commented 4 years ago

so? is the method which #arbitrary-ruby-methods described an option?

No, not really. That’s worse than url do. “Usable” isn’t the only metric; it has to be maintainable, and that’s not.

ahdbilal commented 4 years ago

@miccal for the app center, can you create an issue in our repo so that we can track it better. Thanks

miccal commented 4 years ago

@ahdbilal done.