Ask Your Question
0

Puppet Master - Could not retrieve fact fqdn/ipaddress?

asked 2014-07-31 19:33:13 -0500

Naftuli Tzvi Kay gravatar image

updated 2014-07-31 19:58:11 -0500

When my local Puppet Agent connects to my Puppet Master, I see the following in the logs:

Aug  1 00:01:14 kungfumaster puppet-master[447]: Could not retrieve fact fqdn
Aug  1 00:01:14 kungfumaster puppet-master[447]: Could not retrieve fact ipaddress

I'm not sure why this is. Is there any reason why the Puppet Master can't retrieve these facts? Is this an issue that the Puppet Agent isn't providing these facts to the Puppet Master or that the Puppet Master itself can't fetch them?

It seems that the warnings are generated from here in the Puppet::Resource::Catalog::Compiler.set_server_facts method. I'm not sure why it can't get the facts, as I can get them both from irb and from the facter command-line tool.

I can get both facts using the facter command-line tool on the machine and both work just fine.

edit retag flag offensive close merge delete

Comments

This seems to be a bug in Puppet.

Naftuli Tzvi Kay gravatar imageNaftuli Tzvi Kay ( 2014-07-31 21:11:20 -0500 )edit

can you please add your puppet and facter version?

Stefan gravatar imageStefan ( 2014-08-04 17:30:06 -0500 )edit

Please see PUP-3000, which describes the issue in more detail: https://tickets.puppetlabs.com/browse/PUP-3000. Facter version is 2.1.0 and Puppet version is 3.6.2.

Naftuli Tzvi Kay gravatar imageNaftuli Tzvi Kay ( 2014-08-06 11:15:06 -0500 )edit

thanks for the additional input. Updated my answer

Stefan gravatar imageStefan ( 2014-08-06 19:33:09 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2014-08-02 13:40:08 -0500

Stefan gravatar image

updated 2014-08-06 17:51:40 -0500

If I understand this correctly the puppet master tries to mix in some server side facts to the facts provided by your agent, so you can e.g. access the masters fqdn as $servername in your manifests (see docs)

So can you please run facter fqdn ipaddress on your puppet master?

Update: For some facts facter relies on the $PATH variable. Example: To determine the hostname, the hostname fact runs Facter::Core::Execution.execute('hostname') and will in turn try to find the executable in one of the $PATH directories. Now in your case the $PATH variable seems to be :/usr/sbin:/sbin (which puppet mixes in as default) but I am missing /bin and /usr/bin here.

Is this intentional that users other than root (or the puppet user in particular) have an empty $PATH variable? If this is by design, you should add the path setting in your config.

edit flag offensive delete link more

Comments

Facter, both from `irb` and from the command-line `facter` tool works great on the Puppet Master machine. Moreover, the Puppet Master doesn't output these errors when running in standalone WEBrick mode; I only see this error when running Puppet Master in Passenger with `--rack`.

Naftuli Tzvi Kay gravatar imageNaftuli Tzvi Kay ( 2014-08-04 14:09:19 -0500 )edit

I certainly didn't modify the PATH for user 'puppet'. I'm not sure why this is, I'm going to see what I can do about it to work around it and see if I can get it to work using `--path` or `path=...`.

Naftuli Tzvi Kay gravatar imageNaftuli Tzvi Kay ( 2014-08-06 20:49:27 -0500 )edit

Okay, so that worked, evidently, the Puppet Master doesn't properly migrate the environment variables in --rack mode.

Naftuli Tzvi Kay gravatar imageNaftuli Tzvi Kay ( 2014-08-06 21:08:36 -0500 )edit
0

answered 2014-08-12 14:58:04 -0500

Naftuli Tzvi Kay gravatar image

When I did this in my config.ru:

puts "PATH: " + ENV.fetch("PATH", "null")

I got PATH: null as the output: ie, PATH isn't defined when it runs.

My solution was to fix this by adding it to the environment variables:

ENV['PATH'] = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

This fixes both of my problems.

edit flag offensive delete link more
0

answered 2014-08-04 06:52:39 -0500

mapa3m gravatar image

Are you running "facter" on command line as the same user that Puppet Agent is running as? Try running "puppet agent -t --noop" as the same user you ran "facter" as, see if the results are the same.

edit flag offensive delete link more

Comments

This is a problem in the _master_, not the agent.

Naftuli Tzvi Kay gravatar imageNaftuli Tzvi Kay ( 2014-08-04 14:07:19 -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

Stats

Asked: 2014-07-31 19:33:13 -0500

Seen: 4,051 times

Last updated: Aug 12 '14