Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No Cask with this name exists." after running resolution for "Token in Header Line" Error #58352

Closed
7 tasks done
SplashDance opened this issue Feb 3, 2019 · 5 comments
Closed
7 tasks done
Labels

Comments

@SplashDance
Copy link

General troubleshooting steps

Description of issue

At first I started seeing this error:

Error: Cask 'betterzipql' definition is invalid: Token '{:v1=>"betterzipql"}' in header line does not match the file name.

I ran brew cask reinstall betterzipql and then after that started seeing the same error but with "qlimagesize" in place of "betterzipql". I then searched the open & closed issues came across this closed issue and followed the suggested resolution (i.e. I ran the code listed at the end).

However, now I'm receiving this error (almost) every time I try to run a brew cask command (e.g. brew cask list):

Error: Cask 'qlimagesize' is unavailable: No Cask with this name exists.

I'm fine with deleting packages that are outdated or no longer maintained but now I can't even list what those packages could be.

Command that failed

brew cask list

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

Error: ambiguous option: -v
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Homebrew/Library/Homebrew/cask/cmd/options.rb:63:in `process_arguments'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:41:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `new'
/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:105:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:166:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:166: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:105:in `<main>'

Output of brew cask doctor

==> Homebrew Version
>=1.7.1 (shallow or no git repository)
==> macOS
10.14.2
==> SIP
Enabled
==> Java
11.0.2
==> 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 (4107 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-macho-2.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rubocop-0.63.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/unicode-display_width-1.4.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-progressbar-1.10.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rainbow-3.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/powerpack-0.1.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/plist-3.5.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/parser-2.6.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/parallel-1.13.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/mechanize-2.7.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/webrobots-0.1.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ntlm-http-0.1.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/nokogiri-1.10.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/extensions/universal-darwin-18/2.3.0/nokogiri-1.10.1
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/mini_portile2-2.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/net-http-persistent-3.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/net-http-digest_auth-1.4.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/mime-types-3.2.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/mime-types-data-3.2018.0812/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/jaro_winkler-1.5.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/extensions/universal-darwin-18/2.3.0/jaro_winkler-1.5.2
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/http-cookie-1.0.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/domain_name-0.5.20180417/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/unf-0.1.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/unf_ext-0.0.7.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/extensions/universal-darwin-18/2.3.0/unf_ext-0.0.7.5
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/connection_pool-2.2.2/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/ast-2.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/activesupport-5.2.2/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.5.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/concurrent-ruby-1.1.4/lib
/Library/Ruby/Gems/2.3.0/gems/did_you_mean-1.0.0/lib
/Library/Ruby/Site/2.3.0
/Library/Ruby/Site/2.3.0/x86_64-darwin18
/Library/Ruby/Site/2.3.0/universal-darwin18
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/universal-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/x86_64-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18
/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/bash"

Output of brew tap

coin-or-tools/coinor
dpo/openblas
homebrew/boneyard
homebrew/cask
homebrew/completions
homebrew/core
homebrew/games
homebrew/versions
homebrew/x11
@oori
Copy link

oori commented Feb 5, 2019

Same here.
I'm not sure if related, but I ran: brew update successfully and got Auto packing the repository in background for optimum performance., after which, I directly ran brew cask outdated and got the error @SplashDance reported: Error: Cask 'qlimagesize' definition is invalid: Token '{:v1=>"qlimagesize"}' in header line does not match the file name.

@SplashDance
Copy link
Author

Ultimately, I ended up becoming so frustrated that I removed the qlimagesize directory entirely, and since then have not had any problems.

I guess right now I'm just trying to figure out why the code mentioned in the previous post didn't work for me (shown in its entirety below); whether there was a better way to fix my issue than merely a forced removal (i.e. using homebrew); and if there was anything wrong with my approach (or anything I should be mindful of going forward).

# Remove all Caskroom/package/.metadata/version/timestamp directories that contain old style casks:
$ grep "cask :v1 =>" --files-with-match /usr/local/Caskroom/*/.metadata/*/*/Casks/*.rb | xargs -n1 dirname | xargs -n1 dirname | xargs rm -r

# Remove all Caskroom/package/.metadata/version directories that no longer have any children:
$ find /usr/local/Caskroom/*/.metadata -mindepth 1 -maxdepth 1 -type d -empty -delete

# Remove all Caskroom/package/version directories that no longer have a corresponding metadata directory:
for f in /usr/local/Caskroom/*/* ; do
  package="$(basename "$(dirname "${f}")")"
  version="$(basename "${f}")"
  test -e "/usr/local/Caskroom/${package}/.metadata/${version}" || rm -rf "/usr/local/Caskroom/${package}/${version}"
done

@vitorgalvao
Copy link
Member

Use @SplashDance’s solution.

The qlimagesize cask had to be removed because the maintainer no longer provides compiled packages. It’s a shame to see that cask go, but we have no choice.

Presumably the error is due to an old installed version. We should handle this better in the future.

@oori
Copy link

oori commented Feb 6, 2019

yeah, plain old rm -rf /usr/local/Caskroom/qlimagesize does magic ;)

@rickyngan
Copy link

I ran rm -rf /usr/local/Caskroom/betterzipql in order to get rid of the error

@lock lock bot added the outdated label Mar 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants