Homebrew-cask: Bug report: "Error: Unknown command: cask" after #23852

Created on 20 Aug 2016  路  9Comments  路  Source: Homebrew/homebrew-cask

This issue seems to happen only after #23852 was merged. I did a git reset --hard to reset /usr/local/Library/Taps/caskroom/homebrew-cask to a commit just before the merge commit and everything worked well. However, if I reset it to the merge commit, it starts to have this error.

Description of issue

brew cask returns

Error: Unknown command: cask

The issue persists after trying all the commands in the "pre-bug-report":

$ brew update; brew cleanup; brew cask cleanup
Already up-to-date.
Removing: (...)
==> This operation has freed approximately 969.5M of disk space.
==> Removing cached downloads
(...)
==> This operation has freed approximately 401.9M of disk space.

$ brew uninstall --force brew-cask; brew update
Already up-to-date.

$ brew untap phinze/cask; brew untap caskroom/cask; brew update
Error: No available tap phinze/cask.
Untapping caskroom/cask... (3,781 files, 74.8M)
Untapped 0 formulae
Already up-to-date.

$ brew cask
==> Tapping caskroom/cask
Cloning into '/usr/local/Library/Taps/caskroom/homebrew-cask'...
remote: Counting objects: 3379, done.
remote: Compressing objects: 100% (3361/3361), done.
remote: Total 3379 (delta 37), reused 439 (delta 12), pack-reused 0
Receiving objects: 100% (3379/3379), 1.14 MiB | 812.00 KiB/s, done.
Resolving deltas: 100% (37/37), done.
Checking connectivity... done.
Tapped 0 formulae (3,386 files, 3.5M)
Error: Unknown command: cask

Output of brew cask <command> --verbose

Error: Unknown command: cask

Output of brew doctor

Your system is ready to brew.

Output of brew cask doctor

Error: Unknown command: cask

Most helpful comment

Aha, I found the bug, it was a brew issue.

@xinan, try the following cd $(brew --repo); git fetch; git reset --hard origin/master; brew update

@jawshooah https://github.com/Homebrew/brew/commit/1e76a207b5bfacebee0a7198318230446be8da47 wouldn't have shown up in tests because the tests were only run same day. Unfortunately, this makes for an absolutely terrible user experience, as the error is quite cryptic

All 9 comments

Also, I found that brew update doesn't rebase /usr/local/Library/Taps/caskroom/homebrew-cask to the latest master. My branch was 306 commits behind master even after brew update.

So brew cask was working. I didn't want to update the repo manually although it seems quite outdated.

However, I was trying to update the flux cask (#23933), the cask-repair script automatically pulls the repo and causes brew cask to break (which causes the script itself to break because it needs brew cask). So in the end I had to reset this repo to an old commit, and clone another copy of the repo elsewhere to submit the update.

This likely has more to do with brew being unable to find cask than anything inherent to cask itself. @MikeMcQuaid any idea what could be going on here?

Aha, I found the bug, it was a brew issue.

@xinan, try the following cd $(brew --repo); git fetch; git reset --hard origin/master; brew update

@jawshooah https://github.com/Homebrew/brew/commit/1e76a207b5bfacebee0a7198318230446be8da47 wouldn't have shown up in tests because the tests were only run same day. Unfortunately, this makes for an absolutely terrible user experience, as the error is quite cryptic

馃帀 It worked! So what's the problem here?

Ah, yup, it's right at the top of Homebrew's readme.

@xinan Homebrew error, it wasn't updating, even though it reported as being up to date. Making an FAQ right now; will close this issue after I push through the README change.

@xinan There was a bad commit that screwed up brew update for anyone who ran it during a particular time window a week or so ago.

I see! Thanks for the info! I should have checked homebrew page first. 馃槄

Seems that my crontask that updates brew every hour fired back at me. If I've been running it manually I would have noticed that it always says "Already up to date".

Updated Reporting Bugs section!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RJHsiao picture RJHsiao  路  3Comments

florianletsch picture florianletsch  路  3Comments

tycm picture tycm  路  3Comments

dentarg picture dentarg  路  3Comments

my2ter picture my2ter  路  4Comments