rodjek / librarian-puppet

http://librarian-puppet.com
MIT License
693 stars 209 forks source link

Ruby recurssion limit #217

Closed bpgoldsb closed 9 years ago

bpgoldsb commented 10 years ago

While trying to use librarian-puppet, using a Puppetfile containing 61 modules (31 git, 30 forge), I'm getting the below error. It's possible I have a bad dependency tree in some modules, but it would be nice to throw a better error than this:

/usr/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/shell/basic.rb:295:in `prepare_message': stack level too deep (SystemStackError)
    from /usr/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/shell/basic.rb:80:in `say'
    from /usr/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/ui.rb:32:in `debug'
    from /usr/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/logger.rb:31:in `debug'
    from /usr/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/source/git/repository.rb:183:in `debug'
    from /usr/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/source/git/repository.rb:154:in `logging_command'
    from /usr/lib/ruby/site_ruby/1.8/puppet/module_tool/modulefile.rb:15:in `each'
    from /usr/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/source/git/repository.rb:153:in `lines'
    from /usr/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/source/git/repository.rb:153:in `each'
     ... 1172 levels...
    from /usr/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
    from /usr/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.2/bin/librarian-puppet:7
    from /usr/bin/librarian-puppet:19:in `load'
    from /usr/bin/librarian-puppet:19

Verbose log: https://gist.github.com/bpgoldsb/5d83b58fd86ed0fa1fe9 Puppetfile: https://gist.github.com/bpgoldsb/1170cfad5fb33fb381c8 Puppetfile.lock: https://gist.github.com/bpgoldsb/dd6a677b339d4ce45120 Version of ruby: 1.8.7 librarian-puppet: 1.0.2 puppet: 3.4.3 Distro: CentOS 6.5

carlossg commented 10 years ago

Sorry, I can't reproduce because many modules are not public, and I can't see easily where the problem could be

markheily commented 10 years ago

I had a similar problem, and was able to solve it by raising the stack limit of the shell:

ulimit -s 99999

carlossg commented 10 years ago

@markheily do you have an example to reproduce it?

markheily commented 10 years ago

Unfortunately no, I can't share the entire set of modules. It's a rather large tree with 150 modules in it.

carlossg commented 9 years ago

What would need to be done is convert recursive_resolve to make it non recursive

https://github.com/carlossg/librarian/blob/librarianp/lib/librarian/resolver/implementation.rb#L55