buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.44k stars 90 forks source link

brew update abnormal result: #<Hbc::SystemCommand::Result:0x0000000103409030> #100

Closed gnillor closed 6 years ago

gnillor commented 6 years ago

When I run the brew cu --all command, brew update will be automatically executed, but the result like the following seems abnormal:

➜  ~ brew cu --all
==> Options
Include auto-update (-a): true
Include latest (-f): false
==> Updating Homebrew
#<Hbc::SystemCommand::Result:0x0000000101f1c898>
==> Finding outdated apps
       Cask                Current                                    Latest                                     A/U    Result
...
yurikoles commented 6 years ago

Had you tried brew update-reset?

gnillor commented 6 years ago

Hi yurikoles, thanks for your response. After brew update-reset executed successfully, this problem can still arise.

jenhsun commented 6 years ago

@gnillor @yurikoles I can confirm the problem still arise. Mine is

gnillor commented 6 years ago

@jenhsun, yes, the result code 0x000000010132f738 is different every time.

ondrejfuhrer commented 6 years ago

Hey guys. And if you run regular brew update, does it have some more info?

Update: reproduced, MR waiting 🙂

jenhsun commented 6 years ago

@ondrejfuhrer nope, only brew cu create this strange return.

singularitti commented 6 years ago

@ondrejfuhrer Thanks for this commit, it fixes the issue for me.

jenhsun commented 6 years ago

@singularitti Thanks for the hint. and @ondrejfuhrer the commit fixes for me too.

Anyway, untap/tap can't update the code. We have to do it manually. Just go to /usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb and change the Line 20 from puts Hbc.brew_update to puts Hbc.brew_update.stdout

singularitti commented 6 years ago

Hope @buo could fix this issue officially soon.

giacgbj commented 6 years ago

I've already tried anything I found, resetting the repos too, but I still get:

ijhack:Homebrew jhack$ brew cu
==> Options
Include auto-update (-a): false
Include latest (-f): false
==> Updating Homebrew
#<Hbc::SystemCommand::Result:0x00000001042ae8b0>
==> Finding outdated apps
Error: private method `load' called for Hbc:Module
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:45:in `rescue in load_cask'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:42:in `load_cask'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:14:in `block in installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:11:in `map'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:11:in `installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:66:in `find_outdated_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:24:in `process'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:34:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/utils.rb:18:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:106:in `<main>'

It seems related to #43, but that should be fixed.

yurikoles commented 6 years ago

It was already addressed in #101.

giacgbj commented 6 years ago

@yurikoles I've already patched manually

/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb

with the same error.

ljakab commented 6 years ago

I just tried the manual patch of bcu.rb as suggested by @jenhsun, but the issue persists.

jenhsun commented 6 years ago

@giacgbj @ljakab remember to do brew update-reset, brew doctor or xcode-select --install or even reboot and make sure you don't have other problems arise.

ljakab commented 6 years ago

@jenhsun I did brew update-reset before posting. I tried brew doctor, xcode-select --install and rebooting based on your advice. While brew update works, brew cu doesn't.

jenhsun commented 6 years ago

@ljakab Although the thread is closed, I suggest you might need to try a different machine on your issue. Or, just forget this return result. Someday you, or we might figure there are some other problems exist.

gnillor commented 6 years ago

@ondrejfuhrer @buo, thanks a lot for the fix, after brew update, this abnormal output disappeared.

giacgbj commented 6 years ago

@jenhsun I've already tried anything and I want to point out it's not just a matter of output: the command brew cu simply doesn't work anymore.

ljakab commented 6 years ago

Here's the full output:

> brew cu
==> Options
Include auto-update (-a): false
Include latest (-f): false
==> Updating Homebrew
Already up-to-date.
==> Finding outdated apps
Error: private method `load' called for Hbc:Module
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:45:in `rescue in load_cask'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:42:in `load_cask'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:14:in `block in installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:11:in `map'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:11:in `installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:66:in `find_outdated_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:24:in `process'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:34:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/utils.rb:18:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:106:in `<main>'
ljakab commented 6 years ago

Here's the output from brew cask doctor in case it helps:

==> Homebrew-Cask Version
Homebrew-Cask 1.7.0-15-g493c20e
Homebrew/homebrew-cask (git revision 5a402; last commit 2018-07-18)
==> macOS
10.13.6
==> SIP
Enabled
==> Java
1.8.0_172, 1.7.0_80
==> Homebrew-Cask Install Location
<NONE>
==> Homebrew-Cask Staging Location
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads
~/Library/Caches/Homebrew/Cask
==> Homebrew-Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (3996 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew
/usr/local/Homebrew/Library/Homebrew/cask/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
==> 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"
jenhsun commented 6 years ago

@giacgbj Oops, I thought you have experience on code testing, sorry. You have to go to bcu.rb and delete <<< >>> == line and make it the same as commit, then it will pass. Or clean reinstall brew cu would be a better idea. I just have no clue on why you still got the #hbc result.

jenhsun commented 6 years ago

@ljakab Thank God you finally post your brew cask doctor. Please disable macOS's SIP cause your cask shows that you enable SIP, and try again.

How do I disable System Integrity Protection (SIP) AKA “rootless” on macOs [OS X]

jenhsun commented 6 years ago

@giacgbj And please disable SIP as the same as @ljakab

ondrejfuhrer commented 6 years ago

@giacgbj @ljakab I would say you have something "wrong" (unsupported, deleted) installed, that's why you have that message. If you run brew cask outdated (or maybe with --geedy argument) is there anything special?

Maybe even brew cask list so that we can take a look what can be problematic cask.

ljakab commented 6 years ago

@ondrejfuhrer none of those commands produce usable output:


> brew cask --greedy outdated
Error: undefined method `undent' for #<String:0x0000000102905260>
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Caskroom/qgis/.metadata/2.18.13-1/20171005160209.139/Casks/qgis.rb:20:in `block in load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:36:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:36:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:31:in `new'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:31:in `cask'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:67:in `cask'
/usr/local/Homebrew/Library/Homebrew/compat/hbc/cask_loader.rb:15:in `cask'
/usr/local/Caskroom/qgis/.metadata/2.18.13-1/20171005160209.139/Casks/qgis.rb:1:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:57:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:57:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:34:in `block in casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:28:in `map'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:28:in `casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/outdated.rb:13:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:47:in `casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/outdated.rb:13:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:33:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:93:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:157:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:122:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:100:in `<main>'```
ondrejfuhrer commented 6 years ago

@ljakab Well, it is "usable". This clearly states that the installed cask qgis is broken. That package was removed and is not maintained any more (https://github.com/Homebrew/homebrew-cask/pull/41883), so I would suggest to remove it and that should fix the issue (if there is not any other that is breaking it).

The "problem" here is, that that is not something we (meaning in this repo) can take care of or anyhow fix, if the brew cask ... commands are not working at all, that means the whole caskroom in your machine is broken for whatever reason.

ljakab commented 6 years ago

Sorry for missing the clue about qgis, after seeing a few stack traces, I just wrongly assumed they are the same.

I can't remove qgis with either brew cask uninstall qgis or brew cask zap qgis even when adding --force, I get the same stack trace as above. Should I just delete the /usr/local/Caskroom/qgis directory? Is there anything needed after that to keep a consistent state?

ondrejfuhrer commented 6 years ago

No worries 🙂 I think removing that directory (you can move it somewhere just in case something breaks) should delete it. There could be also some broken symlinks there, so check your /usr/local/bin if there is maybe something pointing there and remove it.

You can then also run brew cleanup just to clean things up. That should be it.

ljakab commented 6 years ago

All good now, thanks!

ondrejfuhrer commented 6 years ago

@ljakab Welcome 👍 🙂

giacgbj commented 6 years ago

@jenhsun I applied the patch properly since the beginning. The issue was extremely different. Thanks to @ondrejfuhrer :

ijhack:~ jhack$ brew cask outdated
Error: undefined method `undent' for #<String:0x00000001050571b0>
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Caskroom/java7/.metadata/1.7.0_80/20160630201700.477/Casks/java7.rb:63:in `block in load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:36:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:36:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:31:in `new'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:31:in `cask'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:67:in `cask'
/usr/local/Homebrew/Library/Homebrew/compat/hbc/cask_loader.rb:15:in `cask'
/usr/local/Caskroom/java7/.metadata/1.7.0_80/20160630201700.477/Casks/java7.rb:1:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:57:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:57:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:34:in `block in casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:28:in `map'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:28:in `casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/outdated.rb:13:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:47:in `casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/outdated.rb:13:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:33:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:93:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:157:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:122:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:87:in `<main>'

Solution:

ijhack:~ jhack$ rm -rf /usr/local/Caskroom/java7
jenhsun commented 6 years ago

@giacgbj I'm glad ondrejfuhrer's method works on you.

hsiktas commented 6 years ago

I had the same issue but for me it was the cdock cask. It seems to be fixed now.

yurikoles commented 6 years ago

Upstream issue: Homebrew/homebrew-cask#49716