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

Homebrew recipe fails with sudo error (MacOS Sierra) #98

Open
mag opened this issue Oct 16, 2016 · 9 comments
Open

Homebrew recipe fails with sudo error (MacOS Sierra) #98

mag opened this issue Oct 16, 2016 · 9 comments

Comments

@mag
Copy link

mag commented Oct 16, 2016

Hi guys!

I have a fresh install of Sierra here and tried to run sprout-wrap. First problem I ran into was that homebrew did not install (see below). I hand-installed homebrew and got past this problem (but ran into another error - will post that one separately)

  * execute[install homebrew] action run[2016-10-16T16:27:46-07:00] INFO: Processing execute[install homebrew] action run (homebrew::default line 39)

    [execute] ==> This script will install:
              /usr/local/bin/brew
              /usr/local/share/doc/homebrew
              /usr/local/share/man/man1/brew.1
              /usr/local/share/zsh/site-functions/_brew
              /usr/local/etc/bash_completion.d/brew
              /usr/local/Homebrew
              ==> The following new directories will be created:
              /usr/local/Cellar
              /usr/local/Homebrew
              /usr/local/Frameworks
              /usr/local/bin
              /usr/local/etc
              /usr/local/include
              /usr/local/lib
              /usr/local/opt
              /usr/local/sbin
              /usr/local/share
              /usr/local/share/zsh
              /usr/local/share/zsh/site-functions
              /usr/local/var
              ==> /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
              sudo: no tty present and no askpass program specified
              Failed during: /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var

    ================================================================================
    Error executing action `run` on resource 'execute[install homebrew]'
    ================================================================================
@ClayShentrup
Copy link

I get the exact same problem.

@aramprice
Copy link
Member

I haven't seen this but I haven't done a fresh install on a recent version of sierra. This issue from the homebrew cookbook might be relevant: sous-chefs/homebrew#111

@aramprice
Copy link
Member

FWIW there has been some discussion internally about dropping sprout in favor of Brewfile plus some sort of dotfiles tooling. Some open questions are bash-it installation/integration and overall bootstrapping/entry-point.

Mostly this has been driven by the fact that macOS ships with an EOL'd ruby which gems are dropping supporting for.

@ClayShentrup
Copy link

@aramprice Good to know! Thanks. Is there any way I can stay posted of any updates on this decision?

@aramprice
Copy link
Member

@ClayShentrup I don't think these are anywhere I can link to. I opened #99 as a place to kick around ideas in a public forum.

@trinitronx
Copy link

This looks similar to chef-cookbooks/homebrew#105. I've just pushed a recipe for working around this issue here. The problem is that homebrew wants to run certain commands with sudo and sudo -E with newer versions, but the default OSX /etc/sudoers file does not allow this.

The fix is to configure sudoers to allow NOPASSWD:SETENV for those commands.

Place the recipe just before homebrew recipes in your run_list. Note that if somehow your user or hostname is not detected properly by the cookbook, it may result in a /etc/sudoers.d/homebrew_chef config file with invalid syntax. This may cause you to get locked out of using sudo, because Chef has bypassed visudo and edited the file directly. I haven't had time to implement Validation + rewind support like chef-cookbooks/sudo, so use at your own risk. If you need to recover after a botched sudoers file edit (you do have "Admin" set on your account still right?), this blog post should help.

@ClayShentrup
Copy link

@aramprice Has there been any thought on this? Is Pivotal actively using Sprout these days?

@aramprice
Copy link
Member

@ClayShentrup there is little active maintenance. Some teams are still using sprout but a growing number are not. The best place to further the discussion is likely #99

@TV4Fun
Copy link

TV4Fun commented May 25, 2017

This is related to Homebrew/homebrew-cask#32954. You can work around this by setting SUDO_ASKPASS before running Homebrew.

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

5 participants