On Wednesday, 7 September 2016 19:11:04 UTC-4, Henrik Lindberg wrote: > > > The call to `find` is in Ruby, not in puppet. There are numerous calls > to find in the Ruby code base. >
Yeah, all the stuff I was looking at was ruby. It hadn't occurred to me to check the puppet codebase itself though. > To find where the error is run the compilation with --trace and look at > the logged exception - it will tell you where in Ruby the error > occurred. From there is should be able to trace backwards. > Aha.. --trace is a big help there. It looks like a bug in the pkgng provider, possibly? > > If you are on the latest 4.x the backtrace will include puppet function > calls as well as Ruby methods to make this easier. > I'm running 4.5.1. It doesn't look like the puppet calls were included, to me. > > The error: > Error: Failed to apply catalog: undefined method `find' for > nil:NilClass > > may come from an `undef` value (translated to Ruby nil in Ruby if you > are using future parser or 4.x) > > Hope this helps pin down where the problem is. > Yeah, I think I found it. zleslie/pkgng failed to create the repository config I asked it to, while deleting the pre-existing default repository (I had purge_repos_d set to true). It looks like in the absence of a functioning repository, the pkgng provider fails to handle the condition of there being no available packages to install, or even list. Thanks for your help! % sudo puppet agent -t --trace Info: Using configured environment 'production' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Info: Caching catalog for puppet.localdomain Info: Applying configuration version '1473304882' Error: Failed to apply catalog: undefined method `find' for nil:NilClass /usr/local/lib/ruby/site_ruby/2.2/puppet/provider/package/pkgng.rb:66:in `block in prefetch' /usr/local/lib/ruby/site_ruby/2.2/puppet/provider/package/pkgng.rb:65:in `each' /usr/local/lib/ruby/site_ruby/2.2/puppet/provider/package/pkgng.rb:65:in `prefetch' /usr/local/lib/ruby/site_ruby/2.2/puppet/transaction.rb:305:in `prefetch' /usr/local/lib/ruby/site_ruby/2.2/puppet/transaction.rb:205:in `prefetch_if_necessary' /usr/local/lib/ruby/site_ruby/2.2/puppet/transaction.rb:97:in `block in evaluate' /usr/local/lib/ruby/site_ruby/2.2/puppet/graph/relationship_graph.rb:116:in `call' /usr/local/lib/ruby/site_ruby/2.2/puppet/graph/relationship_graph.rb:116:in `traverse' /usr/local/lib/ruby/site_ruby/2.2/puppet/transaction.rb:142:in `evaluate' /usr/local/lib/ruby/site_ruby/2.2/puppet/resource/catalog.rb:222:in `block in apply' /usr/local/lib/ruby/site_ruby/2.2/puppet/util/log.rb:155:in `with_destination' /usr/local/lib/ruby/site_ruby/2.2/puppet/transaction/report.rb:118:in `as_logging_destination' /usr/local/lib/ruby/site_ruby/2.2/puppet/resource/catalog.rb:221:in `apply' /usr/local/lib/ruby/site_ruby/2.2/puppet/configurer.rb:171:in `block in apply_catalog' /usr/local/lib/ruby/site_ruby/2.2/puppet/util.rb:223:in `block in benchmark' /usr/local/lib/ruby/2.2/benchmark.rb:303:in `realtime' /usr/local/lib/ruby/site_ruby/2.2/puppet/util.rb:222:in `benchmark' /usr/local/lib/ruby/site_ruby/2.2/puppet/configurer.rb:170:in `apply_catalog' /usr/local/lib/ruby/site_ruby/2.2/puppet/configurer.rb:315:in `run_internal' /usr/local/lib/ruby/site_ruby/2.2/puppet/configurer.rb:186:in `block in run' /usr/local/lib/ruby/site_ruby/2.2/puppet/context.rb:65:in `override' /usr/local/lib/ruby/site_ruby/2.2/puppet.rb:240:in `override' /usr/local/lib/ruby/site_ruby/2.2/puppet/configurer.rb:185:in `run' /usr/local/lib/ruby/site_ruby/2.2/puppet/agent.rb:45:in `block (4 levels) in run' /usr/local/lib/ruby/site_ruby/2.2/puppet/agent/locker.rb:21:in `lock' /usr/local/lib/ruby/site_ruby/2.2/puppet/agent.rb:45:in `block (3 levels) in run' /usr/local/lib/ruby/site_ruby/2.2/puppet/agent.rb:98:in `with_client' /usr/local/lib/ruby/site_ruby/2.2/puppet/agent.rb:42:in `block (2 levels) in run' /usr/local/lib/ruby/site_ruby/2.2/puppet/agent.rb:65:in `run_in_fork' /usr/local/lib/ruby/site_ruby/2.2/puppet/agent.rb:41:in `block in run' /usr/local/lib/ruby/site_ruby/2.2/puppet/application.rb:179:in `call' /usr/local/lib/ruby/site_ruby/2.2/puppet/application.rb:179:in `controlled_run' /usr/local/lib/ruby/site_ruby/2.2/puppet/agent.rb:39:in `run' /usr/local/lib/ruby/site_ruby/2.2/puppet/application/agent.rb:353:in ` onetime' /usr/local/lib/ruby/site_ruby/2.2/puppet/application/agent.rb:331:in `run_command' /usr/local/lib/ruby/site_ruby/2.2/puppet/application.rb:344:in `block in run' /usr/local/lib/ruby/site_ruby/2.2/puppet/util.rb:540:in `exit_on_fail' /usr/local/lib/ruby/site_ruby/2.2/puppet/application.rb:344:in `run' /usr/local/lib/ruby/site_ruby/2.2/puppet/util/command_line.rb:128:in `run' /usr/local/lib/ruby/site_ruby/2.2/puppet/util/command_line.rb:72:in `execute ' /usr/local/bin/puppet:5:in `<main>' -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/2582e30c-5a8f-4b2b-b456-bc1cbbf29b89%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
