On 07/09/16 20:58, Matthew Pounsett wrote:

Having just installed zleslie/pkgng in order to ma nage repositories on
my FreeBSD hosts (which in turn required and installed
puppetlabs/stdlib), I'm now getting the following error from my puppet runs:

% sudo puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for puppet.localdomain
Info: Applying configuration version '1473274285'
Error: Failed to apply catalog: undefined method `find' for nil:NilClass

I've checked, and the only place where a find method is called,
anywhere, is within stdlib in the file_line provider and resource, and
in the get_module_path function.

% sudo find . -type f |xargs fgrep -l .find

./modules/stdlib/lib/puppet/provider/file_line/ruby.rb

./modules/stdlib/lib/puppet/parser/functions/get_module_path.rb

./modules/stdlib/spec/unit/puppet/type/file_line_spec.rb


The only one of these called from outside of stdlib is file_line, and
it's called by zleslie/pkgng:

% sudo find . -type f |xargs egrep -l '(file_line|get_module_path)'
./modules/stdlib/CHANGELOG.md
./modules/stdlib/examples/file_line.pp
./modules/stdlib/lib/puppet/provider/file_line/ruby.rb
./modules/stdlib/lib/puppet/type/file_line.rb
./modules/stdlib/lib/puppet/parser/functions/load_module_metadata.rb
./modules/stdlib/lib/puppet/parser/functions/get_module_path.rb
./modules/stdlib/spec/acceptance/get_module_path_spec.rb
./modules/stdlib/spec/functions/load_module_metadata_spec.rb
./modules/stdlib/spec/functions/get_module_path_spec.rb
./modules/stdlib/spec/unit/puppet/type/file_line_spec.rb
./modules/stdlib/spec/unit/puppet/provider/file_line/ruby_spec.rb
./modules/stdlib/README.markdown
./modules/stdlib/checksums.json
./modules/pkgng/manifests/init.pp

I've tried temporarily commenting out the call to file_line that appears
in the pkgng module, and that does not make the error go away.

I'm left with the conclusion that there's a bug in stdlib, but the lack
of debug output makes this hard to track down.   Anyone have any
suggestions for further nailing down which use of 'find' is the error?


The call to `find` is in Ruby, not in puppet. There are numerous calls to find in the Ruby code base. 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.

If you are on the latest 4.x the backtrace will include puppet function calls as well as Ruby methods to make this easier.

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.

Regards,
- henrik

Or is this a known bug?


--
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 puppet-users+unsubscr...@googlegroups.com
<mailto:puppet-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/4babef51-20d7-4375-9be8-d210874b2534%40googlegroups.com
<https://groups.google.com/d/msgid/puppet-users/4babef51-20d7-4375-9be8-d210874b2534%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5e4bf29a-fa21-d5f5-05ed-ea6d4d3f2abd%40puppet.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to