Closed matkozak closed 6 years ago
Seems reasonable. We should either not ask for a password to install to /Applications
(which is what I thought we did), or ask for it on uninstall
if we see it’s necessary.
cc @reitermarkus
Looks like currently we're checking permissions on the source (/Caskroom
) instead of the target (appdir
) during the move_back
phase (target
-> source
) .
Tested with the same configuration as reported. https://github.com/Homebrew/brew/pull/3680
Is this issue fixed? I'm having the same exact error in 1.5.4...
Sentinel:~ admin$ brew cask upgrade coda --verbose --debug
==> Upgrading 1 outdated package, with result:
coda 2.6.9
==> Started upgrade process for Cask coda
==> Hbc::Installer#fetch
==> Satisfying dependencies
==> Downloading
==> Downloading https://download.panic.com/coda/Coda%202.6.9.zip
Already downloaded: /Users/admin/Library/Caches/Homebrew/Cask/coda--2.6.9.zip
==> Downloaded to -> /Users/admin/Library/Caches/Homebrew/Cask/coda--2.6.9.zip
==> Verifying download
==> Determining which verifications to run for Cask coda
==> Checking for verification class Hbc::Verify::Checksum
==> 1 verifications defined
Hbc::Verify::Checksum
==> Running verification of class Hbc::Verify::Checksum
==> Verifying checksum for Cask coda
==> SHA256 checksums match
==> Starting upgrade for Cask coda
==> Un-installing artifacts
==> 2 artifact/s defined
#<SortedSet:0x007f934d35c248>
==> Un-installing artifact of class Hbc::Artifact::App
==> Moving App 'Coda 2.app' back to '/usr/local/Caskroom/coda/2.6/Coda 2.app'.
Error: Permission denied @ rb_file_s_rename - (/Applications/Coda 2.app, /usr/local/Caskroom/coda/2.6/Coda 2.app)
Follow the instructions here:
https://github.com/caskroom/homebrew-cask#reporting-bugs
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:528:in `rename'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:528:in `block in mv'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1571:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1587:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1569:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:517:in `mv'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/artifact/moved.rb:69:in `move_back'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/artifact/moved.rb:15:in `uninstall_phase'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:403:in `block in uninstall_artifacts'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:400:in `uninstall_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:362:in `start_upgrade'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/upgrade.rb:59:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/upgrade.rb:29:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/upgrade.rb:29: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:100:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:179:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:179: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:100:in `<main>'
Sentinel:~ admin$ brew cask doctor
==> Homebrew-Cask Version
Homebrew-Cask 1.5.4
caskroom/homebrew-cask (git revision 87e5af; last commit 2018-02-12)
==> macOS
10.13.3
==> SIP
Enabled
==> Java
N/A
==> Homebrew-Cask Install Location
<NONE>
==> Homebrew-Cask Staging Location
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads
~/Library/Caches/Homebrew/Cask (15 files, 961.6MB)
==> Homebrew-Cask Taps:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask (3913 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/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-darwin17
/Library/Ruby/Site/2.3.0/universal-darwin17
/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-darwin17
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/universal-darwin17
/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-darwin17
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin17
==> 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"
I can't check with the latest version right now so all I can say is that 1.5.0 fixed it for me personally.
General troubleshooting steps
--force
and the issue is still present.brew update-reset && brew update
and retried my command.brew doctor
, fixed as many issues as possible and retried my command.Description of issue
Apologies for another permissions issue, but I cannot figure out why the uninstallation process would cause a problem when the installation does not.
I run Homebrew as a non-admin user with sudo privileges and write access to Homebrew directories in
/usr/local/
. As a non-admin, I do not have write permissions for/Applications
, but I get asked for password when it's time to move an app there during installation. This works perfectly fine.However, when trying to uninstall, reinstall or upgrade an app, the password prompt does not appear, and the process crashes with a permission error.
I do not have write access to
/Applications
, but own the directory created during cask installation. For example:Output of your command with
--verbose --debug
Output of
brew cask doctor