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

Various brew commands failing with Error: stack level too deep #2007

Closed
tsuna opened this issue Feb 13, 2017 · 14 comments
Closed

Various brew commands failing with Error: stack level too deep #2007

tsuna opened this issue Feb 13, 2017 · 14 comments

Comments

@tsuna
Copy link

tsuna commented Feb 13, 2017

Hi there,
Since I contributed updated formulae for Go (Homebrew/homebrew-core#9304 and Homebrew/homebrew-core#9305), various brew commands (including, sadly, brew doctor) fail with Error: stack level too deep. I've run brew update twice, I've tried re-running the installation script. It seems that the problem occurs when homebrew-core is not checked out on the master branch:

$ brew doctor
Error: stack level too deep
Please report this bug:
  http://docs.brew.sh/Troubleshooting.html
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:48
$ brew config
HOMEBREW_VERSION: >1.1.0 (no git repository)
ORIGIN: https://github.com/Homebrew/brew
HEAD: e116ba196e2834025c713a2a566e0e150907d6d0
Last commit: 10 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 45f0344702b212298f4913c40765e2af1327d0d8
Core tap last commit: 3 weeks ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit ivybridge
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.11.0 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_102, 1.7.0_45
macOS: 10.12.3-x86_64
Xcode: N/A
CLT: 8.2.0.0.1.1480973914
X11: 2.7.11 => /opt/X11
$ brew outdated
Error: stack level too deep
Please report this bug:
  http://docs.brew.sh/Troubleshooting.html
/usr/local/Homebrew/Library/Homebrew/tap.rb:28
$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
$ git status
On branch go-1.7.5
Your branch is up-to-date with 'tsuna/go-1.7.5'.
nothing to commit, working tree clean
$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

This fixes it. I'm not sure why being on that branch (the state of which you can find here: https://github.com/tsuna/homebrew-core/tree/go-1.7.5) would cause this stack overflow error. How can I troubleshoot this further?

Not that I care much anyway, since I don't intend to stay on that branch as the changes have merged upstream anyway, but I found this error very confusing and not easy to root cause, and I'm puzzled as to why this would make various brew commands fail like that.

@MikeMcQuaid
Copy link
Member

Try brew outdated --debug and paste the output here. Thanks!

@tsuna
Copy link
Author

tsuna commented Feb 14, 2017

$ brew outdated --debug
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ant.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science/arpack.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/aspcud.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/aspell.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/autoconf.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/automake.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bison.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb/buck.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cairo.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/camlp4.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/clasp.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cmake.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/curl.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/docker.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/docker-machine.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/dos2unix.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science/dotwrp.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/epstool.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/exiftool.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/fann.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science/fann.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ffmpeg.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/fftw.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/figlet.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/fltk.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/fontconfig.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/freetype.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gawk.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gd.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gdb.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gdbm.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gettext.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gfortran.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ghostscript.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gifsicle.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gl2ps.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glib.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science/glpk.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gmp.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gnu-sed.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gnupg.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gnuplot.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gnutls.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/go.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gobject-introspection.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gperftools.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/graphicsmagick.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/graphviz.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gringo.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/harfbuzz.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science/hdf5.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/hub.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/icu4c.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/id3ed.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/imagemagick.rb
Error: stack level too deep
Please report this bug:
  http://docs.brew.sh/Troubleshooting.html
/usr/local/Homebrew/Library/Homebrew/tap.rb:28

@MikeMcQuaid
Copy link
Member

HOMEBREW_VERSION: >1.1.0 (no git repository)

This is concerning. Make sure you've committed everything to all your branches and run brew update-reset.

@tsuna
Copy link
Author

tsuna commented Feb 14, 2017

I don't have any local changes that haven't merged upstream, so I ran brew update-reset and after that when I checkout the branch go-1.7.5 in homebrew-core I still have the same error when running brew outdated --debug.

@MikeMcQuaid
Copy link
Member

What about the master branch? What's the diff on go-1.7.5?

@tsuna
Copy link
Author

tsuna commented Feb 14, 2017

As I mentioned earlier, it works fine on the master branch. I also provided a link above to the contents of my go-1.7.5 branch, which was automagically created by brew bump-formula-pr when sending the PR Homebrew/homebrew-core#9304. I had forgotten about it and stayed on that branch since then, which recently started to cause this weird error. It took me quite some time to realize that I was on that branch and that switching back to master would fix the problem, so I decided to file this issue to get some advice on why this could be happening, as it looked fishy and could maybe help someone else down the road if they run into the same situation.

@MikeMcQuaid
Copy link
Member

What's your brew config output now? Thanks!

@tsuna
Copy link
Author

tsuna commented Feb 15, 2017

With homebrew-core on the master branch:

$ brew config
HOMEBREW_VERSION: >1.1.0 (no git repository)
ORIGIN: https://github.com/Homebrew/brew
HEAD: e116ba196e2834025c713a2a566e0e150907d6d0
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 65c0b5b6bb41cbd9fd8b84fe9a010f7896668557
Core tap last commit: 21 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit ivybridge
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.11.0 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_102, 1.7.0_45
macOS: 10.12.3-x86_64
Xcode: N/A
CLT: 8.2.0.0.1.1480973914
X11: 2.7.11 => /opt/X11

@MikeMcQuaid
Copy link
Member

HOMEBREW_VERSION: >1.1.0 (no git repository)

This is still pretty weird and concerning. Have you always seen no git repository here?

What does brew tap output (or brew tap --debug if it throws an exception)? Thanks!

@MikeMcQuaid
Copy link
Member

Closing due to no response.

@slhck
Copy link

slhck commented Jul 24, 2017

@MikeMcQuaid I've just experienced the same issue, most probably due to having contributed the formula bento4 a few days ago.

I ran brew update-reset and it solved the problem.

My question is: is that a required step after contributing a formula (i.e. something that contributors need to do), and if so, couldn't this be somewhat automated? Or is it just a bug?


Here's my info before running brew update-reset:

$ brew upgrade
Error: stack level too deep
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:47

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Error: stack level too deep
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:338

My config:

$ brew config
HOMEBREW_VERSION: 1.2.4-107-gaa8eb21
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: aa8eb21b8c650a2d0a5a060ff27507da60a17bee
Last commit: 11 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 385e49f8b16140ffb9852bd85bce23373d12cf87
Core tap last commit: 4 days ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit haswell
Homebrew Ruby: 2.0.0-p481
Clang: 7.0 build 700
Git: 2.13.3 => /usr/local/bin/git
Perl: /usr/local/bin/perl => /usr/local/Cellar/perl/5.26.0/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /Users/werner/.rbenv/shims/ruby => /Users/werner/.rbenv/versions/2.3.0/bin/ruby
Java: 1.6.0_65-b14-466.1
macOS: 10.10.5-x86_64
Xcode: 7.2.1
CLT: 7.2.0.0.1.1447826929
X11: 2.7.11 => /opt/X11
$ brew tap
caskroom/cask
chainsawbaby/formula
homebrew/boneyard
homebrew/core
homebrew/dupes
homebrew/fuse
homebrew/python
homebrew/science
homebrew/services
homebrew/x11
icalialabs/formulae

Please let me know if you need more info.

@MikeMcQuaid
Copy link
Member

My question is: is that a required step after contributing a formula (i.e. something that contributors need to do), and if so, couldn't this be somewhat automated? Or is it just a bug?

It sounds like a bug. If you can create a reproducible set of commands after running brew update-reset: please open a new issue and we'll look at fixing it, thanks.

@slhck
Copy link

slhck commented Jul 25, 2017

I'm not sure how to recreate / reproduce it without actually contributing or updating a formula. But I'll keep this in mind next time opening a PR.

@cybertk
Copy link

cybertk commented Jul 31, 2017

brew update-reset fixed my issue

@Homebrew Homebrew locked and limited conversation to collaborators Jul 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants