Homebrew / homebrew-cask

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

Three brew cask commands didn't work for me #37052

Closed ghost closed 7 years ago

ghost commented 7 years ago

General troubleshooting steps

Description of issue

Some of the brew cask commands didn't work as they should. I just switched to a new laptop, so I ran a lot of them. Here's 3 that didn't work like they used to.

Output of your command with --verbose --debug

  1. FileBot completes, but it doesn't copy to the application folder. I went into its build location to do it manually and I discovered that the app is broken. Reran with reinstall. Same problem. screen shot 2017-07-26 at 2 25 08 pm
➜  ~ brew cask reinstall filebot --verbose --debug
==> Hbc::Installer#reinstall
==> Hbc::Installer#install
==> Printing caveats
==> Caveats
filebot requires Java 8. You can install the latest version with

  brew cask install java

==> Hbc::Installer#fetch
==> Satisfying dependencies
==> Downloading
==> Downloading https://downloads.sourceforge.net/filebot/filebot/FileBot_4.7.9/FileBot_4.7.9-darwin.tar.xz
Already downloaded: /Users/Barry/Library/Caches/Homebrew/Cask/filebot--4.7.9.tar.xz
==> Downloaded to -> /Users/Barry/Library/Caches/Homebrew/Cask/filebot--4.7.9.tar.xz
==> Verifying download
==> Determining which verifications to run for Cask filebot
==> Checking for verification class Hbc::Verify::Checksum
==> 1 verifications defined
Hbc::Verify::Checksum
==> Running verification of class Hbc::Verify::Checksum
==> Verifying checksum for Cask filebot
==> SHA256 checksums match
==> Uninstalling Cask filebot
==> Un-installing artifacts
==> Determining which artifacts are present in Cask filebot
==> 2 artifact/s defined
#<Hbc::Artifact::Binary:0x007fa80f0af668>
#<Hbc::Artifact::Zap:0x007fa80f0af5f0>
==> Un-installing artifact of class Hbc::Artifact::Binary
==> Unlinking Binary '/usr/local/bin/filebot'.
==> Purging files for version 4.7.9 of Cask filebot
==> Purging all staged versions of Cask filebot
==> Installing Cask filebot
==> Hbc::Installer#stage
==> Extracting primary container
==> Determining which containers to use based on filetype
==> Checking container class Hbc::Container::Pkg
==> Checking container class Hbc::Container::Ttf
==> Checking container class Hbc::Container::Otf
==> Checking container class Hbc::Container::Air
==> Checking container class Hbc::Container::Cab
==> Checking container class Hbc::Container::Dmg
==> Executing: ["/usr/bin/hdiutil", "imageinfo", "/Users/Barry/Library/Caches/Homebrew/Cask/filebot--4.7.9.tar.xz"]
==> Checking container class Hbc::Container::SevenZip
==> Checking container class Hbc::Container::Sit
==> Checking container class Hbc::Container::Rar
==> Checking container class Hbc::Container::Zip
==> Checking container class Hbc::Container::Xar
==> Checking container class Hbc::Container::Tar
==> Using container class Hbc::Container::Tar for /Users/Barry/Library/Caches/Homebrew/Cask/filebot--4.7.9.tar.xz
==> Executing: ["/usr/bin/tar", "-x", "-f", "/Users/Barry/Library/Caches/Homebrew/Cask/filebot--4.7.9.tar.xz", "-C", "/var/folders/30/mf22kbd103j8zz4lh855xnw00000gn/T/d20170726-17237-1a3c4zv"]
==> Executing: ["/usr/bin/ditto", "--", "/var/folders/30/mf22kbd103j8zz4lh855xnw00000gn/T/d20170726-17237-1a3c4zv", "/usr/local/Caskroom/filebot/4.7.9"]
==> Creating metadata directory /usr/local/Caskroom/filebot/.metadata/4.7.9/20170726193051.136.
==> Creating metadata subdirectory /usr/local/Caskroom/filebot/.metadata/4.7.9/20170726193051.136/Casks.
==> Installing artifacts
==> Determining which artifacts are present in Cask filebot
==> 2 artifact/s defined
#<Hbc::Artifact::Binary:0x007fa80eaf0e20>
#<Hbc::Artifact::Zap:0x007fa80eaf0a38>
==> Installing artifact of class Hbc::Artifact::Binary
==> Linking Binary 'filebot.sh' to '/usr/local/bin/filebot'.
==> Executing: ["/bin/ln", "-h", "-f", "-s", "--", "/usr/local/Caskroom/filebot/4.7.9/FileBot.app/Contents/MacOS/filebot.sh", "/usr/local/bin/filebot"]
==> Adding com.apple.metadata:kMDItemAlternateNames metadata
==> Executing: ["/usr/bin/xattr", "-p", "com.apple.metadata:kMDItemAlternateNames", "/usr/local/Caskroom/filebot/4.7.9/FileBot.app/Contents/MacOS/filebot.sh"]
==> Existing metadata is: ''
==> Executing: ["/bin/chmod", "--", "u+rw", "/usr/local/Caskroom/filebot/4.7.9/FileBot.app/Contents/MacOS/filebot.sh", "/usr/local/Caskroom/filebot/4.7.9/FileBot.app/Contents/MacOS/filebot.sh"]
==> Executing: ["/usr/bin/xattr", "-w", "com.apple.metadata:kMDItemAlternateNames", "(\"filebot\")", "/usr/local/Caskroom/filebot/4.7.9/FileBot.app/Contents/MacOS/filebot.sh"]
  1. LackeyCCG: Error: Uh oh, could not figure out how to unpack
➜  ~ brew cask install lackeyccg --verbose --debug
==> Hbc::Installer#install
==> Printing caveats
==> Hbc::Installer#fetch
==> Satisfying dependencies
==> Downloading
==> Downloading http://www.lackeyccg.com/LackeyCCGMac.zip
==> Calling curl with args ["http://www.lackeyccg.com/LackeyCCGMac.zip", "-C", 0, "-o", #<Pathname:/Users/Barry/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip.incomplete>, "-A", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10) https://caskroom.github.io"]
/usr/bin/curl --remote-time --location --user-agent Homebrew/1.X.Y (Macintosh; Intel Mac OS X 10.12.6) curl/7.54.0 --fail http://www.lackeyccg.com/LackeyCCGMac.zip -C 0 -o /Users/Barry/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip.incomplete -A Mozilla/5.0 (Macintosh; Intel Mac OS X 10) https://caskroom.github.io
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   211  100   211    0     0   1766      0 --:--:-- --:--:-- --:--:--  1773
==> Downloaded to -> /Users/Barry/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip
==> Verifying download
==> Determining which verifications to run for Cask lackeyccg
==> Checking for verification class Hbc::Verify::Checksum
==> No checksum defined for Cask lackeyccg, skipping verification
==> 0 verifications defined
==> Installing Cask lackeyccg
==> Hbc::Installer#stage
==> Extracting primary container
==> Determining which containers to use based on filetype
==> Checking container class Hbc::Container::Pkg
==> Checking container class Hbc::Container::Ttf
==> Checking container class Hbc::Container::Otf
==> Checking container class Hbc::Container::Air
==> Checking container class Hbc::Container::Cab
==> Checking container class Hbc::Container::Dmg
==> Executing: ["/usr/bin/hdiutil", "imageinfo", "/Users/Barry/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip"]
==> Checking container class Hbc::Container::SevenZip
==> Checking container class Hbc::Container::Sit
==> Checking container class Hbc::Container::Rar
==> Checking container class Hbc::Container::Zip
==> Checking container class Hbc::Container::Xar
==> Checking container class Hbc::Container::Tar
==> Checking container class Hbc::Container::Bzip2
==> Checking container class Hbc::Container::Gzip
==> Checking container class Hbc::Container::Lzma
==> Checking container class Hbc::Container::Xz
==> Checking container class Hbc::Container::Gpg
==> Checking container class Hbc::Container::Executable
==> Purging files for version latest of Cask lackeyccg
Error: Uh oh, could not figure out how to unpack '/Users/Barry/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip'
Error: Install incomplete.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:13:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:35:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:98:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:168:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:132:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:173:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:173:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:156:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:132:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'
  1. Google Drive doesn't exist anymore. Maybe Google requested you remove this? Don't know.
➜  ~ brew cask install google-drive --verbose --debug
Error: Cask 'google-drive' is unavailable: No Cask with this name exists.
Error: Install incomplete.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:13:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:35:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:98:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:168:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:132:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:173:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:173:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:156:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:132:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'

Output of brew cask doctor

➜  ~ brew cask doctor
==> Homebrew-Cask Version
Homebrew-Cask >1.2.0 (no git repository)
caskroom/homebrew-cask (git revision f5ede0; last commit 2017-07-26)
==> Homebrew-Cask Install Location
<NONE>
==> Homebrew-Cask Staging Location
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads
~/Library/Caches/Homebrew/Cask (4 files, 114.0MB)
==> Homebrew-Cask Taps:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask (3667 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin16
/Library/Ruby/Site/2.0.0/universal-darwin16
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16
==> Environment Variables
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
PATH="~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local:/usr/local/sbin:/usr/local/git/bin:/usr/local/mysql/bin:/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle/cmd:/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/cmd:/usr/local/Homebrew/Library/Homebrew/shims/scm"
SHELL="/usr/local/bin/bash"
commitay commented 7 years ago
  1. filebot

    https://github.com/caskroom/homebrew-cask/blob/87f8a34c99676b9ac45c950c82410e50c4a5951e/Casks/filebot.rb#L12 The darwin package only includes the CLI tools. Launching the app bundle merely redirects to the Mac App Store.

  2. lackeyccg - Cannot reproduce error

    brew cask install lackeyccg --verbose --debug
    ==> Hbc::Installer#install
    ==> Printing caveats
    ==> Hbc::Installer#fetch
    ==> Satisfying dependencies
    ==> Downloading
    ==> Downloading http://www.lackeyccg.com/LackeyCCGMac.zip
    ==> Calling curl with args ["http://www.lackeyccg.com/LackeyCCGMac.zip", "-C", 0, "-o", #<Pathname:/Users/commitay/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip.incomplete>, "-A", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10) https://caskroom.github.io"]
    /usr/bin/curl --remote-time --location --user-agent Homebrew/1.2.5 (Macintosh; Intel Mac OS X 10.12.6) curl/7.54.0 --fail http://www.lackeyccg.com/LackeyCCGMac.zip -C 0 -o /Users/commitay/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip.incomplete -A Mozilla/5.0 (Macintosh; Intel Mac OS X 10) https://caskroom.github.io
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
    100 12.8M  100 12.8M    0     0   240k      0  0:00:54  0:00:54 --:--:--  343k
    ==> Downloaded to -> /Users/commitay/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip
    ==> Verifying download
    ==> Determining which verifications to run for Cask lackeyccg
    ==> Checking for verification class Hbc::Verify::Checksum
    ==> No checksum defined for Cask lackeyccg, skipping verification
    ==> 0 verifications defined
    ==> Installing Cask lackeyccg
    ==> Hbc::Installer#stage
    ==> Extracting primary container
    ==> Determining which containers to use based on filetype
    ==> Checking container class Hbc::Container::Pkg
    ==> Checking container class Hbc::Container::Ttf
    ==> Checking container class Hbc::Container::Otf
    ==> Checking container class Hbc::Container::Air
    ==> Checking container class Hbc::Container::Cab
    ==> Checking container class Hbc::Container::Dmg
    ==> Executing: ["/usr/bin/hdiutil", "imageinfo", "/Users/commitay/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip"]
    ==> Checking container class Hbc::Container::SevenZip
    ==> Checking container class Hbc::Container::Sit
    ==> Checking container class Hbc::Container::Rar
    ==> Checking container class Hbc::Container::Zip
    ==> Using container class Hbc::Container::Zip for /Users/commitay/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip
    ==> Executing: ["/usr/bin/ditto", "-x", "-k", "--", "/Users/commitay/Library/Caches/Homebrew/Cask/lackeyccg--latest.zip", "/var/folders/qx/b4jmmnrs6g5fbyncgncnmv_w0000gn/T/d20170727-2520-1sd6xbk"]
    ==> Creating metadata directory /usr/local/Caskroom/lackeyccg/.metadata/latest/20170726195143.056.
    ==> Creating metadata subdirectory /usr/local/Caskroom/lackeyccg/.metadata/latest/20170726195143.056/Casks.
    ==> Installing artifacts
    ==> Determining which artifacts are present in Cask lackeyccg
    ==> 1 artifact/s defined
    #<Hbc::Artifact::Suite:0x007f86f40f08e8>
    ==> Installing artifact of class Hbc::Artifact::Suite
    ==> Moving App Suite 'LackeyCCG' to '/Applications/LackeyCCG'.
    🍺  lackeyccg was successfully installed!
  3. google-drive has been replaced by google-backup-and-sync

reitermarkus commented 7 years ago

Cannot reproduce the one with lackeyccg either, have you tried brew cask cleanup and retried? The download may be corrupt.

ghost commented 7 years ago

@commitay thanks, looks like I missed the Google drive change. On a side note, sadly my custom domain doesn't work with their new app. Thanks for clarifying on the FileBot being CLI only. I should have realized that.

@reitermarkus I tried brew cask cleanup just now and reinstalled. No luck. I'm going to try a restart and see if that helps.

Edit: restart didn't help. Even though I already did this, I ran brew update and brew upgrade again just to make sure. Then brew cask cleanup again. Each time inbetween, I tried the install and it keeps doing the same error.

Tried following ideas from #513 and #619.

ghost commented 7 years ago

Update, I'm suspicious of this:

screen shot 2017-07-26 at 3 42 45 pm

The zip file isn't opening, because the file is essentially empty. The log doesn't indicate this though so that's weird. Now why would that be...

reitermarkus commented 7 years ago

Does downloading it manually work?

ghost commented 7 years ago

@reitermarkus yes, it does. http://www.lackeyccg.com/LackeyCCGMac.zip works no problem. So maybe it's a permissions issue in which case sorry to bother you.

Trial and error list:

reitermarkus commented 7 years ago

Did you already try the curl command stand-alone?

ghost commented 7 years ago

@reitermarkus Good call. For me, curling that link triggers a rejection.

➜  ~ curl http://www.lackeyccg.com/LackeyCCGMac.zip
<html><head><title>Request Rejected</title></head><body>The requested URL was rejected. If you think this is an error, please contact the webmaster.</body></html>

However, if I curl another site, it works fine. So it doesn't seem to be a problem with curl. This appears not to be a brew cask issue either, since it works for you no problem. I know I'm not blocked because I've switched IP addresses, plus there's no reason for me to be blocked anyway since I've rarely even used the app. x.x

I'm more curious than anything, now. I know I could just download the zip and be done with it, but I want to know why the problem is happening.

commitay commented 7 years ago

lackeyccg has user_agent: :fake, to test curl manually you will have set --user-agent.

ghost commented 7 years ago

Ah, thanks for pointing that out. Here's a couple different ones.

➜  ~ curl --user-agent "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5" http://www.lackeyccg.com/LackeyCCGMac.zip
<html><head><title>Request Rejected</title></head><body>The requested URL was rejected. If you think this is an error, please contact the webmaster. <br><br>Your support ID is: 13509873612046743391</body></htmlcurl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" ^C
➜  ~ curl --user-agent "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" http://www.lackeyccg.com/LackeyCCGMac.zip
<html><head><title>Request Rejected</title></head><body>The requested URL was rejected. If you think this is an error, please contact the webmaster. <br><br>Your support ID is: 13509873612045370314</body></html>
commitay commented 7 years ago

Both of those work for me.

ghost commented 7 years ago

Solved. This is entirely my fault. I had a .curlrc file that was messing it up. Specifically, this line: referer = ";auto"

Simply removing it fixed the problem. Thanks for the help, @commitay and @reitermarkus.