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 errors out with googlechrome.dmg was not quarantined properly #52128

Closed alexbigkid closed 6 years ago

alexbigkid commented 6 years ago

General troubleshooting steps

Description of issue

cannot install google-chrome

Command that failed

brew cask install google-chrome

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

==> Cask::Installer#install
==> Printing caveats
==> Cask::Installer#fetch
==> Satisfying dependencies
==> Downloading
==> Downloading https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
Already downloaded: /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
==> Checking quarantine support
/usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift
==> Quarantine is available.
==> Verifying Gatekeeper status of /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
/usr/bin/xattr -p com.apple.quarantine /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
==> /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg is not quarantined
==> Quarantining /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
/usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift /Users/abk/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/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
==> Verifying SHA-256 checksum for Cask 'google-chrome'.
==> Installing Cask google-chrome
==> Cask::Installer#stage
hdiutil imageinfo /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
==> Extracting primary container
==> Using container class UnpackStrategy::Dmg for /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
hdiutil attach -plist -nobrowse -readonly -noidme -mountrandom /var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/d20180918-17591-1ojzgly /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
find . -print0
mkbom -s -i /var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/20180918-17591-1dc1fur.list -- /var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/20180918-17591-23o4tm.bom
ditto --bom /var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/20180918-17591-23o4tm.bom -- /private/var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/d20180918-17591-1ojzgly/dmg.GpcrPQ /var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/d20180918-17591-129tris
diskutil eject /private/var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/d20180918-17591-1ojzgly/dmg.GpcrPQ
cp -pR /var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/d20180918-17591-129tris/.keychain_reauthorize/. /usr/local/Caskroom/google-chrome/69.0.3497.100/.keychain_reauthorize
cp -pR /var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/d20180918-17591-129tris/.keystone_install /usr/local/Caskroom/google-chrome/69.0.3497.100/.keystone_install
cp -pR /var/folders/ft/99qk4_9s0mb2pnhgbdt44_5c0000gn/T/d20180918-17591-129tris/Google\ Chrome.app/. /usr/local/Caskroom/google-chrome/69.0.3497.100/Google\ Chrome.app
==> Verifying Gatekeeper status of /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
/usr/bin/xattr -p com.apple.quarantine /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg
==> /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg is not quarantined
==> Purging files for version 69.0.3497.100 of Cask google-chrome
Error: /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg was not quarantined properly.
/usr/local/Homebrew/Library/Homebrew/cask/quarantine.rb:123:in `propagate'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:190:in `extract_primary_container'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:73:in `stage'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:95:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:21:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:14:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:14:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:143:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'

Output of brew cask doctor

==> Homebrew Version
1.7.5-5-gccb08f1
==> macOS
10.13.6
==> SIP
Enabled
==> Java
1.8.0_131
==> 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 (4041 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-macho-2.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/plist-3.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/backports-3.11.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/activesupport-5.2.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/tzinfo-1.2.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/thread_safe-0.3.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/minitest-5.11.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/i18n-1.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/universal-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/universal-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/universal-darwin9.0
/usr/local/Homebrew/Library/Homebrew
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Homebrew/Library/Homebrew/shims/scm"
SHELL="/bin/bash"

Output of brew tap

buo/cask-upgrade
homebrew/cask
homebrew/core
homebrew/services
danielbayley commented 6 years ago

This happens on a lot of casks I try to install now (seems to be on all casks with .dmg disk images)… I first noticed it when I tried to install github[-desktop], adding a HOMEBREW_CASK_OPTS=--no-quarantine environment variable seemed to fix it for a while, but now even that is failing when a depends_on cask: is used that relies on a .dmg.

amyspark commented 6 years ago

@alexbigkid : your log tells me that the quarantine attribute somehow disappears between the download and staging steps. As there are no errors logged, and brew cask doctor clearly states that your system can run Swift, I'd need to see what the script itself prints to console.

Please open a terminal, and run the script manually:

/usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift /Users/abk/Library/Caches/Homebrew/downloads/9830ac8a5256756d2643fbdb6a47ba0eb019c3816fc4366049f2483999b2ee4f--googlechrome.dmg https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg https://www.google.com/chrome/

Immediately after this,

echo $?

should return 0. If not, please copy the return code and any console output here.

@danielbayley: if your brew cask doctor is similar to the OP's, please paste the full log of brew cask install --debug here.

Thanks in advance to both of you!

melMass commented 6 years ago

Exactly the same error here

brew cask reinstall --debug astro

command output ```ruby brew cask reinstall --debug astro ==> Cask::Installer#reinstall ==> Cask::Installer#install ==> Printing caveats ==> Cask::Installer#fetch ==> Satisfying dependencies ==> Downloading ==> Downloading https://pexlabs-updates-xvuif5mcicazzducz2j2xy3lki.s3-us-west-2.amazonaws Already downloaded: /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg ==> Checking quarantine support /usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift ==> Quarantine is available. ==> Verifying Gatekeeper status of /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg /usr/bin/xattr -p com.apple.quarantine /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg ==> /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg is not quarantined ==> Quarantining /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg /usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg https://pexlabs-updates-xvuif5mcicazzducz2j2xy3lki.s3-us-wes t-2.amazonaws.com/Astro-4135.dmg https://www.helloastro.com/ ==> Downloaded to -> /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg ==> Verifying SHA-256 checksum for Cask 'astro'. ==> Uninstalling Cask astro ==> Un-installing artifacts ==> 3 artifact/s defined # ==> Un-installing artifact of class Cask::Artifact::Uninstall ==> Running uninstall process for astro; your password may be necessary ==> Removing launchctl service com.pexlabs.Huskymail.mac.helper /bin/launchctl list com.pexlabs.Huskymail.mac.helper /bin/launchctl remove com.pexlabs.Huskymail.mac.helper /usr/bin/sudo -E -- /bin/launchctl list com.pexlabs.Huskymail.mac.helper ==> Quitting application ID com.pexlabs.Huskymail.mac /bin/launchctl list /usr/bin/sudo -E -- /usr/bin/osascript -e tell\ application\ id\ \"com.pexlabs.Huskymail.mac\"\ to\ quit /bin/launchctl list /bin/launchctl list /bin/launchctl list ==> Un-installing artifact of class Cask::Artifact::App ==> Backing App 'Astro.app' up to '/usr/local/Caskroom/astro/3.0.15,4135/Astro.app'. /bin/cp -pR /Applications/Astro.app /usr/local/Caskroom/astro/3.0.15,4135/Astro.app ==> Removing App '/Applications/Astro.app'. ==> Purging files for version 3.0.15,4135 of Cask astro ==> Purging all staged versions of Cask astro ==> Installing Cask astro ==> Cask::Installer#stage hdiutil imageinfo /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg ==> Extracting primary container ==> Using container class UnpackStrategy::Dmg for /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg hdiutil attach -plist -nobrowse -readonly -noidme -mountrandom /var/folders/z9/h5x_crxx3j3_6nry8w2jcwbh0000gn/T/d20180926-24399-1cp6at7 /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg find . -print0 mkbom -s -i /var/folders/z9/h5x_crxx3j3_6nry8w2jcwbh0000gn/T/20180926-24399-1acc3vg.list -- /var/folders/z9/h5x_crxx3j3_6nry8w2jcwbh0000gn/T/20180926-24399-1dsdjpg.bom ditto --bom /var/folders/z9/h5x_crxx3j3_6nry8w2jcwbh0000gn/T/20180926-24399-1dsdjpg.bom -- /private/var/folders/z9/h5x_crxx3j3_6nry8w2jcwbh0000gn/T/d20180926-24399-1cp6at7/dmg.MXZyg4 /var/folders/z9/h5x_crxx3j3_6nry8w2jcwbh0000gn/T/d20180926-24399-47dzd7 diskutil eject /private/var/folders/z9/h5x_crxx3j3_6nry8w2jcwbh0000gn/T/d20180926-24399-1cp6at7/dmg.MXZyg4 cp -pR /var/folders/z9/h5x_crxx3j3_6nry8w2jcwbh0000gn/T/d20180926-24399-47dzd7/Astro.app/. /usr/local/Caskroom/astro/3.0.15,4135/Astro.app ==> Verifying Gatekeeper status of /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg /usr/bin/xattr -p com.apple.quarantine /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg ==> /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg is not quarantined ==> Purging files for version 3.0.15,4135 of Cask astro Error: /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg was not quarantined properly. /usr/local/Homebrew/Library/Homebrew/cask/quarantine.rb:123:in `propagate' /usr/local/Homebrew/Library/Homebrew/cask/installer.rb:190:in `extract_primary_container' /usr/local/Homebrew/Library/Homebrew/cask/installer.rb:73:in `stage' /usr/local/Homebrew/Library/Homebrew/cask/installer.rb:95:in `install' /usr/local/Homebrew/Library/Homebrew/cask/installer.rb:124:in `reinstall' /usr/local/Homebrew/Library/Homebrew/cask/cmd/reinstall.rb:11:in `block in run' /usr/local/Homebrew/Library/Homebrew/cask/cmd/reinstall.rb:5:in `each' /usr/local/Homebrew/Library/Homebrew/cask/cmd/reinstall.rb:5:in `run' /usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `run' /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in `run_command' /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `run' /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run' /usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask' /usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `
' Error: Kernel.exit /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in `exit' /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in `rescue in run' /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:143:in `run' /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run' /usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask' /usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `
' ```
brew cask doctor output ```ruby ==> Homebrew Version 1.7.6-20-gbb177b3==> macOS 10.12.6==> SIP Enabled==> Java 10.0.2, 1.8.0_144, 1.6.0_65-b14-468 ==> Gatekeeper supportEnabled ==> Homebrew Cask Install Location ==> Homebrew Cask Staging Location /usr/local/Caskroom ==> Homebrew Cask Taps: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (4035 casks) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (152 casks) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (200 casks) ==> Contents of $LOAD_PATH /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-macho-2.0.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/plist-3.4.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/ /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/backports-3.11.4/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/activesupport-5.2.1/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/tzinfo-1.2.5/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/thread_safe-0.3.6/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/minitest-5.11.3/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/i18n-1.1.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/x86_64-darwin9.0 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/universal-darwin9.0 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin9.0 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/universal-darwin9.0 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/x86_64-darwin9.0 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/universal-darwin9.0 /usr/local/Homebrew/Library/Homebrew ==> Environment Variables LC_ALL="en_US.UTF-8" PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Homebrew/Library/Homebrew/shims/scm" SHELL="/bin/zsh" ```
amyspark commented 6 years ago

So far I cannot reproduce this on Sierra.

@melmass, can you run this line in a Terminal and paste both the output and exit code?

/usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg https://pexlabs-updates-xvuif5mcicazzducz2j2xy3lki.s3-us-west-2.amazonaws.com/Astro-4135.dmg https://www.helloastro.com/

EDIT: and this line too?

/usr/bin/xattr -p com.apple.quarantine /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg
melMass commented 6 years ago

The swift one returns:

The xattr:

Traceback (most recent call last):
  File "/usr/bin/xattr-2.7", line 7, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
melMass commented 6 years ago

Well this helped me. Seems like a frequent error on OSX.

All information below assume you are working at system level python (/System/Library/Frameworks/Python.framework)

Here is what I have done:

sudo find /System -iname "*pkg_resources*"

It returned:

/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.pyc
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources

I did not knew OSX had multiple python version:

python --version
Python 2.6.9

To switch to the right python version:

defaults write com.apple.versioner.python Version 2.7
python --version 
Python 2.7.10

Running your xattr command again:

/usr/bin/xattr -p com.apple.quarantine /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg

returned 0081;5bab6775;Homebrew\x20Cask;8D3DC7AA-5377-4C40-B54C-39582CF268A1

BUT...

brew cask reinstall astro                                                           
==> Satisfying dependencies
==> Downloading https://pexlabs-updates-xvuif5mcicazzducz2j2xy3lki.s3-us-west-2.amazonaws.com/Astro-4135.dmg
Already downloaded: /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg
==> Verifying SHA-256 checksum for Cask 'astro'.
==> Installing Cask astro
==> Purging files for version 3.0.15,4135 of Cask astro
Error: /Users/imac/Library/Caches/Homebrew/downloads/90b87ef304c429d25069fecfb2f01425d03a0b66dfe2041520b1144e19557039--Astro-4135.dmg was not quarantined properly.
danielbayley commented 6 years ago

@amyspark Sorry, I have been busy! google-chrome cask actually just installed fine (with HOMEBREW_CASK_OPTS=--no-quarantine set in my .zshenv), but I am getting a lot of xattr errors with other casks…

vitorgalvao commented 6 years ago

@danielbayley Installs that use --no-quarantine don’t help, because they don’t narrow the problem.

melMass commented 6 years ago

@amyspark @danielbayley I can actually install any cask using no-quarantine forgot to mention. But disabling gatekeeper screws a lot of apps because they are being run in App Translocation a macOS security mechanism for apps that are not properly installed.

amyspark commented 6 years ago

@melMass I've already fixed the translocation bug, but we haven't cut a stable version with the fix yet and it was released in 1.7.5. About the Python bug - I'll add another integrity check to verify we have a working version of xattr before quarantining.

melMass commented 6 years ago

Not sure what you mean but I'm still not able to install casks after brew update

amyspark commented 6 years ago

@melMass We've already fixed the translocation bug in Homebrew/brew#4852; as for your xattr issue, Homebrew/brew#4990 disables quarantining if xattr doesn't work properly.

If you're still getting lease post an updated brew cask doctor and the stacktrace you get.

amyspark commented 6 years ago

Argh, I've deleted the branch without merging. I'll reopen.

melMass commented 6 years ago

I have done just that on another repo 🤒 ... 😃