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

"Permission denied" when trying to install stuff #16

Closed
gdubicki opened this issue Aug 15, 2016 · 5 comments
Closed

"Permission denied" when trying to install stuff #16

gdubicki opened this issue Aug 15, 2016 · 5 comments

Comments

@gdubicki
Copy link

gdubicki commented Aug 15, 2016

I have two users on my machine which I want to have access to homebrew - 'gdubicki' and 'grzegorz'.

First I had to follow instructions from #13 to start using brewdo at all. I used 'grzegorz' account then.

Then I successfully installed a package using 'grzegorz' account and brewdo.

After that I switched to 'gdubicki' account and tried to update brew.

First run:

gdubicki@MacBook-Pro-Greg:~ $ brewdo brew update
mktemp: too few X's in template ‘brewdo’
Updated 6 taps (caskroom/cask, drone/drone, homebrew/core, homebrew/dupes, homebrew/python, homebrew/x11).
==> New Formulae
alot                         gitversion                   lepton                       minio-mc                     presto                       ubertooth
caskroom/cask/brew-cask ✔    grafana                      libbdplus                    nats-streaming-server        (...)
class-dump               horndis                  kjell                    luyten                   quassel                  sqlitebrowser
/Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1460:in `unlink': No such file or directory @ unlink_internal -  (Errno::ENOENT)
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1460:in `block in remove_file'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1465:in `platform_support'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1459:in `remove_file'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1448:in `remove'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:776:in `block in remove_entry'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1502:in `postorder_traverse'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:774:in `remove_entry'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:710:in `remove_entry_secure'
    from /usr/local/bin/brewdo:254:in `block in cmd__do'

second run:

gdubicki@MacBook-Pro-Greg:~ $ brewdo brew update
mktemp: too few X's in template ‘brewdo’
    Updated 1 tap (caskroom/cask).
No changes to formulae.
/Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1460:in `unlink': No such file or directory @ unlink_internal -  (Errno::ENOENT)
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1460:in `block in remove_file'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1465:in `platform_support'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1459:in `remove_file'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1448:in `remove'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:776:in `block in remove_entry'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1502:in `postorder_traverse'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:774:in `remove_entry'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:710:in `remove_entry_secure'
    from /usr/local/bin/brewdo:254:in `block in cmd__do'

So it looks like the update is being done, although with some errors (warnings?).

To test if it's really being done I tried to install a new package, but it failed with:

gdubicki@MacBook-Pro-Greg:~ $ brew install gitversion
mktemp: too few X's in template ‘brewdo’
==> Installing dependencies for gitversion: mono
==> Installing gitversion dependency: mono
==> Downloading https://homebrew.bintray.com/bottles/mono-4.4.2.11.el_capitan.bottle.tar.gz
Warning: Failed to create the file
Warning: /Library/Caches/Homebrew/mono-4.4.2.11.el_capitan.bottle.tar.gz.incomp
Warning: lete: Permission denied

curl: (23) Failed writing body (0 != 16026)
Error: Failed to download resource "mono"
Download failed: https://homebrew.bintray.com/bottles/mono-4.4.2.11.el_capitan.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Installing dependencies for mono: pkg-config
==> Installing mono dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.1_1.el_capitan.bottle.tar.gz
Warning: Failed to create the file
Warning: /Library/Caches/Homebrew/pkg-config-0.29.1_1.el_capitan.bottle.tar.gz.
Warning: incomplete: Permission denied

curl: (23) Failed writing body (0 != 16022)
Error: Failed to download resource "pkg-config"
Download failed: https://homebrew.bintray.com/bottles/pkg-config-0.29.1_1.el_capitan.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.1.tar.gz
Warning: Failed to create the file
Warning: /Library/Caches/Homebrew/pkg-config-0.29.1.tar.gz.incomplete:
Warning: Permission denied

curl: (23) Failed writing body (0 != 16384)
Trying a mirror...
==> Downloading https://fossies.org/linux/misc/pkg-config-0.29.1.tar.gz
Warning: Failed to create the file
Warning: /Library/Caches/Homebrew/pkg-config-0.29.1.tar.gz.incomplete:
Warning: Permission denied

curl: (23) Failed writing body (0 != 8192)
Error: Failed to download resource "pkg-config"
Download failed: https://fossies.org/linux/misc/pkg-config-0.29.1.tar.gz
/Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1460:in `unlink': No such file or directory @ unlink_internal -  (Errno::ENOENT)
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1460:in `block in remove_file'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1465:in `platform_support'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1459:in `remove_file'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1448:in `remove'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:776:in `block in remove_entry'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:1502:in `postorder_traverse'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:774:in `remove_entry'
    from /Users/gdubicki/.rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/fileutils.rb:710:in `remove_entry_secure'
    from /usr/local/bin/brewdo:254:in `block in cmd__do'

How to fix my brew(do) install?

@gdubicki
Copy link
Author

gdubicki commented Aug 15, 2016

Installing stuff from 'grzegorz' account works, but it makes brewdo useless.

@mattieb
Copy link
Collaborator

mattieb commented Sep 21, 2016

This is really confusing to me:

mktemp: too few X's in template ‘brewdo’

because mktemp(1) on macOS should not need Xs in the template at all.

Is there another mktemp program on the failing user's PATH? Unfortunately, brewdo calls out to mktemp directly on line 253, and it could respect PATH in that case. Though that's strange too, since line 253 should only be executed inside the sandbox.

Can you edit line 253 to change mktemp to /usr/bin/mktemp and see if it makes a difference?

@gdubicki
Copy link
Author

Sorry, too late. Today I used brew doctor and restored a single-user homebrew setup using chmods / chowns listed in its output.

mattieb added a commit that referenced this issue Sep 21, 2016
@mattieb
Copy link
Collaborator

mattieb commented Sep 21, 2016

Sorry that didn't work out for you. I am curious if you tried sudo brewdo unmigrate with your username instead of reassigning file permissions and ownerships yourself and if it worked for you.

I did some digging and yes, the GNU coreutils version of mktemp does complain if brewdo tries to invoke it like macOS mktemp:

$ gmktemp -dt brewdo
gmktemp: too few X's in template ‘brewdo’

So I think it's safe to say that the problem was likely exactly that: a GNU version of mktemp came before macOS mktemp in the broken user's PATH. I've pushed a fix and will release 2.0.3 shortly for this.

@gdubicki
Copy link
Author

Thank you for your work on this. I will try brewdo again after you release
2.0.3 then. I'll let you know about the results.

W dniu środa, 21 września 2016 Matt Behrens notifications@github.com
napisał(a):

Sorry that didn't work out for you. I am curious if you tried sudo brewdo
unmigrate with your username instead of reassigning file permissions and
ownerships yourself and if it worked for you.

I did some digging and yes, the GNU coreutils version of mktemp does
complain if brewdo tries to invoke it like macOS mktemp:

$ gmktemp -dt brewdo
gmktemp: too few X's in template ‘brewdo’

So I think it's safe to say that the problem was likely exactly that: a
GNU version of mktemp came before macOS mktemp in the broken user's PATH.
I've pushed a fix and will release 2.0.3 shortly for this.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#16 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAilaKkc3ahm5QOeutgMj6yR9VU9GoS9ks5qsaJpgaJpZM4JkWVD
.

Grzegorz Dubicki
http://about.me/grzegorzdubicki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants