Failed when searching for node <fqdn>

Server said:
Failed when searching for node <fqdn>: Failed to find <fqdn> via exec:
Execution of '/etc/puppet/node.rb <fqdn>' returned 1

The client said:
Error 400 on SERVER: Failed when searching for node <hostname>

Just wanted you guys to know a possible solution for this error. We
experienced this error in the following environment:

Server:
Ubuntu 14.04 64-Bit LTS
Foreman 1.7
Puppet 3.7.3

Client:
Windows 8.1 German
Puppet 3.7.3 Agent

We realized it has something to do with the facts our Windows Clients was
sending to the server. Manually executing /etc/puppet/node.rb <fqdn> on the
server side displayed proper results.

http://projects.puppetlabs.com/issues/12702 did not solve it for us. We
ended up by editing the code of C:\Program Files\Puppet
Labs\Puppet\facter\lib\facter\timezone.rb to:

Facter.add("timezone") do
setcode do
Time.new.zone.gsub(/[^\d\sa-zA-Z.-]/, '')
end
end

gsub and regex that allows only a-z, A-Z, 0-9, underscore, dot, hyphen or
whitespace other characters will be replaced by underscore.

\d any digit
\s any whitespace

By this workaround we replaced all German Umlauts äöü (and more)… with an
underscore. This replaced the timezone facter string "Mitteleuropäische
Zeit" to
<https://puppet.fce.com/fact_values?search=facts.timezone+%3D+"Mitteleurop_ische+Zeit">"Mitteleurop_ische
Zeit" which is ok for us and everything is working fine again with our
Windows Puppet Agents.
<https://puppet.fce.com/fact_values?search=facts.timezone+%3D+"Mitteleurop_ische+Zeit">

Hope this information helps to save some time if you ever experience a
similar behavior.
<https://puppet.fce.com/fact_values?search=facts.timezone+%3D+"Mitteleurop_ische+Zeit">