About | FAQ | Help
Ask Your Question

puppet & facter runs : private method `split' called for nil:NilClass

asked 2017-08-21 18:45:09 -0500

cm01 gravatar image

Hi Guys

If I run a 'puppet agent' or 'facter -p' on a client, I get

private method `split' called for nil:NilClass
Using stale cache

right at the very top of the output ie whilst agent is still loading facts....
Oddly enough this doesn't happen with just 'facter' on its own.
I have tried adding -d (debug) but I don't get any useful info eg for

puppet agent -t --noop --debug

Debug: Using settings: adding file resource 'ssldir': 'File[/etc/puppet/ssl]{:links=
>:follow, :backup=>false, :owner=>"puppet", :ensure=>:directory, :mode=>"771", :loglevel=>
:debug, :path=>"/etc/puppet/ssl"}'
Debug: Using settings: adding file resource 'lastrunreport': 'File[/var/lib/puppet/s
tate/last_run_report.yaml]{:links=>:follow, :backup=>false, :ensure=>:file, :mode=>"640", 
:loglevel=>:debug, :path=>"/var/lib/puppet/state/last_run_report.yaml"}'
--More--private method `split' called for nil:NilClass
Using stale cache
private method `split' called for nil:NilClass
Using stale cache
Debug: Puppet::Type::Group::ProviderPw: file pw does not exist
Debug: Puppet::Type::Group::ProviderDirectoryservice: file /usr/bin/dscl does not exist

facter -p -d 
private method `split' called for nil:NilClass
Using stale cache
Not an EC2 host
Found no suitable resolves of 1 for selinux_config_mode
value for selinux_config_mode is still nil
value for pe_version is still nil
Found no suitable resolves of 1 for pe_minor_version
value for pe_minor_version is still nil
value for ipaddress6_lo is still nil
No fact for boardmanufacturer

... etc.
1. The above 'error msgs' are not actually a problem (apart from the splt & stale cache msgs ofc) and occur on well behaved machine also in debug mode.
2. Note that it doesn't seem to stop puppet or facter running but we need to clear this up as it's a prod system.
3. For 'facter -p', the msg occurs once, but twice for 'puppet agent ...'


edit retag flag offensive close merge delete


So, this doesn't make any sense, but if I "touch /var/lib/puppet/tmp/foreman_facts", the errors go away... HTH someone else - nearly drove me mad ...

cm01 gravatar imagecm01 ( 2017-08-21 18:46:37 -0500 )edit

So, that means that you have a custom fact that expects that file to exist, and when it doesn't, you get a nil object instead of (I assume) an empty array.

DarylW gravatar imageDarylW ( 2017-08-22 07:28:02 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-21 20:41:45 -0500

bess gravatar image

Facter by default does not resolve Puppet facts, only built in. The p Switch tell it to use Puppet as well.

Please execute 'puppet facts' instead

I'm confused on what the agents OS is. It it OSX?

The error means Facter is calling the Ruby split method on a Nil object rather than an array.

What this working before? There may be a missing dependency Facter needs to resolve the fact.

Need more output to see which Fact is being resolved.

Run Puppet with the debug and trace switches. It should print said Fact.

edit flag offensive delete link more


I sometimes have to run 'sudo facter -p' for it to correctly use my puppet facter facts. Also, if you use the timing flag, it may help show you which facts are at fault

DarylW gravatar imageDarylW ( 2017-08-22 07:29:04 -0500 )edit

That is correct. Mann Facts from Puppet require root. Always run as root unless you know what you're doing :)

bess gravatar imagebess ( 2017-08-22 08:02:36 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-08-21 18:45:09 -0500

Seen: 97 times

Last updated: Aug 21 '17