Bug #10546
Failed to parse template apache/munin-stats: Could not find value for 'hostname'
| Status: | Needs More Information | Start date: | 11/04/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | templates | |||
| Target version: | - | |||
| Affected Puppet version: | 2.7.6 | Branch: | ||
| Keywords: | ||||
| Votes: | 1 |
Description
I tried to upgrade my puppetmaster and one node to 2.7.6, but when I ran it, I got this error:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template apache/munin-stats: Could not find value for 'hostname' at 7:/etc/puppet/modules/apache/templates/munin-stats at /etc/puppet/modules/apache/manifests/init.pp:90 on node
The template is simple:
# create a virtual host which provides statistics for munin ExtendedStatus on # hide this a little bit from "normal" accesses Listen <%= real_munin_stats_port %> NameVirtualHost *:<%= real_munin_stats_port %>> ServerName <%= hostname %> Order deny,allow Deny from all SetHandler server-status Order deny,allow Deny from all Allow from <%= ipaddress %> Allow from 127.0.0.1 ErrorLog /var/log/apache2/munin-error.log CustomLog /var/log/apache2/munin-access.log combined
and the facter fact ‘hostname’ is available on the system:
eider# facter hostname eider
I’m sorry if this is a duplicate of another issue, I searched around but could not find anything obviously the same.
History
Updated by Espen Tagestad 6 months ago
I got the same problem, on FreeBSD 8.2-RELEASE running puppet-2.7.6:
dimuweb-test# pcons (alias for /usr/local/sbin/puppetd --server puppet.kulturit.no --rundir /var/run/puppet --vardir /var/puppet --onetime --verbose --report --pluginsync --no-daemonize)
info: Retrieving plugin
info: Loading facts in get_installed_ports
info: Loading facts in parent
info: Loading facts in get_installed_ports
info: Loading facts in parent
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template dimuweb31/httpd-vhosts.conf/MASTER.erb: Could not find value for 'hostname' at 31:/usr/local/etc/puppet/templates/dimuweb31/httpd-vhosts.conf/MASTER.erb at /usr/local/etc/puppet/modules/dimuweb31/manifests/init.pp:32 on node dimuweb-test.mid.no
info: Not using expired catalog for dimuweb-test.mid.no from cache; expired at Wed Nov 09 15:09:51 +0100 2011
notice: Using cached catalog
err: Could not retrieve catalog; skipping run
dimuweb-test#
On the server:
Nov 9 15:43:24 puppet puppet-master[12460]: Host is missing hostname and/or domain: dimuweb-test.mid.no
Nov 9 15:43:24 puppet puppet-master[12460]: Failed to parse template dimuweb31/httpd-vhosts.conf/MASTER.erb: Could not find value for 'hostname' at 31:/usr/local/etc/puppet/templates/dimuweb31/httpd-vhosts.conf/MASTER.erb at /usr/local/etc/puppet/modules/dimuweb31/manifests/init.pp:32 on node dimuweb-test.mid.no
Nov 9 15:43:24 puppet puppet-master[12460]: Failed to parse template dimuweb31/httpd-vhosts.conf/MASTER.erb: Could not find value for 'hostname' at 31:/usr/local/etc/puppet/templates/dimuweb31/httpd-vhosts.conf/MASTER.erb at /usr/local/etc/puppet/modules/dimuweb31/manifests/init.pp:32 on node dimuweb-test.mid.no
Its something about the hostname, but it is indeed fqdn as the log states itself.
Thanks for any advice.
Updated by Ian Ward 6 months ago
I’m also running into this issue. Same basic scenario as @micah. This worked fine on .25 Ubuntu Lucid package, but upgrading the client to 2.7.6 I get this issue.
Updated by Ian Ward 6 months ago
I added pluginsync=true to the client’s puppet.conf (it was already on in the server .conf) and this fixed the problem for me. I have a vague memory that on .25 having pluginsync=true caused other bugs.
Updated by Daniel Pittman 5 months ago
- Status changed from Unreviewed to Needs More Information
Ian Ward wrote:
I added
pluginsync=trueto the client’s puppet.conf (it was already on in the server .conf) and this fixed the problem for me. I have a vague memory that on .25 having pluginsync=true caused other bugs.
Hey. So, this looks kind of like a facter bug, rather than a puppet bug. If one you can can reproduce this, can you check the output of facter hostname for me and tell me if it returns (a) the hostname, or (b) something else, or © nothing?
That will help make sure we check the right place to fix this.
Updated by micah - 5 months ago
Facter returns what I expect: the hostname.
This is not an issue with 2.6, which I have been using for some time with the same version of facter.
Updated by Daniel Pittman 5 months ago
micah – wrote:
Facter returns what I expect: the hostname. This is not an issue with 2.6, which I have been using for some time with the same version of facter.
OK. The specific code should be looking at three values; can I see the actual values of facter fqdn, facter hostname, and facter domain please? To hit the code path above requires that fqdn is absent, and that one of hostname or domain is also absent, which seems odd.