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

permissions denied installing with Homebrew cask OS X 10.11.6 #150

Open
patkaehuaea opened this issue Oct 12, 2016 · 2 comments
Open

permissions denied installing with Homebrew cask OS X 10.11.6 #150

patkaehuaea opened this issue Oct 12, 2016 · 2 comments
Labels
Milestone

Comments

@patkaehuaea
Copy link

patkaehuaea commented Oct 12, 2016

I'm able to run bootstrap.rb, but it appears I fail when installing I get permissions errors writing to:

~/Library/Caches/Homebrew/Cask/atom

The workaround is to simply:

$ sudo chown -R $USER ~/Library/Caches/Homebrew/

While the workaround is easy, it leads to a less streamlined bootstrap as the user needs to identify the issue, then apply the workaround.

What are your thoughts about where to implement a fix? Is there something we can do in this cookbook or do we pursue a fix here?:

https://github.com/chef-cookbooks/homebrew/blob/master/recipes/cask.rb

Recipe: homebrew::cask
  * homebrew_tap[caskroom/cask] action tap
    * execute[tapping caskroom/cask] action run (skipped due to not_if)
     (up to date)
  * directory[/Library/Caches/Homebrew/Casks] action create (skipped due to only_if)
Recipe: atom::mac_os_x
  * homebrew_cask[atom] action install
    * execute[installing cask atom] action run

      ================================================================================
      Error executing action `run` on resource 'execute[installing cask atom]'
      ================================================================================

      Mixlib::ShellOut::ShellCommandFailed
      ------------------------------------
      Expected process to exit with [0], but received '1'
      ---- Begin output of /usr/local/bin/brew cask install atom  ----
      STDOUT: ==> Satisfying dependencies
      complete
      ==> Downloading https://github.com/atom/atom/releases/download/v1.11.1/atom-mac.zip
      STDERR: Error: Download failed on Cask 'atom' with message: Permission denied - /Users/pkaehuae/Library/Caches/Homebrew/Cask/atom--1.11.1.zip.incomplete
      ---- End output of /usr/local/bin/brew cask install atom  ----
      Ran /usr/local/bin/brew cask install atom  returned 1

      Resource Declaration:
      ---------------------
      # In /var/folders/gw/493jck215z5292vrj0vs2004xt283x/T/chefdk_bootstrap-20161012-38299-5mawdl/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb

       29:   execute "installing cask #{new_resource.name}" do
       30:     command "/usr/local/bin/brew cask install #{new_resource.name} #{new_resource.options}"
       31:     user homebrew_owner
       32:     environment lazy { { 'HOME' => ::Dir.home(homebrew_owner), 'USER' => homebrew_owner } }
       33:     not_if { new_resource.casked? }
       34:   end
       35: end

      Compiled Resource:
      ------------------
      # Declared in /var/folders/gw/493jck215z5292vrj0vs2004xt283x/T/chefdk_bootstrap-20161012-38299-5mawdl/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb:29:in `block in class_from_file'

      execute("installing cask atom") do
        action [:run]
        retries 0
        retry_delay 2
        default_guard_interpreter :execute
        command "/usr/local/bin/brew cask install atom "
        backup 5
        environment #<Chef::DelayedEvaluator:0x007fcd00a1c730@/var/folders/gw/493jck215z5292vrj0vs2004xt283x/T/chefdk_bootstrap-20161012-38299-5mawdl/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb:32>
        returns 0
        user "pkaehuae"
        declared_type :execute
        cookbook_name "atom"
        homebrew_owner "pkaehuae"
        not_if { #code block }
      end

      Platform:
      ---------
      x86_64-darwin13


    ================================================================================
    Error executing action `install` on resource 'homebrew_cask[atom]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    execute[installing cask atom] (/var/folders/gw/493jck215z5292vrj0vs2004xt283x/T/chefdk_bootstrap-20161012-38299-5mawdl/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
    ---- Begin output of /usr/local/bin/brew cask install atom  ----
    STDOUT: ==> Satisfying dependencies
    complete
    ==> Downloading https://github.com/atom/atom/releases/download/v1.11.1/atom-mac.zip
    STDERR: Error: Download failed on Cask 'atom' with message: Permission denied - /Users/pkaehuae/Library/Caches/Homebrew/Cask/atom--1.11.1.zip.incomplete
    ---- End output of /usr/local/bin/brew cask install atom  ----
    Ran /usr/local/bin/brew cask install atom  returned 1

    Resource Declaration:
    ---------------------
    # In /var/folders/gw/493jck215z5292vrj0vs2004xt283x/T/chefdk_bootstrap-20161012-38299-5mawdl/local-mode-cache/cache/cookbooks/atom/recipes/mac_os_x.rb

     22: homebrew_cask 'atom'

    Compiled Resource:
    ------------------
    # Declared in /var/folders/gw/493jck215z5292vrj0vs2004xt283x/T/chefdk_bootstrap-20161012-38299-5mawdl/local-mode-cache/cache/cookbooks/atom/recipes/mac_os_x.rb:22:in `from_file'

    homebrew_cask("atom") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :homebrew_cask
      cookbook_name "atom"
      recipe_name "mac_os_x"
    end

    Platform:
    ---------
    x86_64-darwin13


Running handlers:
[2016-10-12T11:15:23-07:00] ERROR: Running exception handlers
Running handlers complete
[2016-10-12T11:15:23-07:00] ERROR: Exception handlers complete
Chef Client failed. 2 resources updated in 11 seconds
[2016-10-12T11:15:23-07:00] FATAL: Stacktrace dumped to /var/folders/gw/493jck215z5292vrj0vs2004xt283x/T/chefdk_bootstrap-20161012-38299-5mawdl/local-mode-cache/cache/chef-stacktrace.out
[2016-10-12T11:15:23-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-10-12T11:15:23-07:00] ERROR: homebrew_cask[atom] (atom::mac_os_x line 22) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[installing cask atom] (/var/folders/gw/493jck215z5292vrj0vs2004xt283x/T/chefdk_bootstrap-20161012-38299-5mawdl/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/bin/brew cask install atom  ----
STDOUT: ==> Satisfying dependencies
complete
==> Downloading https://github.com/atom/atom/releases/download/v1.11.1/atom-mac.zip
STDERR: Error: Download failed on Cask 'atom' with message: Permission denied - /Users/pkaehuae/Library/Caches/Homebrew/Cask/atom--1.11.1.zip.incomplete
---- End output of /usr/local/bin/brew cask install atom  ----
Ran /usr/local/bin/brew cask install atom  returned 1
[2016-10-12T11:15:23-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
./bootstrap.rb:208:in `run': Chef-client failed (RuntimeError)
    from ./bootstrap.rb:227:in `<main>'
@patkaehuaea patkaehuaea changed the title permissions denied installing with Homebrew cask OS X 10.1.6 permissions denied installing with Homebrew cask OS X 10.11.6 Oct 12, 2016
@oifland
Copy link
Contributor

oifland commented Oct 12, 2016

Thanks for providing that workaround, @patkaehuaea. It seems like something that might make sense to fix upstream as you mentioned. I don't have bandwidth right now to pursue the fix, but I'm happy to add vocal support to an upstream fix for the homebrew cookbook.

@patkaehuaea
Copy link
Author

patkaehuaea commented Oct 12, 2016

@oifland ... sous-chefs/homebrew#110

Given they're already setting owner on a similar directory (that doesn't appear to exist for me), I don't see why we couldn't the directory I'm having to update.

@MarkGibbons MarkGibbons added this to the 2.0 milestone Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants