Ask Your Question
0

getaddrinfo failure but only as daemon

asked 2014-05-02 00:25:13 -0500

ladlestein gravatar image

updated 2014-05-02 21:02:36 -0500

Why might I see that typical getaddrinfo failure only when the puppet agent runs as a daemon?

When I run the agent manually:

sudo puppet agent --no-daemonize --onetime

I get the results I want; the agent downloads a catalog and updates the system accordingly. Note that I'm not specifying a server, so the server in my config should be correct.

But I have the daemon started. I used

sudo service puppet start

And the results look like this in syslog:

May  2 05:02:28 ip-10-167-1-48 puppet-agent[6813]: Unable to fetch my node definition, but the agent run will continue:
May  2 05:02:28 ip-10-167-1-48 puppet-agent[6813]: getaddrinfo: Name or service not known
May  2 05:02:28 ip-10-167-1-48 puppet-agent[6813]: (/File[/var/lib/puppet/lib]) Failed to generate additional resources using 'eval_generate': getaddrinfo: Name or service not known
May  2 05:02:28 ip-10-167-1-48 puppet-agent[6813]: (/File[/var/lib/puppet/lib]) Could not evaluate: getaddrinfo: Name or service not known Could not retrieve file metadata for puppet://puppet/plugins: getaddrinfo: Name or service not known
May  2 05:02:30 ip-10-167-1-48 puppet-agent[6813]: Could not retrieve catalog from remote server: getaddrinfo: Name or service not known
May  2 05:02:30 ip-10-167-1-48 puppet-agent[6813]: Using cached catalog
May  2 05:02:30 ip-10-167-1-48 puppet-agent[6813]: Finished catalog run in 0.15 seconds
May  2 05:02:30 ip-10-167-1-48 puppet-agent[6813]: Could not send report: getaddrinfo: Name or service not known

EDIT: here's my agent's puppet.conf, from /etc/puppet:

ubuntu@ip-10-167-1-48:~$ more /etc/puppet/puppet.conf
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post

[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY

[agent]
server=puppet.mydomain.com
report=true
pluginsync=true
edit retag flag offensive close merge delete

Comments

1

Please add the puppet.conf from this agent. Also you may wish to carefully inspect the environment of your shell vs. what the initscript (or whatever backs your 'service' call) uses.

ffrank gravatar imageffrank ( 2014-05-02 04:25:45 -0500 )edit

Yes, I wonder about the difference in the shell env vs the init script env. I don't know enough about that service call. Anyway, I've posted the puppet.conf above.

ladlestein gravatar imageladlestein ( 2014-05-02 21:03:56 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-05-03 13:39:41 -0500

ffrank gravatar image

updated 2014-05-05 15:26:54 -0500

Not sure what's going wrong here, but seeing as puppet.mydomain.com is likely not in DNS, you can try and add it to /etc/hosts on each agent.

Edit: Apparently it is also be necessary to specify the server=<name> option in the [main] section instead of [agent].

edit flag offensive delete link more

Comments

I don't want to list the actual domain, so I put "mydomain" in there. The real hostname resolves fine in DNS. Note that puppet works fine when I run via 'puppet agent', which reads the same .conf file.

ladlestein gravatar imageladlestein ( 2014-05-03 16:48:02 -0500 )edit
1

Can you try and move the server=puppet.mydomain.com line from the [agent] section to the [main] section then?

ffrank gravatar imageffrank ( 2014-05-05 07:40:57 -0500 )edit

Yes - that seems to have fixed the problem! Go put it in another answer and I'll accept it.

ladlestein gravatar imageladlestein ( 2014-05-05 12:35:46 -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

2 followers

Stats

Asked: 2014-05-02 00:25:13 -0500

Seen: 8,676 times

Last updated: May 05 '14